From be2b5c66cf0964a971d4d668e0ac1ca71fd46a21 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Tue, 8 Aug 2023 20:59:19 +0000 Subject: [PATCH 001/275] Bump 6.3.1 --- .changeset/bump-patch-1691528359038.md | 5 +++++ yarn.lock | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/bump-patch-1691528359038.md diff --git a/.changeset/bump-patch-1691528359038.md b/.changeset/bump-patch-1691528359038.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1691528359038.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/yarn.lock b/yarn.lock index 7252fe9dcce8..81c60fc6670a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9898,9 +9898,9 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.0-rc.10 + "@rocket.chat/ui-contexts": 1.0.0 "@rocket.chat/ui-kit": "*" - "@rocket.chat/ui-video-conf": 1.0.0-rc.10 + "@rocket.chat/ui-video-conf": 1.0.0 "@tanstack/react-query": "*" react: "*" react-dom: "*" @@ -9982,14 +9982,14 @@ __metadata: ts-jest: ~29.0.5 typescript: ~5.1.3 peerDependencies: - "@rocket.chat/core-typings": 6.3.0-rc.10 + "@rocket.chat/core-typings": 6.3.0 "@rocket.chat/css-in-js": "*" "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-tokens": "*" "@rocket.chat/message-parser": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-client": 1.0.0-rc.10 - "@rocket.chat/ui-contexts": 1.0.0-rc.10 + "@rocket.chat/ui-client": 1.0.0 + "@rocket.chat/ui-contexts": 1.0.0 katex: "*" react: "*" languageName: unknown @@ -11048,7 +11048,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 1.0.0-rc.10 + "@rocket.chat/ui-contexts": 1.0.0 react: ~17.0.2 languageName: unknown linkType: soft @@ -11202,7 +11202,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.0-rc.10 + "@rocket.chat/ui-contexts": 1.0.0 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -11268,7 +11268,7 @@ __metadata: typescript: ~5.1.3 peerDependencies: "@rocket.chat/layout": "*" - "@rocket.chat/ui-contexts": 1.0.0-rc.10 + "@rocket.chat/ui-contexts": 1.0.0 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From 25d5e3cd9e280f7f38a8e9b7147691830a029f5c Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Wed, 9 Aug 2023 03:01:25 +0530 Subject: [PATCH 002/275] fix: user creation using ADMIN_* variables (#30015) --- .changeset/swift-birds-build.md | 5 +++++ apps/meteor/server/startup/initialData.js | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/swift-birds-build.md diff --git a/.changeset/swift-birds-build.md b/.changeset/swift-birds-build.md new file mode 100644 index 000000000000..4af3bddd875b --- /dev/null +++ b/.changeset/swift-birds-build.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed unable to create admin user using ADMIN\_\* environment variables diff --git a/apps/meteor/server/startup/initialData.js b/apps/meteor/server/startup/initialData.js index b5c81314921a..17ecd9654cbd 100644 --- a/apps/meteor/server/startup/initialData.js +++ b/apps/meteor/server/startup/initialData.js @@ -115,11 +115,11 @@ Meteor.startup(async function () { adminUser.type = 'user'; - const id = await Users.create(adminUser); + const { insertedId: userId } = await Users.create(adminUser); - await Accounts.setPasswordAsync(id, process.env.ADMIN_PASS); + await Accounts.setPasswordAsync(userId, process.env.ADMIN_PASS); - await addUserRolesAsync(id, ['admin']); + await addUserRolesAsync(userId, ['admin']); } else { console.log(colors.red('Users with admin role already exist; Ignoring environment variables ADMIN_PASS')); } From dbcad4476333709978e2b478dec91753b622bee1 Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Fri, 28 Jul 2023 03:03:46 -0300 Subject: [PATCH 003/275] chore: Trigger docs update (#29932) --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1452e5b122d6..aa86468e1895 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -646,3 +646,11 @@ jobs: event-type: new_release repository: RocketChat/Release.Distributions client-payload: '{"tag": "${{ github.ref_name }}"}' + + - name: Update docs + uses: peter-evans/repository-dispatch@v2 + with: + token: ${{ secrets.DOCS_PAT }} + event-type: new_release + repository: RocketChat/docs + client-payload: '{"tag": "${{ github.ref_name }}"}' From 09a24e59ef2e4948dfae39aaee277cae1b778e2d Mon Sep 17 00:00:00 2001 From: Rodrigo Nascimento Date: Wed, 9 Aug 2023 12:08:58 -0300 Subject: [PATCH 004/275] fix: Performance issue on Engagement Dashboard aggregation (#30022) --- .changeset/heavy-cougars-marry.md | 5 +++ apps/meteor/server/models/raw/Messages.ts | 52 ++++++++++++++++------- 2 files changed, 41 insertions(+), 16 deletions(-) create mode 100644 .changeset/heavy-cougars-marry.md diff --git a/.changeset/heavy-cougars-marry.md b/.changeset/heavy-cougars-marry.md new file mode 100644 index 000000000000..893f53352114 --- /dev/null +++ b/.changeset/heavy-cougars-marry.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fix performance issue on Engagement Dashboard aggregation diff --git a/apps/meteor/server/models/raw/Messages.ts b/apps/meteor/server/models/raw/Messages.ts index b75088cdf0be..4bf94d5ca392 100644 --- a/apps/meteor/server/models/raw/Messages.ts +++ b/apps/meteor/server/models/raw/Messages.ts @@ -223,10 +223,32 @@ export class MessagesRaw extends BaseRaw implements IMessagesModel { getTotalOfMessagesSentByDate({ start, end, options = {} }: { start: Date; end: Date; options?: PaginatedRequest }): Promise { const params: Exclude['aggregate']>[0], undefined> = [ { $match: { t: { $exists: false }, ts: { $gte: start, $lte: end } } }, + { + $group: { + _id: { + rid: '$rid', + date: { + $dateToString: { format: '%Y%m%d', date: '$ts' }, + }, + }, + messages: { $sum: 1 }, + }, + }, + { + $group: { + _id: '$_id.rid', + data: { + $push: { + date: '$_id.date', + messages: '$messages', + }, + }, + }, + }, { $lookup: { from: 'rocketchat_room', - localField: 'rid', + localField: '_id', foreignField: '_id', as: 'room', }, @@ -237,8 +259,9 @@ export class MessagesRaw extends BaseRaw implements IMessagesModel { }, }, { - $group: { - _id: { + $project: { + data: '$data', + room: { _id: '$room._id', name: { $cond: [{ $ifNull: ['$room.fname', false] }, '$room.fname', '$room.name'], @@ -247,25 +270,22 @@ export class MessagesRaw extends BaseRaw implements IMessagesModel { usernames: { $cond: [{ $ifNull: ['$room.usernames', false] }, '$room.usernames', []], }, - date: { - $concat: [{ $substr: ['$ts', 0, 4] }, { $substr: ['$ts', 5, 2] }, { $substr: ['$ts', 8, 2] }], - }, }, - messages: { $sum: 1 }, + type: 'messages', + }, + }, + { + $unwind: { + path: '$data', }, }, { $project: { _id: 0, - date: '$_id.date', - room: { - _id: '$_id._id', - name: '$_id.name', - t: '$_id.t', - usernames: '$_id.usernames', - }, - type: 'messages', - messages: 1, + date: '$data.date', + room: 1, + type: 1, + messages: '$data.messages', }, }, ]; From a874d5b305cdf1640eb9279df9eb55ce4790f3ed Mon Sep 17 00:00:00 2001 From: Yash Rajpal <58601732+yash-rajpal@users.noreply.github.com> Date: Tue, 1 Aug 2023 10:29:38 +0530 Subject: [PATCH 005/275] fix: locales are requested multiple times (#29973) Co-authored-by: Tasso Evangelista <2263066+tassoevan@users.noreply.github.com> --- .changeset/blue-ladybugs-raise.md | 5 +++++ .../client/providers/TranslationProvider.tsx | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .changeset/blue-ladybugs-raise.md diff --git a/.changeset/blue-ladybugs-raise.md b/.changeset/blue-ladybugs-raise.md new file mode 100644 index 000000000000..44d7a06b4111 --- /dev/null +++ b/.changeset/blue-ladybugs-raise.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Translation files are requested multiple times diff --git a/apps/meteor/client/providers/TranslationProvider.tsx b/apps/meteor/client/providers/TranslationProvider.tsx index 122579c8e7bb..f09761be9a3b 100644 --- a/apps/meteor/client/providers/TranslationProvider.tsx +++ b/apps/meteor/client/providers/TranslationProvider.tsx @@ -36,6 +36,8 @@ const parseToJSON = (customTranslations: string): Record>(); + const useI18next = (lng: string): typeof i18next => { const basePath = useAbsoluteUrl()('/i18n'); @@ -101,6 +103,22 @@ const useI18next = (lng: string): typeof i18next => { loadPath: `${basePath}/{{lng}}.json`, parse: (data: string, lngs?: string | string[], namespaces: string | string[] = []) => extractKeys(JSON.parse(data), lngs, namespaces), + request: (_options, url, _payload, callback) => { + const params = url.split('/'); + const lng = params[params.length - 1]; + + let promise = localeCache.get(lng); + + if (!promise) { + promise = fetch(url).then((res) => res.text()); + localeCache.set(lng, promise); + } + + promise.then( + (res) => callback(null, { data: res, status: 200 }), + () => callback(null, { data: '', status: 500 }), + ); + }, }, react: { useSuspense: true, From cf9f16b17ce1e62344edbcb86ee1c32caf39d3a8 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Thu, 10 Aug 2023 07:37:26 -0600 Subject: [PATCH 006/275] fix: Performance issue on Messages.countByType aggregation (#30062) --- .changeset/brown-clouds-add.md | 5 +++++ apps/meteor/ee/app/license/server/getStatistics.ts | 2 +- apps/meteor/server/models/raw/Messages.ts | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/brown-clouds-add.md diff --git a/.changeset/brown-clouds-add.md b/.changeset/brown-clouds-add.md new file mode 100644 index 000000000000..6b69289177b5 --- /dev/null +++ b/.changeset/brown-clouds-add.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fix: Performance issue on `Messages.countByType` aggregation caused by unindexed property on messages collection diff --git a/apps/meteor/ee/app/license/server/getStatistics.ts b/apps/meteor/ee/app/license/server/getStatistics.ts index 9fe9f42c42bd..bd35e710f3b2 100644 --- a/apps/meteor/ee/app/license/server/getStatistics.ts +++ b/apps/meteor/ee/app/license/server/getStatistics.ts @@ -101,7 +101,7 @@ async function getEEStatistics(): Promise { statsPms.push( // Total livechat monitors - Users.col.countDocuments({ type: 'livechat-monitor' }).then((count) => { + Users.col.countDocuments({ roles: 'livechat-monitor' }).then((count) => { statistics.livechatMonitors = count; return true; }), diff --git a/apps/meteor/server/models/raw/Messages.ts b/apps/meteor/server/models/raw/Messages.ts index 4bf94d5ca392..f7c248eede1b 100644 --- a/apps/meteor/server/models/raw/Messages.ts +++ b/apps/meteor/server/models/raw/Messages.ts @@ -77,6 +77,7 @@ export class MessagesRaw extends BaseRaw implements IMessagesModel { { key: { 'navigation.token': 1 }, sparse: true }, { key: { 'federation.eventId': 1 }, sparse: true }, + { key: { t: 1 }, sparse: true }, ]; } From 34f08e7c9545afc1e7198aae7d7aaa043836cf91 Mon Sep 17 00:00:00 2001 From: Debdut Chakraborty Date: Thu, 10 Aug 2023 23:41:53 +0530 Subject: [PATCH 007/275] fix: recurring ENOENT errors when processing export requests (#30063) * fix: unable to create user if user manual approval is enabled * don't create directories when scheduling, create them when actually running * come on * oops * sorry * add changeset * oh you linter --- .changeset/swift-walls-protect.md | 5 +++++ apps/meteor/server/lib/dataExport/processDataDownloads.ts | 6 ++++++ apps/meteor/server/methods/requestDataDownload.ts | 5 +---- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 .changeset/swift-walls-protect.md diff --git a/.changeset/swift-walls-protect.md b/.changeset/swift-walls-protect.md new file mode 100644 index 000000000000..6e3057775c32 --- /dev/null +++ b/.changeset/swift-walls-protect.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed failing user data exports diff --git a/apps/meteor/server/lib/dataExport/processDataDownloads.ts b/apps/meteor/server/lib/dataExport/processDataDownloads.ts index 8b7ca08c6528..66c8cc77b359 100644 --- a/apps/meteor/server/lib/dataExport/processDataDownloads.ts +++ b/apps/meteor/server/lib/dataExport/processDataDownloads.ts @@ -49,6 +49,8 @@ const generateUserFile = async (exportOperation: IExportOperation, userData?: IU return; } + await mkdir(exportOperation.exportPath, { recursive: true }); + const { username, name, statusText, emails, roles, services } = userData; const dataToSave = { @@ -101,6 +103,8 @@ const generateUserAvatarFile = async (exportOperation: IExportOperation, userDat return; } + await mkdir(exportOperation.exportPath, { recursive: true }); + const file = await Avatars.findOneByName(userData.username); if (!file) { return; @@ -117,6 +121,8 @@ const generateChannelsFile = async (type: 'json' | 'html', exportPath: string, e return; } + await mkdir(exportOperation.exportPath, { recursive: true }); + const fileName = joinPath(exportPath, 'channels.json'); await writeFile( fileName, diff --git a/apps/meteor/server/methods/requestDataDownload.ts b/apps/meteor/server/methods/requestDataDownload.ts index ed3f90672883..87a8ef361060 100644 --- a/apps/meteor/server/methods/requestDataDownload.ts +++ b/apps/meteor/server/methods/requestDataDownload.ts @@ -1,5 +1,5 @@ import path, { join } from 'path'; -import { mkdir, mkdtemp } from 'fs/promises'; +import { mkdtemp } from 'fs/promises'; import { tmpdir } from 'os'; import { Meteor } from 'meteor/meteor'; @@ -65,7 +65,6 @@ Meteor.methods({ } const tempFolder = settings.get('UserData_FileSystemPath')?.trim() || (await mkdtemp(join(tmpdir(), 'userData'))); - await mkdir(tempFolder, { recursive: true }); const exportOperation = { status: 'preparing', @@ -81,10 +80,8 @@ Meteor.methods({ exportOperation._id = id; const folderName = path.join(tempFolder, id); - await mkdir(folderName, { recursive: true }); const assetsFolder = path.join(folderName, 'assets'); - await mkdir(assetsFolder, { recursive: true }); exportOperation.exportPath = folderName; exportOperation.assetsPath = assetsFolder; From f29c3268ee8aad05bf515b4448cb5b621c1bc2e0 Mon Sep 17 00:00:00 2001 From: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com> Date: Thu, 10 Aug 2023 17:24:45 -0300 Subject: [PATCH 008/275] fix: OAuth login issues (#30041) --- .changeset/fast-yaks-collect.md | 5 +++ .changeset/quiet-phones-sell.md | 5 +++ .changeset/tiny-turkeys-burn.md | 5 +++ .../server/custom_oauth_server.js | 4 +-- .../meteor/client/providers/ModalProvider.tsx | 35 +++++++++++++++---- .../client/views/hooks/useImperativeModal.tsx | 24 ------------- 6 files changed, 46 insertions(+), 32 deletions(-) create mode 100644 .changeset/fast-yaks-collect.md create mode 100644 .changeset/quiet-phones-sell.md create mode 100644 .changeset/tiny-turkeys-burn.md delete mode 100644 apps/meteor/client/views/hooks/useImperativeModal.tsx diff --git a/.changeset/fast-yaks-collect.md b/.changeset/fast-yaks-collect.md new file mode 100644 index 000000000000..60dd92030163 --- /dev/null +++ b/.changeset/fast-yaks-collect.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +fixed an issue where 2fa was not working after an OAuth redirect diff --git a/.changeset/quiet-phones-sell.md b/.changeset/quiet-phones-sell.md new file mode 100644 index 000000000000..a6222cba16c9 --- /dev/null +++ b/.changeset/quiet-phones-sell.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +fixed an issue where oauth login was not working with some providers diff --git a/.changeset/tiny-turkeys-burn.md b/.changeset/tiny-turkeys-burn.md new file mode 100644 index 000000000000..a146bd6a0eae --- /dev/null +++ b/.changeset/tiny-turkeys-burn.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +fixed an issue on oauth login that caused missing emails to be detected as changed data diff --git a/apps/meteor/app/custom-oauth/server/custom_oauth_server.js b/apps/meteor/app/custom-oauth/server/custom_oauth_server.js index abfdafed6f53..4bb0b7000602 100644 --- a/apps/meteor/app/custom-oauth/server/custom_oauth_server.js +++ b/apps/meteor/app/custom-oauth/server/custom_oauth_server.js @@ -136,7 +136,7 @@ export class CustomOAuth { const request = await fetch(`${this.tokenPath}`, { method: 'POST', headers, - params, + body: params, }); if (!request.ok) { @@ -355,7 +355,7 @@ export class CustomOAuth { user.services[serviceName] && user.services[serviceName].id === serviceData.id && user.name === serviceData.name && - (this.keyField === 'email' || user.emails?.find(({ address }) => address === serviceData.email)) + (this.keyField === 'email' || !serviceData.email || user.emails?.find(({ address }) => address === serviceData.email)) ) { return; } diff --git a/apps/meteor/client/providers/ModalProvider.tsx b/apps/meteor/client/providers/ModalProvider.tsx index 64101804c233..39d36d172c00 100644 --- a/apps/meteor/client/providers/ModalProvider.tsx +++ b/apps/meteor/client/providers/ModalProvider.tsx @@ -1,15 +1,32 @@ import { ModalContext } from '@rocket.chat/ui-contexts'; -import type { ReactNode, ReactElement } from 'react'; -import React, { useState, useMemo, memo } from 'react'; +import type { ReactNode } from 'react'; +import React, { useState, useMemo, memo, Suspense, createElement, useEffect } from 'react'; -import { useImperativeModal } from '../views/hooks/useImperativeModal'; +import { imperativeModal } from '../lib/imperativeModal'; + +const mapCurrentModal = (descriptor: typeof imperativeModal.current): ReactNode => { + if (descriptor === null) { + return null; + } + + if ('component' in descriptor) { + return ( + }> + {createElement(descriptor.component, { + key: Math.random(), + ...descriptor.props, + })} + + ); + } +}; type ModalProviderProps = { children?: ReactNode; }; -const ModalProvider = ({ children }: ModalProviderProps): ReactElement => { - const [currentModal, setCurrentModal] = useState(null); +const ModalProvider = ({ children }: ModalProviderProps) => { + const [currentModal, setCurrentModal] = useState(() => mapCurrentModal(imperativeModal.current)); const contextValue = useMemo( () => ({ @@ -21,7 +38,13 @@ const ModalProvider = ({ children }: ModalProviderProps): ReactElement => { [currentModal], ); - useImperativeModal(setCurrentModal); + useEffect( + () => + imperativeModal.on('update', (descriptor) => { + setCurrentModal(mapCurrentModal(descriptor)); + }), + [], + ); return ; }; diff --git a/apps/meteor/client/views/hooks/useImperativeModal.tsx b/apps/meteor/client/views/hooks/useImperativeModal.tsx deleted file mode 100644 index b2bcf233d45b..000000000000 --- a/apps/meteor/client/views/hooks/useImperativeModal.tsx +++ /dev/null @@ -1,24 +0,0 @@ -import type { Dispatch, SetStateAction, ReactNode } from 'react'; -import React, { Suspense, createElement, useEffect } from 'react'; - -import { imperativeModal } from '../../lib/imperativeModal'; - -export const useImperativeModal = (setModal: Dispatch>): void => { - useEffect(() => { - return imperativeModal.on('update', (descriptor) => { - if (descriptor === null) { - return setModal(null); - } - if ('component' in descriptor) { - setModal( - }> - {createElement(descriptor.component, { - key: Math.random(), - ...descriptor.props, - })} - , - ); - } - }); - }, [setModal]); -}; From ce2f2eaad33d9bedecdc51be92a003204ac30fdf Mon Sep 17 00:00:00 2001 From: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com> Date: Thu, 10 Aug 2023 17:27:58 -0300 Subject: [PATCH 009/275] feat: ability to freeze or completely disable integration scripts through envvars (#30053) Co-authored-by: Diego Sampaio --- .changeset/curly-shoes-burn.md | 5 ++ .../meteor/app/integrations/server/api/api.js | 13 ++- .../integrations/server/lib/triggerHandler.js | 17 +++- .../server/lib/validateOutgoingIntegration.ts | 4 +- .../incoming/addIncomingIntegration.ts | 6 ++ .../incoming/updateIncomingIntegration.ts | 84 +++++++++++-------- .../outgoing/addOutgoingIntegration.ts | 6 ++ .../outgoing/updateOutgoingIntegration.ts | 36 ++++---- .../rocketchat-i18n/i18n/en.i18n.json | 1 + 9 files changed, 115 insertions(+), 57 deletions(-) create mode 100644 .changeset/curly-shoes-burn.md diff --git a/.changeset/curly-shoes-burn.md b/.changeset/curly-shoes-burn.md new file mode 100644 index 000000000000..67d453ab7245 --- /dev/null +++ b/.changeset/curly-shoes-burn.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Added ability to freeze or completely disable integration scripts through envvars diff --git a/apps/meteor/app/integrations/server/api/api.js b/apps/meteor/app/integrations/server/api/api.js index e4912ad89d8c..3456a7aba4c4 100644 --- a/apps/meteor/app/integrations/server/api/api.js +++ b/apps/meteor/app/integrations/server/api/api.js @@ -16,6 +16,8 @@ import { deleteOutgoingIntegration } from '../methods/outgoing/deleteOutgoingInt import { deasyncPromise } from '../../../../server/deasync/deasync'; import { addOutgoingIntegration } from '../methods/outgoing/addOutgoingIntegration'; +const DISABLE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.DISABLE_INTEGRATION_SCRIPTS).toLowerCase()); + export const forbiddenModelMethods = ['registerModel', 'getCollectionName']; const compiledScripts = {}; @@ -64,6 +66,10 @@ function buildSandbox(store = {}) { } function getIntegrationScript(integration) { + if (DISABLE_INTEGRATION_SCRIPTS) { + throw API.v1.failure('integration-scripts-disabled'); + } + const compiledScript = compiledScripts[integration._id]; if (compiledScript && +compiledScript._updatedAt === +integration._updatedAt) { return compiledScript.script; @@ -172,7 +178,12 @@ async function executeIntegrationRest() { emoji: this.integration.emoji, }; - if (this.integration.scriptEnabled && this.integration.scriptCompiled && this.integration.scriptCompiled.trim() !== '') { + if ( + !DISABLE_INTEGRATION_SCRIPTS && + this.integration.scriptEnabled && + this.integration.scriptCompiled && + this.integration.scriptCompiled.trim() !== '' + ) { let script; try { script = getIntegrationScript(this.integration); diff --git a/apps/meteor/app/integrations/server/lib/triggerHandler.js b/apps/meteor/app/integrations/server/lib/triggerHandler.js index 5fe002e21270..9988bfd06da5 100644 --- a/apps/meteor/app/integrations/server/lib/triggerHandler.js +++ b/apps/meteor/app/integrations/server/lib/triggerHandler.js @@ -18,6 +18,8 @@ import { forbiddenModelMethods } from '../api/api'; import { httpCall } from '../../../../server/lib/http/call'; import { deasyncPromise } from '../../../../server/deasync/deasync'; +const DISABLE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.DISABLE_INTEGRATION_SCRIPTS).toLowerCase()); + class RocketChatIntegrationHandler { constructor() { this.successResults = [200, 201, 202]; @@ -270,6 +272,10 @@ class RocketChatIntegrationHandler { } getIntegrationScript(integration) { + if (DISABLE_INTEGRATION_SCRIPTS) { + throw new Meteor.Error('integration-scripts-disabled'); + } + const compiledScript = this.compiledScripts[integration._id]; if (compiledScript && +compiledScript._updatedAt === +integration._updatedAt) { return compiledScript.script; @@ -313,7 +319,12 @@ class RocketChatIntegrationHandler { } hasScriptAndMethod(integration, method) { - if (integration.scriptEnabled !== true || !integration.scriptCompiled || integration.scriptCompiled.trim() === '') { + if ( + DISABLE_INTEGRATION_SCRIPTS || + integration.scriptEnabled !== true || + !integration.scriptCompiled || + integration.scriptCompiled.trim() === '' + ) { return false; } @@ -328,6 +339,10 @@ class RocketChatIntegrationHandler { } async executeScript(integration, method, params, historyId) { + if (DISABLE_INTEGRATION_SCRIPTS) { + return; + } + let script; try { script = this.getIntegrationScript(integration); diff --git a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts index 80725fb75aad..2068db0b57e1 100644 --- a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts @@ -12,6 +12,8 @@ import { parseCSV } from '../../../../lib/utils/parseCSV'; const scopedChannels = ['all_public_channels', 'all_private_groups', 'all_direct_messages']; const validChannelChars = ['@', '#']; +const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); + function _verifyRequiredFields(integration: INewOutgoingIntegration | IUpdateOutgoingIntegration): void { if ( !integration.event || @@ -169,7 +171,7 @@ export const validateOutgoingIntegration = async function ( delete integrationData.triggerWords; } - if (integration.scriptEnabled === true && integration.script && integration.script.trim() !== '') { + if (!FREEZE_INTEGRATION_SCRIPTS && integration.scriptEnabled === true && integration.script && integration.script.trim() !== '') { try { const babelOptions = Object.assign(Babel.getDefaultOptions({ runtime: false }), { compact: true, diff --git a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts index 09ad473267da..96e2fa280920 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts @@ -11,6 +11,8 @@ import { hasPermissionAsync, hasAllPermissionAsync } from '../../../../authoriza const validChannelChars = ['@', '#']; +const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); + declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { @@ -74,6 +76,10 @@ export const addIncomingIntegration = async (userId: string, integration: INewIn }); } + if (FREEZE_INTEGRATION_SCRIPTS && integration.script?.trim()) { + throw new Meteor.Error('integration-scripts-disabled'); + } + const user = await Users.findOne({ username: integration.username }); if (!user) { diff --git a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts index 4e0fa6bf423d..cf5ba5de9123 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts @@ -9,6 +9,8 @@ import { hasAllPermissionAsync, hasPermissionAsync } from '../../../../authoriza const validChannelChars = ['@', '#']; +const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); + declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { @@ -64,42 +66,48 @@ Meteor.methods({ }); } - let scriptCompiled: string | undefined; - let scriptError: Pick | undefined; - - if (integration.scriptEnabled === true && integration.script && integration.script.trim() !== '') { - try { - let babelOptions = Babel.getDefaultOptions({ runtime: false }); - babelOptions = _.extend(babelOptions, { compact: true, minified: true, comments: false }); - - scriptCompiled = Babel.compile(integration.script, babelOptions).code; - scriptError = undefined; - await Integrations.updateOne( - { _id: integrationId }, - { - $set: { - scriptCompiled, - }, - $unset: { scriptError: 1 as const }, - }, - ); - } catch (e) { - scriptCompiled = undefined; - if (e instanceof Error) { - const { name, message, stack } = e; - scriptError = { name, message, stack }; - } - await Integrations.updateOne( - { _id: integrationId }, - { - $set: { - scriptError, + if (FREEZE_INTEGRATION_SCRIPTS) { + if (currentIntegration.script?.trim() !== integration.script?.trim()) { + throw new Meteor.Error('integration-scripts-disabled'); + } + } else { + let scriptCompiled: string | undefined; + let scriptError: Pick | undefined; + + if (integration.scriptEnabled === true && integration.script && integration.script.trim() !== '') { + try { + let babelOptions = Babel.getDefaultOptions({ runtime: false }); + babelOptions = _.extend(babelOptions, { compact: true, minified: true, comments: false }); + + scriptCompiled = Babel.compile(integration.script, babelOptions).code; + scriptError = undefined; + await Integrations.updateOne( + { _id: integrationId }, + { + $set: { + scriptCompiled, + }, + $unset: { scriptError: 1 as const }, }, - $unset: { - scriptCompiled: 1 as const, + ); + } catch (e) { + scriptCompiled = undefined; + if (e instanceof Error) { + const { name, message, stack } = e; + scriptError = { name, message, stack }; + } + await Integrations.updateOne( + { _id: integrationId }, + { + $set: { + scriptError, + }, + $unset: { + scriptCompiled: 1 as const, + }, }, - }, - ); + ); + } } } @@ -157,8 +165,12 @@ Meteor.methods({ emoji: integration.emoji, alias: integration.alias, channel: channels, - script: integration.script, - scriptEnabled: integration.scriptEnabled, + ...(FREEZE_INTEGRATION_SCRIPTS + ? {} + : { + script: integration.script, + scriptEnabled: integration.scriptEnabled, + }), overrideDestinationChannelEnabled: integration.overrideDestinationChannelEnabled, _updatedAt: new Date(), _updatedBy: await Users.findOne({ _id: this.userId }, { projection: { username: 1 } }), diff --git a/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts b/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts index 146928f643b4..aac9b3644dcf 100644 --- a/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts @@ -14,6 +14,8 @@ declare module '@rocket.chat/ui-contexts' { } } +const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); + export const addOutgoingIntegration = async (userId: string, integration: INewOutgoingIntegration): Promise => { check( integration, @@ -50,6 +52,10 @@ export const addOutgoingIntegration = async (userId: string, integration: INewOu throw new Meteor.Error('not_authorized'); } + if (FREEZE_INTEGRATION_SCRIPTS && integration.script?.trim()) { + throw new Meteor.Error('integration-scripts-disabled'); + } + const integrationData = await validateOutgoingIntegration(integration, userId); const result = await Integrations.insertOne(integrationData); diff --git a/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts index a297fd980897..847976083316 100644 --- a/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts @@ -16,6 +16,8 @@ declare module '@rocket.chat/ui-contexts' { } } +const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); + Meteor.methods({ async updateOutgoingIntegration(integrationId, _integration) { if (!this.userId) { @@ -51,22 +53,8 @@ Meteor.methods({ throw new Meteor.Error('invalid_integration', '[methods] updateOutgoingIntegration -> integration not found'); } - if (integration.scriptCompiled) { - await Integrations.updateOne( - { _id: integrationId }, - { - $set: { scriptCompiled: integration.scriptCompiled }, - $unset: { scriptError: 1 as const }, - }, - ); - } else { - await Integrations.updateOne( - { _id: integrationId }, - { - $set: { scriptError: integration.scriptError }, - $unset: { scriptCompiled: 1 as const }, - }, - ); + if (FREEZE_INTEGRATION_SCRIPTS && integration.script?.trim() !== currentIntegration.script?.trim()) { + throw new Meteor.Error('integration-scripts-disabled'); } await Integrations.updateOne( @@ -86,8 +74,13 @@ Meteor.methods({ userId: integration.userId, urls: integration.urls, token: integration.token, - script: integration.script, - scriptEnabled: integration.scriptEnabled, + ...(FREEZE_INTEGRATION_SCRIPTS + ? {} + : { + script: integration.script, + scriptEnabled: integration.scriptEnabled, + ...(integration.scriptCompiled ? { scriptCompiled: integration.scriptCompiled } : { scriptError: integration.scriptError }), + }), triggerWords: integration.triggerWords, retryFailedCalls: integration.retryFailedCalls, retryCount: integration.retryCount, @@ -97,6 +90,13 @@ Meteor.methods({ _updatedAt: new Date(), _updatedBy: await Users.findOne({ _id: this.userId }, { projection: { username: 1 } }), }, + ...(FREEZE_INTEGRATION_SCRIPTS + ? {} + : { + $unset: { + ...(integration.scriptCompiled ? { scriptError: 1 as const } : { scriptCompiled: 1 as const }), + }, + }), }, ); diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 9c5adec4e993..1239bf6d8038 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -2631,6 +2631,7 @@ "Integration_History_Cleared": "Integration History Successfully Cleared", "Integration_Incoming_WebHook": "Incoming WebHook Integration", "Integration_New": "New Integration", + "integration-scripts-disabled": "Integration Scripts are Disabled", "Integration_Outgoing_WebHook": "Outgoing WebHook Integration", "Integration_Outgoing_WebHook_History": "Outgoing WebHook Integration History", "Integration_Outgoing_WebHook_History_Data_Passed_To_Trigger": "Data Passed to Integration", From 79a0268039efae3ce41f03a9da75754e227fdece Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Fri, 11 Aug 2023 03:46:00 +0000 Subject: [PATCH 010/275] Release 6.3.1 [no ci] --- .changeset/blue-ladybugs-raise.md | 5 --- .changeset/brown-clouds-add.md | 5 --- .changeset/bump-patch-1691528359038.md | 5 --- .changeset/curly-shoes-burn.md | 5 --- .changeset/fast-yaks-collect.md | 5 --- .changeset/heavy-cougars-marry.md | 5 --- .changeset/quiet-phones-sell.md | 5 --- .changeset/swift-birds-build.md | 5 --- .changeset/swift-walls-protect.md | 5 --- .changeset/tiny-turkeys-burn.md | 5 --- apps/meteor/.docker/Dockerfile.rhel | 2 +- apps/meteor/CHANGELOG.md | 34 +++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 10 ++++++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 10 ++++++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 10 ++++++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 12 +++++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 11 ++++++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 10 ++++++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 10 ++++++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 9 +++++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 7 ++++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 7 ++++ ee/packages/ddp-client/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 11 ++++++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 6 ++++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 8 +++++ ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 8 +++++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 2 ++ packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 7 ++++ packages/cron/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 8 +++++ packages/fuselage-ui-kit/package.json | 6 ++-- packages/gazzodown/CHANGELOG.md | 8 +++++ packages/gazzodown/package.json | 8 ++--- packages/instance-status/CHANGELOG.md | 6 ++++ packages/instance-status/package.json | 2 +- packages/model-typings/CHANGELOG.md | 6 ++++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 6 ++++ packages/models/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 6 ++++ packages/rest-typings/package.json | 2 +- packages/ui-client/CHANGELOG.md | 6 ++++ packages/ui-client/package.json | 4 +-- packages/ui-contexts/CHANGELOG.md | 8 +++++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 6 ++++ packages/ui-video-conf/package.json | 4 +-- packages/uikit-playground/CHANGELOG.md | 7 ++++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 6 ++++ packages/web-ui-registration/package.json | 4 +-- 69 files changed, 284 insertions(+), 89 deletions(-) delete mode 100644 .changeset/blue-ladybugs-raise.md delete mode 100644 .changeset/brown-clouds-add.md delete mode 100644 .changeset/bump-patch-1691528359038.md delete mode 100644 .changeset/curly-shoes-burn.md delete mode 100644 .changeset/fast-yaks-collect.md delete mode 100644 .changeset/heavy-cougars-marry.md delete mode 100644 .changeset/quiet-phones-sell.md delete mode 100644 .changeset/swift-birds-build.md delete mode 100644 .changeset/swift-walls-protect.md delete mode 100644 .changeset/tiny-turkeys-burn.md diff --git a/.changeset/blue-ladybugs-raise.md b/.changeset/blue-ladybugs-raise.md deleted file mode 100644 index 44d7a06b4111..000000000000 --- a/.changeset/blue-ladybugs-raise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Translation files are requested multiple times diff --git a/.changeset/brown-clouds-add.md b/.changeset/brown-clouds-add.md deleted file mode 100644 index 6b69289177b5..000000000000 --- a/.changeset/brown-clouds-add.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fix: Performance issue on `Messages.countByType` aggregation caused by unindexed property on messages collection diff --git a/.changeset/bump-patch-1691528359038.md b/.changeset/bump-patch-1691528359038.md deleted file mode 100644 index e1eaa7980afb..000000000000 --- a/.changeset/bump-patch-1691528359038.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Bump @rocket.chat/meteor version. diff --git a/.changeset/curly-shoes-burn.md b/.changeset/curly-shoes-burn.md deleted file mode 100644 index 67d453ab7245..000000000000 --- a/.changeset/curly-shoes-burn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Added ability to freeze or completely disable integration scripts through envvars diff --git a/.changeset/fast-yaks-collect.md b/.changeset/fast-yaks-collect.md deleted file mode 100644 index 60dd92030163..000000000000 --- a/.changeset/fast-yaks-collect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -fixed an issue where 2fa was not working after an OAuth redirect diff --git a/.changeset/heavy-cougars-marry.md b/.changeset/heavy-cougars-marry.md deleted file mode 100644 index 893f53352114..000000000000 --- a/.changeset/heavy-cougars-marry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fix performance issue on Engagement Dashboard aggregation diff --git a/.changeset/quiet-phones-sell.md b/.changeset/quiet-phones-sell.md deleted file mode 100644 index a6222cba16c9..000000000000 --- a/.changeset/quiet-phones-sell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -fixed an issue where oauth login was not working with some providers diff --git a/.changeset/swift-birds-build.md b/.changeset/swift-birds-build.md deleted file mode 100644 index 4af3bddd875b..000000000000 --- a/.changeset/swift-birds-build.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fixed unable to create admin user using ADMIN\_\* environment variables diff --git a/.changeset/swift-walls-protect.md b/.changeset/swift-walls-protect.md deleted file mode 100644 index 6e3057775c32..000000000000 --- a/.changeset/swift-walls-protect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fixed failing user data exports diff --git a/.changeset/tiny-turkeys-burn.md b/.changeset/tiny-turkeys-burn.md deleted file mode 100644 index a146bd6a0eae..000000000000 --- a/.changeset/tiny-turkeys-burn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -fixed an issue on oauth login that caused missing emails to be detected as changed data diff --git a/apps/meteor/.docker/Dockerfile.rhel b/apps/meteor/.docker/Dockerfile.rhel index a5bf7cef006c..a0101a487691 100644 --- a/apps/meteor/.docker/Dockerfile.rhel +++ b/apps/meteor/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 6.3.0 +ENV RC_VERSION 6.3.1 MAINTAINER buildmaster@rocket.chat diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index f8a1a24f8430..d4f0053e018e 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,39 @@ # @rocket.chat/meteor +## 6.3.1 + +### Patch Changes + +- a874d5b305: Translation files are requested multiple times +- cf9f16b17c: fix: Performance issue on `Messages.countByType` aggregation caused by unindexed property on messages collection +- be2b5c66cf: Bump @rocket.chat/meteor version. +- Bump @rocket.chat/meteor version. +- ce2f2eaad3: Added ability to freeze or completely disable integration scripts through envvars +- f29c3268ee: fixed an issue where 2fa was not working after an OAuth redirect +- 09a24e59ef: Fix performance issue on Engagement Dashboard aggregation +- f29c3268ee: fixed an issue where oauth login was not working with some providers +- 25d5e3cd9e: Fixed unable to create admin user using ADMIN\_\* environment variables +- 34f08e7c95: Fixed failing user data exports +- f29c3268ee: fixed an issue on oauth login that caused missing emails to be detected as changed data + - @rocket.chat/core-typings@6.3.1 + - @rocket.chat/rest-typings@6.3.1 + - @rocket.chat/api-client@0.1.1 + - @rocket.chat/omnichannel-services@0.0.7 + - @rocket.chat/pdf-worker@0.0.7 + - @rocket.chat/presence@0.0.7 + - @rocket.chat/core-services@0.1.1 + - @rocket.chat/cron@0.0.3 + - @rocket.chat/gazzodown@1.0.1 + - @rocket.chat/model-typings@0.0.7 + - @rocket.chat/ui-contexts@1.0.1 + - @rocket.chat/fuselage-ui-kit@1.0.1 + - @rocket.chat/models@0.0.7 + - @rocket.chat/ui-theming@0.0.1 + - @rocket.chat/ui-client@1.0.1 + - @rocket.chat/ui-video-conf@1.0.1 + - @rocket.chat/web-ui-registration@1.0.1 + - @rocket.chat/instance-status@0.0.7 + ## 6.3.0 ### Minor Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index d80bb027f586..98f9656eb840 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.3.0" + "version": "6.3.1" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index 6b7427c8986c..d0577552b841 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,15 @@ # rocketchat-services +## 1.1.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/rest-typings@6.3.1 +- @rocket.chat/core-services@0.1.1 +- @rocket.chat/model-typings@0.0.7 +- @rocket.chat/models@0.0.7 + ## 1.1.0 ### Minor Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index abe11bd71080..6dc1a056f08f 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.0", + "version": "1.1.1", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index bf73180362b6..21c4c3e61bf3 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.3.0", + "version": "6.3.1", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index 2a8ff56e7db4..7192d840d72e 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/account-service +## 0.2.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/rest-typings@6.3.1 +- @rocket.chat/core-services@0.1.1 +- @rocket.chat/model-typings@0.0.7 +- @rocket.chat/models@0.0.7 + ## 0.2.0 ### Minor Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index 2a267edaad67..767c9988eb8d 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.2.0", + "version": "0.2.1", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index 9dc10a5525d5..7adbd9dbe297 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/authorization-service +## 0.2.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/rest-typings@6.3.1 +- @rocket.chat/core-services@0.1.1 +- @rocket.chat/model-typings@0.0.7 +- @rocket.chat/models@0.0.7 + ## 0.2.0 ### Minor Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index 06e702830856..c888bd8b5688 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.2.0", + "version": "0.2.1", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index f1ad5b4d31d3..c2aa573d6229 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/ddp-streamer +## 0.1.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/rest-typings@6.3.1 +- @rocket.chat/core-services@0.1.1 +- @rocket.chat/model-typings@0.0.7 +- @rocket.chat/ui-contexts@1.0.1 +- @rocket.chat/models@0.0.7 +- @rocket.chat/instance-status@0.0.7 + ## 0.1.0 ### Minor Changes diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 97b97a48066c..5d518361cb94 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.1.0", + "version": "0.1.1", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index 2befcae93140..c8c15dd1e2af 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-transcript +## 0.2.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/omnichannel-services@0.0.7 +- @rocket.chat/pdf-worker@0.0.7 +- @rocket.chat/core-services@0.1.1 +- @rocket.chat/model-typings@0.0.7 +- @rocket.chat/models@0.0.7 + ## 0.2.0 ### Minor Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index f755a96c3ad5..5af9b60b330e 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.2.0", + "version": "0.2.1", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index 68c5b2ce191a..7b38402a95ac 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/presence-service +## 0.2.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/presence@0.0.7 +- @rocket.chat/core-services@0.1.1 +- @rocket.chat/model-typings@0.0.7 +- @rocket.chat/models@0.0.7 + ## 0.2.0 ### Minor Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index f23a8dc8eafc..a9b6abc9ec54 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.2.0", + "version": "0.2.1", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index 76b94996bc7b..2b1d18ebed82 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/queue-worker +## 0.2.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/omnichannel-services@0.0.7 +- @rocket.chat/core-services@0.1.1 +- @rocket.chat/model-typings@0.0.7 +- @rocket.chat/models@0.0.7 + ## 0.2.0 ### Minor Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index 36f0a554e764..76abf92a27fb 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.2.0", + "version": "0.2.1", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index 881e5bd2931e..54f74cd268c1 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/stream-hub-service +## 0.2.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/core-services@0.1.1 +- @rocket.chat/model-typings@0.0.7 +- @rocket.chat/models@0.0.7 + ## 0.2.0 ### Minor Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index af1b9f5d8212..221f0dc459e1 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.2.0", + "version": "0.2.1", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index 01c9eb39f40b..7839e3f0fadf 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/api-client +## 0.1.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/rest-typings@6.3.1 + ## 0.1.0 ### Minor Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index 3c2da541bbad..2bd9cbdf76cf 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/api-client", - "version": "0.1.0", + "version": "0.1.1", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index 0d0b9e0d64e7..f12a936b1b94 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/ddp-client +## 0.1.1 + +### Patch Changes + +- @rocket.chat/rest-typings@6.3.1 +- @rocket.chat/api-client@0.1.1 + ## 0.1.0 ### Minor Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index 9b260afc5326..ae88cf03a009 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ddp-client", - "version": "0.1.0", + "version": "0.1.1", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index a1f8e0e911d4..d4ce4d464b6e 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-services +## 0.0.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/rest-typings@6.3.1 +- @rocket.chat/pdf-worker@0.0.7 +- @rocket.chat/core-services@0.1.1 +- @rocket.chat/model-typings@0.0.7 +- @rocket.chat/models@0.0.7 + ## 0.0.6 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 8b30b519c8de..dc9be2a6bd17 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.0.6", + "version": "0.0.7", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index f96716492b01..132a9d21b4b6 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/pdf-worker +## 0.0.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 + ## 0.0.6 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index 557309acabf4..75b953559bdc 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.6", + "version": "0.0.7", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index 1bc0e993d864..fc190b316e54 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/presence +## 0.0.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/core-services@0.1.1 +- @rocket.chat/models@0.0.7 + ## 0.0.6 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index a14617232616..19923abf1d1a 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.0.6", + "version": "0.0.7", "private": true, "devDependencies": { "@babel/core": "~7.22.5", diff --git a/package.json b/package.json index c0cdc332c9b1..407b5925d8b9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.3.0", + "version": "6.3.1", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index f08f2aed944f..4a60b8fd0e2e 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/core-services +## 0.1.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/rest-typings@6.3.1 +- @rocket.chat/models@0.0.7 + ## 0.1.0 ### Minor Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index ea0030eb98cb..73ec9d18808f 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.1.0", + "version": "0.1.1", "private": true, "devDependencies": { "@babel/core": "^7.21.4", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index aa2f9b626d0f..dcadf8f17a9e 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,7 @@ # @rocket.chat/core-typings +## 6.3.1 + ## 6.3.0 ### Minor Changes diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index ccdf9d395640..d8cc367126bc 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-typings", - "version": "6.3.0", + "version": "6.3.1", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.43.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index 86b37bd21307..c825929ef817 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/cron +## 0.0.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/models@0.0.7 + ## 0.0.2 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index 2c16fa0fa973..9c42f6c091cd 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.2", + "version": "0.0.3", "private": true, "devDependencies": { "@types/jest": "^27.4.1", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index 2f0fb7e79cec..27a43bf608f1 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 1.0.1 + +### Patch Changes + +- @rocket.chat/gazzodown@1.0.1 +- @rocket.chat/ui-contexts@1.0.1 +- @rocket.chat/ui-video-conf@1.0.1 + ## 1.0.0 ### Minor Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 172fce3231c4..391426fe75f4 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "1.0.0", + "version": "1.0.1", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -47,9 +47,9 @@ "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "1.0.0", + "@rocket.chat/ui-contexts": "1.0.1", "@rocket.chat/ui-kit": "*", - "@rocket.chat/ui-video-conf": "1.0.0", + "@rocket.chat/ui-video-conf": "1.0.1", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index 34b335055cbc..5ab58c8b3106 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/gazzodown +## 1.0.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/ui-contexts@1.0.1 +- @rocket.chat/ui-client@1.0.1 + ## 1.0.0 ### Minor Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index ca3f58f52086..be2029ae7b82 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "1.0.0", + "version": "1.0.1", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.3.0", + "@rocket.chat/core-typings": "6.3.1", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "1.0.0", - "@rocket.chat/ui-contexts": "1.0.0", + "@rocket.chat/ui-client": "1.0.1", + "@rocket.chat/ui-contexts": "1.0.1", "katex": "*", "react": "*" }, diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index 5c714b507bf6..48ec1c60b4b0 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/instance-status +## 0.0.7 + +### Patch Changes + +- @rocket.chat/models@0.0.7 + ## 0.0.6 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 161f07d8d9e1..df5366c996d2 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.6", + "version": "0.0.7", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index 2496c0f71f86..21b5662c66b7 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/model-typings +## 0.0.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 + ## 0.0.6 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index 6e5faf3a3076..b8ab854b0a15 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.0.6", + "version": "0.0.7", "private": true, "devDependencies": { "@types/jest": "~29.5.2", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index e2004b93d8ca..7c2d5b329133 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/models +## 0.0.7 + +### Patch Changes + +- @rocket.chat/model-typings@0.0.7 + ## 0.0.6 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index 290cdd9b343b..2e56a6398837 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.6", + "version": "0.0.7", "private": true, "devDependencies": { "@types/jest": "~29.5.2", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index 287aaa0a6c0a..e9af2d31e3b9 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/rest-typings +## 6.3.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 + ## 6.3.0 ### Minor Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 581abfd9d8c1..9ef354f565c3 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/rest-typings", - "version": "6.3.0", + "version": "6.3.1", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.2", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index 1ca4c44cae6f..7931ecd4a598 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-client +## 1.0.1 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.1 + ## 1.0.0 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 41650e9eba12..7c23ee0d9115 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "1.0.0", + "version": "1.0.1", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -53,7 +53,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "1.0.0", + "@rocket.chat/ui-contexts": "1.0.1", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index 3935f15ad38f..799b2464be0a 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/ui-contexts +## 1.0.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.1 +- @rocket.chat/rest-typings@6.3.1 +- @rocket.chat/ddp-client@0.1.1 + ## 1.0.0 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 5e7d8a06e80e..0960c4e097b9 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "1.0.0", + "version": "1.0.1", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index ca4f42f5fdb2..c4c4f794846d 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-video-conf +## 1.0.1 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.1 + ## 1.0.0 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index 1f99f72f91e2..b7ff24003c97 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "1.0.0", + "version": "1.0.1", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "1.0.0", + "@rocket.chat/ui-contexts": "1.0.1", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index 4c1fe11bb95a..27cdbec1a0cd 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/uikit-playground +## 0.1.1 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.1 +- @rocket.chat/fuselage-ui-kit@1.0.1 + ## 0.1.0 ### Minor Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index 561f6d05a32e..9a6543ad5bf0 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.1.0", + "version": "0.1.1", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index 626efd8a18a2..9d75b6e88d88 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/web-ui-registration +## 1.0.1 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.1 + ## 1.0.0 ### Minor Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index fc04290637c1..45e634c65754 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "1.0.0", + "version": "1.0.1", "private": true, "devDependencies": { "@rocket.chat/layout": "next", @@ -17,7 +17,7 @@ }, "peerDependencies": { "@rocket.chat/layout": "*", - "@rocket.chat/ui-contexts": "1.0.0", + "@rocket.chat/ui-contexts": "1.0.1", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", From 778b155ab41a44aa9c95d987a46d7ff2b8f3f1c2 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Mon, 21 Aug 2023 17:04:05 +0000 Subject: [PATCH 011/275] Bump 6.3.2 --- .changeset/bump-patch-1692637445510.md | 5 +++++ yarn.lock | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/bump-patch-1692637445510.md diff --git a/.changeset/bump-patch-1692637445510.md b/.changeset/bump-patch-1692637445510.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1692637445510.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/yarn.lock b/yarn.lock index 81c60fc6670a..9b6a545ec9fe 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9898,9 +9898,9 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.0 + "@rocket.chat/ui-contexts": 1.0.1 "@rocket.chat/ui-kit": "*" - "@rocket.chat/ui-video-conf": 1.0.0 + "@rocket.chat/ui-video-conf": 1.0.1 "@tanstack/react-query": "*" react: "*" react-dom: "*" @@ -9982,14 +9982,14 @@ __metadata: ts-jest: ~29.0.5 typescript: ~5.1.3 peerDependencies: - "@rocket.chat/core-typings": 6.3.0 + "@rocket.chat/core-typings": 6.3.1 "@rocket.chat/css-in-js": "*" "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-tokens": "*" "@rocket.chat/message-parser": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-client": 1.0.0 - "@rocket.chat/ui-contexts": 1.0.0 + "@rocket.chat/ui-client": 1.0.1 + "@rocket.chat/ui-contexts": 1.0.1 katex: "*" react: "*" languageName: unknown @@ -11048,7 +11048,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 1.0.0 + "@rocket.chat/ui-contexts": 1.0.1 react: ~17.0.2 languageName: unknown linkType: soft @@ -11202,7 +11202,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.0 + "@rocket.chat/ui-contexts": 1.0.1 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -11268,7 +11268,7 @@ __metadata: typescript: ~5.1.3 peerDependencies: "@rocket.chat/layout": "*" - "@rocket.chat/ui-contexts": 1.0.0 + "@rocket.chat/ui-contexts": 1.0.1 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From 8a0e36f7b11b81a00df829f77e92a647e09ea8d3 Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Tue, 15 Aug 2023 11:53:10 -0300 Subject: [PATCH 012/275] fix(meteor): Close video recorder if permission denied (#30054) --- .changeset/witty-feet-warn.md | 5 +++++ .../VideoMessageRecorder/VideoMessageRecorder.tsx | 9 +++++---- 2 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/witty-feet-warn.md diff --git a/.changeset/witty-feet-warn.md b/.changeset/witty-feet-warn.md new file mode 100644 index 000000000000..faaa5d44c134 --- /dev/null +++ b/.changeset/witty-feet-warn.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fixed the video recorder window not closing after permission is denied. diff --git a/apps/meteor/client/views/composer/VideoMessageRecorder/VideoMessageRecorder.tsx b/apps/meteor/client/views/composer/VideoMessageRecorder/VideoMessageRecorder.tsx index 5d43a07d8b0b..41cdc8c3c174 100644 --- a/apps/meteor/client/views/composer/VideoMessageRecorder/VideoMessageRecorder.tsx +++ b/apps/meteor/client/views/composer/VideoMessageRecorder/VideoMessageRecorder.tsx @@ -1,6 +1,7 @@ import type { IMessage, IRoom } from '@rocket.chat/core-typings'; import { css } from '@rocket.chat/css-in-js'; import { Box, ButtonGroup, Button, Icon, PositionAnimated } from '@rocket.chat/fuselage'; +import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useTranslation, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; import type { AllHTMLAttributes, RefObject } from 'react'; import React, { useRef, useEffect, useState } from 'react'; @@ -94,24 +95,24 @@ const VideoMessageRecorder = ({ rid, tmid, chatContext, reference }: VideoMessag stopVideoRecording(rid, tmid); }; - const handleCancel = () => { + const handleCancel = useMutableCallback(() => { VideoRecorder.stop(); chat?.composer?.setRecordingVideo(false); setTime(undefined); stopVideoRecording(rid, tmid); - }; + }); useEffect(() => { if (!VideoRecorder.getSupportedMimeTypes()) { return dispatchToastMessage({ type: 'error', message: t('Browser_does_not_support_recording_video') }); } - VideoRecorder.start(videoRef.current ?? undefined); + VideoRecorder.start(videoRef.current ?? undefined, (success) => (!success ? handleCancel() : undefined)); return () => { VideoRecorder.stop(); }; - }, [dispatchToastMessage, t]); + }, [dispatchToastMessage, handleCancel, t]); return ( From 5660169ec8c4d07372eff0a05394e2eaf7799829 Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Fri, 18 Aug 2023 11:42:12 -0300 Subject: [PATCH 013/275] fix: Keep embedded layout as true once set (#30087) Co-authored-by: Tasso Evangelista <2263066+tassoevan@users.noreply.github.com> --- .changeset/nine-carrots-listen.md | 5 +++++ apps/meteor/client/hooks/useEmbeddedLayout.ts | 4 ++-- apps/meteor/client/lib/utils/isLayoutEmbedded.ts | 8 +++++++- apps/meteor/client/providers/LayoutProvider.tsx | 10 +++++----- apps/meteor/client/startup/e2e.ts | 8 +++++++- apps/meteor/client/views/meet/CallPage.tsx | 14 +++++++------- apps/meteor/client/views/meet/MeetPage.tsx | 5 +++-- 7 files changed, 36 insertions(+), 18 deletions(-) create mode 100644 .changeset/nine-carrots-listen.md diff --git a/.changeset/nine-carrots-listen.md b/.changeset/nine-carrots-listen.md new file mode 100644 index 000000000000..bf5dc72e6cc0 --- /dev/null +++ b/.changeset/nine-carrots-listen.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fixed layout changing from embedded view when navigating diff --git a/apps/meteor/client/hooks/useEmbeddedLayout.ts b/apps/meteor/client/hooks/useEmbeddedLayout.ts index 1f411377b3e0..61385ef4c12d 100644 --- a/apps/meteor/client/hooks/useEmbeddedLayout.ts +++ b/apps/meteor/client/hooks/useEmbeddedLayout.ts @@ -1,3 +1,3 @@ -import { useSearchParameter } from '@rocket.chat/ui-contexts'; +import { useLayout } from '@rocket.chat/ui-contexts'; -export const useEmbeddedLayout = (): boolean => useSearchParameter('layout') === 'embedded'; +export const useEmbeddedLayout = (): boolean => useLayout().isEmbedded; diff --git a/apps/meteor/client/lib/utils/isLayoutEmbedded.ts b/apps/meteor/client/lib/utils/isLayoutEmbedded.ts index 540ccf129603..330c5ca7f4f3 100644 --- a/apps/meteor/client/lib/utils/isLayoutEmbedded.ts +++ b/apps/meteor/client/lib/utils/isLayoutEmbedded.ts @@ -1,3 +1,9 @@ import { router } from '../../providers/RouterProvider'; -export const isLayoutEmbedded = (): boolean => router.getSearchParameters().layout === 'embedded'; +let embedded = false; + +router.subscribeToRouteChange(() => { + embedded = router.getSearchParameters().layout === 'embedded'; +}); + +export const isLayoutEmbedded = () => embedded; diff --git a/apps/meteor/client/providers/LayoutProvider.tsx b/apps/meteor/client/providers/LayoutProvider.tsx index 95b6b04f9f53..15ecc18705e9 100644 --- a/apps/meteor/client/providers/LayoutProvider.tsx +++ b/apps/meteor/client/providers/LayoutProvider.tsx @@ -1,23 +1,23 @@ import { useBreakpoints } from '@rocket.chat/fuselage-hooks'; -import { LayoutContext, useRouter, useSearchParameter, useSetting } from '@rocket.chat/ui-contexts'; +import { LayoutContext, useRouter, useSetting } from '@rocket.chat/ui-contexts'; import type { FC } from 'react'; import React, { useMemo, useState, useEffect } from 'react'; const LayoutProvider: FC = ({ children }) => { const showTopNavbarEmbeddedLayout = Boolean(useSetting('UI_Show_top_navbar_embedded_layout')); const [isCollapsed, setIsCollapsed] = useState(false); - const layout = useSearchParameter('layout'); - const isEmbedded = layout === 'embedded'; const breakpoints = useBreakpoints(); // ["xs", "sm", "md", "lg", "xl", xxl"] + const router = useRouter(); + // Once the layout is embedded, it can't be changed + const [isEmbedded] = useState(() => router.getSearchParameters().layout === 'embedded'); + const isMobile = !breakpoints.includes('md'); useEffect(() => { setIsCollapsed(isMobile); }, [isMobile]); - const router = useRouter(); - return ( { return; } + if (!window.crypto) { + return; + } + + const enabled = settings.get('E2E_Enable'); + // we don't care about the reactivity of this boolean const adminEmbedded = isLayoutEmbedded() && router.getLocationPathname().startsWith('/admin'); - if (!adminEmbedded && settings.get('E2E_Enable') && window.crypto) { + if (enabled && !adminEmbedded) { e2e.startClient(); e2e.enabled.set(true); } else { diff --git a/apps/meteor/client/views/meet/CallPage.tsx b/apps/meteor/client/views/meet/CallPage.tsx index 8e0fc951e3c5..f9ff9b2fc6ce 100644 --- a/apps/meteor/client/views/meet/CallPage.tsx +++ b/apps/meteor/client/views/meet/CallPage.tsx @@ -17,7 +17,7 @@ type CallPageProps = { visitorId: any; status: any; setStatus: any; - layout: any; + isLayoutEmbedded: boolean; visitorName: any; agentName: any; callStartTime: any; @@ -29,7 +29,7 @@ const CallPage: FC = ({ visitorId, status, setStatus, - layout, + isLayoutEmbedded, visitorName, agentName, callStartTime, @@ -45,7 +45,7 @@ const CallPage: FC = ({ let iconSize = 'x21'; let buttonSize = 'x40'; const avatarSize = 'x48'; - if (layout === 'embedded') { + if (isLayoutEmbedded) { iconSize = 'x19'; buttonSize = 'x35'; } @@ -55,7 +55,7 @@ const CallPage: FC = ({ if (visitorToken) { const webrtcInstance = WebRTC.getInstanceByRoomId(roomId, visitorId); const isMobileDevice = (): boolean => { - if (layout === 'embedded') { + if (isLayoutEmbedded) { setCallInIframe(true); } if (window.innerWidth <= 450 && window.innerHeight >= 629 && window.innerHeight <= 900) { @@ -130,7 +130,7 @@ const CallPage: FC = ({ }); setIsAgentActive(true); } - }, [isAgentActive, status, setStatus, visitorId, roomId, visitorToken, layout]); + }, [isAgentActive, status, setStatus, visitorId, roomId, visitorToken, isLayoutEmbedded]); const toggleButton = (control: any): any => { if (control === 'mic') { @@ -143,7 +143,7 @@ const CallPage: FC = ({ }; const closeWindow = (): void => { - if (layout === 'embedded') { + if (isLayoutEmbedded) { return (parent as any)?.handleIframeClose(); } return window.close(); @@ -213,7 +213,7 @@ const CallPage: FC = ({ > {isCameraOn ? : } - {layout === 'embedded' && ( + {isLayoutEmbedded && ( @@ -120,4 +120,4 @@ const ShareMessageModal = ({ onClose, permalink, message }: ShareMessageProps): ); }; -export default memo(ShareMessageModal); +export default memo(ForwardMessageModal); diff --git a/apps/meteor/client/views/room/modals/ForwardMessageModal/index.ts b/apps/meteor/client/views/room/modals/ForwardMessageModal/index.ts new file mode 100644 index 000000000000..d1e119867409 --- /dev/null +++ b/apps/meteor/client/views/room/modals/ForwardMessageModal/index.ts @@ -0,0 +1 @@ +export { default } from './ForwardMessageModal'; diff --git a/apps/meteor/client/views/room/modals/ShareMessageModal/index.ts b/apps/meteor/client/views/room/modals/ShareMessageModal/index.ts deleted file mode 100644 index b8f4876dbb18..000000000000 --- a/apps/meteor/client/views/room/modals/ShareMessageModal/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './ShareMessageModal'; diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 77691511fff6..bc6c31ff04d7 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -2352,6 +2352,7 @@ "Format": "Format", "Forward": "Forward", "Forward_chat": "Forward chat", + "Forward_message": "Forward message", "Forward_to_department": "Forward to department", "Forward_to_user": "Forward to user", "Forwarding": "Forwarding", @@ -3384,8 +3385,8 @@ "Message_has_been_edited_at": "Message has been edited at {{date}}", "Message_has_been_edited_by": "Message has been edited by {{username}}", "Message_has_been_edited_by_at": "Message has been edited by {{username}} at {{date}}", + "Message_has_been_forwarded": "Message has been forwarded", "Message_has_been_pinned": "Message has been pinned", - "Message_has_been_shared": "Message has been shared", "Message_has_been_starred": "Message has been starred", "Message_has_been_unpinned": "Message has been unpinned", "Message_has_been_unstarred": "Message has been unstarred", @@ -4551,7 +4552,6 @@ "Select_an_option": "Select an option", "Select_at_least_one_user": "Select at least one user", "Select_at_least_two_users": "Select at least two users", - "Share_Message": "Share message", "Select_department": "Select a department", "Select_file": "Select file", "Select_role": "Select a Role", @@ -4559,7 +4559,7 @@ "Select_tag": "Select a tag", "Select_the_channels_you_want_the_user_to_be_removed_from": "Select the channels you want the user to be removed from", "Select_the_teams_channels_you_would_like_to_delete": "Select the Team’s Channels you would like to delete, the ones you do not select will be moved to the Workspace.", - "Select_atleast_one_channel_to_share_the_messsage": "Select at least one channel to share the message", + "Select_atleast_one_channel_to_forward_the_messsage_to": "Select at least one channel to forward the message to", "Select_user": "Select user", "Select_users": "Select users", "Selected_agents": "Selected agents", From cbda061947e7c6b5422a68d3890c33357c164bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Jaeger=20Foresti?= <60678893+juliajforesti@users.noreply.github.com> Date: Tue, 29 Aug 2023 22:36:03 -0300 Subject: [PATCH 024/275] chore: bump fuselage (#30199) --- .../components/GenericModal/GenericModal.tsx | 6 +- .../CreateChannel/CreateChannelModal.tsx | 10 +-- .../MatrixFederationSearchModalContent.tsx | 2 +- .../preferences/PreferencesSoundSection.tsx | 4 +- .../client/views/admin/cloud/CopyStep.tsx | 2 +- .../settings/groups/voip/AssignAgentModal.tsx | 2 +- .../settings/inputs/LanguageSettingInput.tsx | 2 +- .../settings/inputs/LookupSettingInput.tsx | 2 +- .../settings/inputs/SelectSettingInput.tsx | 2 +- .../inputs/SelectTimezoneSettingInput.tsx | 2 +- .../omnichannel/analytics/AnalyticsPage.tsx | 4 +- .../AutoTranslate/AutoTranslate.tsx | 8 +- .../ExportMessages/ExportMessages.tsx | 2 +- .../room/contextualBar/Threads/ThreadList.tsx | 2 +- .../components/dashboards/PeriodSelector.tsx | 2 +- .../additionalForms/SlaPoliciesSelect.tsx | 2 +- .../CannedResponse/TextEditor/TextButton.tsx | 2 +- .../CannedResponse/CannedResponseList.tsx | 2 +- .../omnichannel/slaPolicies/SlaEdit.tsx | 28 ++++--- .../EngagementDashboardPage.tsx | 2 +- .../users/BusiestChatTimesSection.tsx | 2 +- .../tests/e2e/page-objects/account-profile.ts | 2 +- .../page-objects/fragments/home-sidenav.ts | 2 +- .../page-objects/omnichannel-sla-policies.ts | 2 +- .../MultiSelectCustom/MultiSelectCustom.tsx | 2 +- .../MultiSelectCustomAnchor.tsx | 2 +- .../SurfaceSelect/SurfaceSelect.tsx | 28 +++---- yarn.lock | 80 +++++++++---------- 28 files changed, 105 insertions(+), 103 deletions(-) diff --git a/apps/meteor/client/components/GenericModal/GenericModal.tsx b/apps/meteor/client/components/GenericModal/GenericModal.tsx index 8b862130f052..8ae487642b92 100644 --- a/apps/meteor/client/components/GenericModal/GenericModal.tsx +++ b/apps/meteor/client/components/GenericModal/GenericModal.tsx @@ -1,4 +1,5 @@ import { Button, Modal } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import type { Keys as IconName } from '@rocket.chat/icons'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { FC, ComponentProps, ReactElement, ReactNode } from 'react'; @@ -73,14 +74,15 @@ const GenericModal: FC = ({ ...props }) => { const t = useTranslation(); + const genericModalId = useUniqueId(); return ( - + {renderIcon(icon, variant)} {tagline && {tagline}} - {title ?? t('Are_you_sure')} + {title ?? t('Are_you_sure')} diff --git a/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx b/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx index a57ad2fd50fd..18023df3e39f 100644 --- a/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx +++ b/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx @@ -207,7 +207,7 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): - {t('Private')} + {t('Private')} {isPrivate ? t('Only_invited_users_can_acess_this_channel') : t('Everyone_can_access_this_channel')} @@ -216,13 +216,7 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): control={control} name='isPrivate' render={({ field: { onChange, value, ref } }): ReactElement => ( - + )} /> diff --git a/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationSearchModalContent.tsx b/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationSearchModalContent.tsx index 2c6503bcab63..ff9a1cbd822b 100644 --- a/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationSearchModalContent.tsx +++ b/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationSearchModalContent.tsx @@ -45,7 +45,7 @@ const MatrixFederationSearchModalContent: VFC - setServerName(String(value))} /> { value={value} onChange={(value) => { onChange(value); - customSound.play(value, { volume: notificationsSoundVolume / 100 }); + customSound.play(String(value), { volume: notificationsSoundVolume / 100 }); }} options={soundsList} /> @@ -54,7 +54,7 @@ const PreferencesSoundSection = () => { value={value} onChange={(value) => { onChange(value); - customSound.play(value, { volume: notificationsSoundVolume / 100 }); + customSound.play(String(value), { volume: notificationsSoundVolume / 100 }); }} options={soundsList} /> diff --git a/apps/meteor/client/views/admin/cloud/CopyStep.tsx b/apps/meteor/client/views/admin/cloud/CopyStep.tsx index 87e765f4d4f0..326ce781fc5c 100644 --- a/apps/meteor/client/views/admin/cloud/CopyStep.tsx +++ b/apps/meteor/client/views/admin/cloud/CopyStep.tsx @@ -28,7 +28,7 @@ const CopyStep: FC = ({ onNextButtonClick }) => { loadWorkspaceRegisterData(); }, [getWorkspaceRegisterData]); - const copyRef = useRef(null); + const copyRef = useRef(null); useEffect(() => { if (!copyRef.current) { diff --git a/apps/meteor/client/views/admin/settings/groups/voip/AssignAgentModal.tsx b/apps/meteor/client/views/admin/settings/groups/voip/AssignAgentModal.tsx index c25d230e8258..7164469aae96 100644 --- a/apps/meteor/client/views/admin/settings/groups/voip/AssignAgentModal.tsx +++ b/apps/meteor/client/views/admin/settings/groups/voip/AssignAgentModal.tsx @@ -59,7 +59,7 @@ const AssignAgentModal: FC = ({ existingExtension, close options={availableExtensions?.extensions?.map((extension) => [extension, extension]) || []} value={extension} placeholder={t('Select_an_option')} - onChange={setExtension} + onChange={(value) => setExtension(String(value))} /> diff --git a/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx index 40f789c7d937..770edd5c12a6 100644 --- a/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx @@ -55,7 +55,7 @@ function LanguageSettingInput({ disabled={disabled} readOnly={readonly} autoComplete={autocomplete === false ? 'off' : undefined} - onChange={handleChange} + onChange={(value) => handleChange(String(value))} options={languages.map(({ key, name }) => [key, name])} /> diff --git a/apps/meteor/client/views/admin/settings/inputs/LookupSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/LookupSettingInput.tsx index db15dc67af1e..8b7175320d98 100644 --- a/apps/meteor/client/views/admin/settings/inputs/LookupSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/LookupSettingInput.tsx @@ -60,7 +60,7 @@ function LookupSettingInput({ disabled={disabled} readOnly={readonly} autoComplete={autocomplete === false ? 'off' : undefined} - onChange={handleChange} + onChange={(value) => handleChange(String(value))} options={values.map(({ key, label }) => [key, label])} /> diff --git a/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx index 212633d2e437..28014d65d375 100644 --- a/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx @@ -58,7 +58,7 @@ function SelectSettingInput({ disabled={disabled} readOnly={readonly} autoComplete={autocomplete === false ? 'off' : undefined} - onChange={handleChange} + onChange={(value) => handleChange(String(value))} options={values.map(({ key, i18nLabel }) => [key, t(i18nLabel)])} /> diff --git a/apps/meteor/client/views/admin/settings/inputs/SelectTimezoneSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/SelectTimezoneSettingInput.tsx index b1e4559bc1cb..1478b8746583 100644 --- a/apps/meteor/client/views/admin/settings/inputs/SelectTimezoneSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/SelectTimezoneSettingInput.tsx @@ -53,7 +53,7 @@ function SelectTimezoneSettingInput({ disabled={disabled} readOnly={readonly} autoComplete={autocomplete === false ? 'off' : undefined} - onChange={handleChange} + onChange={(value) => handleChange(String(value))} options={moment.tz.names().map((key) => [key, key])} /> diff --git a/apps/meteor/client/views/omnichannel/analytics/AnalyticsPage.tsx b/apps/meteor/client/views/omnichannel/analytics/AnalyticsPage.tsx index 529d02d01348..333d2e772c4c 100644 --- a/apps/meteor/client/views/omnichannel/analytics/AnalyticsPage.tsx +++ b/apps/meteor/client/views/omnichannel/analytics/AnalyticsPage.tsx @@ -59,7 +59,7 @@ const AnalyticsPage = () => { - setType(String(value))} /> @@ -76,7 +76,7 @@ const AnalyticsPage = () => { {t('Chart')} - setChartName(String(value))} /> diff --git a/apps/meteor/client/views/room/contextualBar/AutoTranslate/AutoTranslate.tsx b/apps/meteor/client/views/room/contextualBar/AutoTranslate/AutoTranslate.tsx index 9d4872b4eacb..a15edebf8c16 100644 --- a/apps/meteor/client/views/room/contextualBar/AutoTranslate/AutoTranslate.tsx +++ b/apps/meteor/client/views/room/contextualBar/AutoTranslate/AutoTranslate.tsx @@ -49,7 +49,13 @@ const AutoTranslate = ({ {t('Language')} - handleChangeLanguage(String(value))} + options={languages} + /> diff --git a/apps/meteor/client/views/room/contextualBar/ExportMessages/ExportMessages.tsx b/apps/meteor/client/views/room/contextualBar/ExportMessages/ExportMessages.tsx index 7a9ca23c8ec4..1bf59d4e8de7 100644 --- a/apps/meteor/client/views/room/contextualBar/ExportMessages/ExportMessages.tsx +++ b/apps/meteor/client/views/room/contextualBar/ExportMessages/ExportMessages.tsx @@ -42,7 +42,7 @@ const ExportMessages = () => { {t('Method')} - setType(String(value))} placeholder={t('Type')} options={exportOptions} /> diff --git a/apps/meteor/client/views/room/contextualBar/Threads/ThreadList.tsx b/apps/meteor/client/views/room/contextualBar/Threads/ThreadList.tsx index a5717e7f500a..063cb8cc4768 100644 --- a/apps/meteor/client/views/room/contextualBar/Threads/ThreadList.tsx +++ b/apps/meteor/client/views/room/contextualBar/Threads/ThreadList.tsx @@ -144,7 +144,7 @@ const ThreadList: VFC = () => { onChange={handleSearchTextChange} /> - handleTypeChange(String(value))} /> diff --git a/apps/meteor/ee/client/components/dashboards/PeriodSelector.tsx b/apps/meteor/ee/client/components/dashboards/PeriodSelector.tsx index eaadcd27d413..a14ee3075778 100644 --- a/apps/meteor/ee/client/components/dashboards/PeriodSelector.tsx +++ b/apps/meteor/ee/client/components/dashboards/PeriodSelector.tsx @@ -17,7 +17,7 @@ const PeriodSelector = ({ periods, value, onChang const options = useMemo<[string, string][]>(() => periods.map((period) => [period, t(...getPeriod(period).label)]), [periods, t]); - return onChange(value as TPeriod)} />; }; export default PeriodSelector; diff --git a/apps/meteor/ee/client/omnichannel/additionalForms/SlaPoliciesSelect.tsx b/apps/meteor/ee/client/omnichannel/additionalForms/SlaPoliciesSelect.tsx index 35932fb44b87..61e2f9505268 100644 --- a/apps/meteor/ee/client/omnichannel/additionalForms/SlaPoliciesSelect.tsx +++ b/apps/meteor/ee/client/omnichannel/additionalForms/SlaPoliciesSelect.tsx @@ -17,7 +17,7 @@ export const SlaPoliciesSelect = ({ value, label, options, onChange }: SlaPolici {label} - onChange(String(value))} /> ); diff --git a/apps/meteor/ee/client/omnichannel/components/CannedResponse/TextEditor/TextButton.tsx b/apps/meteor/ee/client/omnichannel/components/CannedResponse/TextEditor/TextButton.tsx index d980ff7a5957..a0cb3bf1390c 100644 --- a/apps/meteor/ee/client/omnichannel/components/CannedResponse/TextEditor/TextButton.tsx +++ b/apps/meteor/ee/client/omnichannel/components/CannedResponse/TextEditor/TextButton.tsx @@ -8,7 +8,7 @@ type TextButtonProps = { action: () => void; }; -const TextButton = forwardRef(function TextButton({ text, action }, ref) { +const TextButton = forwardRef(function TextButton({ text, action }, ref) { const t = useTranslation(); return ( diff --git a/apps/meteor/ee/client/omnichannel/components/contextualBar/CannedResponse/CannedResponseList.tsx b/apps/meteor/ee/client/omnichannel/components/contextualBar/CannedResponse/CannedResponseList.tsx index 5e2ae0c3f614..1a41402368d5 100644 --- a/apps/meteor/ee/client/omnichannel/components/contextualBar/CannedResponse/CannedResponseList.tsx +++ b/apps/meteor/ee/client/omnichannel/components/contextualBar/CannedResponse/CannedResponseList.tsx @@ -78,7 +78,7 @@ const CannedResponseList: FC<{ ref={inputRef} /> - setType(String(value))} value={type} options={options} /> diff --git a/apps/meteor/ee/client/omnichannel/slaPolicies/SlaEdit.tsx b/apps/meteor/ee/client/omnichannel/slaPolicies/SlaEdit.tsx index f45d33cc1335..30bcd110a56e 100644 --- a/apps/meteor/ee/client/omnichannel/slaPolicies/SlaEdit.tsx +++ b/apps/meteor/ee/client/omnichannel/slaPolicies/SlaEdit.tsx @@ -102,20 +102,22 @@ function SlaEdit({ data, isNew, slaId, reload, ...props }: SlaEditProps): ReactE {errors.dueTimeInMinutes?.message} - - - - {!isNew && ( - + )} + - )} - - - - + + + + ); } diff --git a/apps/meteor/ee/client/views/admin/engagementDashboard/EngagementDashboardPage.tsx b/apps/meteor/ee/client/views/admin/engagementDashboard/EngagementDashboardPage.tsx index 6110e81cd804..b138ca9a92cd 100644 --- a/apps/meteor/ee/client/views/admin/engagementDashboard/EngagementDashboardPage.tsx +++ b/apps/meteor/ee/client/views/admin/engagementDashboard/EngagementDashboardPage.tsx @@ -35,7 +35,7 @@ const EngagementDashboardPage = ({ tab = 'users', onSelectTab }: EngagementDashb return ( - handleTimezoneChange(String(value))} /> diff --git a/apps/meteor/ee/client/views/admin/engagementDashboard/users/BusiestChatTimesSection.tsx b/apps/meteor/ee/client/views/admin/engagementDashboard/users/BusiestChatTimesSection.tsx index 0bed6d7ffe60..de8ebee6dfe3 100644 --- a/apps/meteor/ee/client/views/admin/engagementDashboard/users/BusiestChatTimesSection.tsx +++ b/apps/meteor/ee/client/views/admin/engagementDashboard/users/BusiestChatTimesSection.tsx @@ -45,7 +45,7 @@ const BusiestChatTimesSection = ({ timezone }: BusiestChatTimesSectionProps): Re return ( <> - handleTimeUnitChange(String(value))} /> > label >> text="Private"'); } get checkboxEncryption(): Locator { diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-sla-policies.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-sla-policies.ts index 904a0ae67fbd..d44d4d0f37b4 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-sla-policies.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-sla-policies.ts @@ -72,7 +72,7 @@ export class OmnichannelSlaPolicies { } get txtDeleteModalTitle() { - return this.page.locator('div.rcx-modal__title >> text="Are you sure?"'); + return this.page.locator('role=dialog >> text="Are you sure?"'); } get txtEmptyState() { diff --git a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsx b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsx index 4a1e733de43f..3cb926a0be20 100644 --- a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsx +++ b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsx @@ -70,7 +70,7 @@ export const MultiSelectCustom = ({ customSetSelected, searchBarText, }: DropDownProps): ReactElement => { - const reference = useRef(null); + const reference = useRef(null); const [collapsed, toggleCollapsed] = useToggle(false); const onClose = useCallback( diff --git a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomAnchor.tsx b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomAnchor.tsx index 29144d0d402a..3debd4e0b638 100644 --- a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomAnchor.tsx +++ b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomAnchor.tsx @@ -14,7 +14,7 @@ type MultiSelectCustomAnchorProps = { maxCount: number; } & ComponentProps; -const MultiSelectCustomAnchor = forwardRef(function MultiSelectCustomAnchor( +const MultiSelectCustomAnchor = forwardRef(function MultiSelectCustomAnchor( { onClick, collapsed, selectedOptionsCount, selectedOptionsTitle, defaultTitle, maxCount, ...props }, ref, ) { diff --git a/packages/uikit-playground/src/Components/SurfaceSelect/SurfaceSelect.tsx b/packages/uikit-playground/src/Components/SurfaceSelect/SurfaceSelect.tsx index 145c9b70c330..da72d91c7b50 100644 --- a/packages/uikit-playground/src/Components/SurfaceSelect/SurfaceSelect.tsx +++ b/packages/uikit-playground/src/Components/SurfaceSelect/SurfaceSelect.tsx @@ -7,20 +7,20 @@ import { surfaceAction } from '../../Context/action'; import options from './options'; const SurfaceSelect: FC = () => { - const { - state: { surface }, - dispatch, - } = useContext(context); - return ( - { + dispatch(surfaceAction(typeof e === 'string' ? parseInt(e) : e)); + }} + /> + ); }; export default SurfaceSelect; diff --git a/yarn.lock b/yarn.lock index 25ed24fb5b53..aa54f641b42b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7350,16 +7350,16 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/css-in-js@npm:~0.31.26-dev.7": - version: 0.31.26-dev.7 - resolution: "@rocket.chat/css-in-js@npm:0.31.26-dev.7" +"@rocket.chat/css-in-js@npm:~0.31.26-dev.16": + version: 0.31.26-dev.16 + resolution: "@rocket.chat/css-in-js@npm:0.31.26-dev.16" dependencies: "@emotion/hash": ^0.9.0 - "@rocket.chat/css-supports": ~0.31.26-dev.7 - "@rocket.chat/memo": ~0.31.26-dev.7 - "@rocket.chat/stylis-logical-props-middleware": ~0.31.26-dev.7 + "@rocket.chat/css-supports": ~0.31.26-dev.16 + "@rocket.chat/memo": ~0.31.26-dev.16 + "@rocket.chat/stylis-logical-props-middleware": ~0.31.26-dev.16 stylis: ~4.1.3 - checksum: ca0e2d2a1df144360e06408f6f7e2c7480d72b915402e9b7c6d29abdc030cd0b9100940f4f7803e9463f61ac1a1466882c999d1524146221916b5bf04b0b1a00 + checksum: 232d4e31d6439cc215982f5512921b6bfc607866fa0df07aa98a1f25e6b538e9604adb6ffbc3914dc820d7b6ee455643560199da544c2d7882818cdff8b00504 languageName: node linkType: hard @@ -7372,12 +7372,12 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/css-supports@npm:~0.31.26-dev.7": - version: 0.31.26-dev.7 - resolution: "@rocket.chat/css-supports@npm:0.31.26-dev.7" +"@rocket.chat/css-supports@npm:~0.31.26-dev.16": + version: 0.31.26-dev.16 + resolution: "@rocket.chat/css-supports@npm:0.31.26-dev.16" dependencies: - "@rocket.chat/memo": ~0.31.26-dev.7 - checksum: c359422b4a7ce5047a703887a5693b6514d289028bbf36bd62049b184e6e34999ea373842d9bc8314705668bfbad7aeb0ce42bdea346d9073dd9e8a571509634 + "@rocket.chat/memo": ~0.31.26-dev.16 + checksum: f7239f70ddef249e23825c1ac5143825cab012170aa67f44a232cf6b4b33d1cc3a365bfc3be4c29150fb494107155867881722ff1ebd610067f281d9b43207d1 languageName: node linkType: hard @@ -7593,10 +7593,10 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/fuselage-tokens@npm:~0.32.0-dev.367": - version: 0.32.0-dev.367 - resolution: "@rocket.chat/fuselage-tokens@npm:0.32.0-dev.367" - checksum: ae3781d7220a45ba813f78ba7d08dec9e333204808f6c93d41d7197e44f031496706dec78249001021ff1af300169e5440924b3dba419fae45bccbbc683fec02 +"@rocket.chat/fuselage-tokens@npm:~0.32.0-dev.376": + version: 0.32.0-dev.376 + resolution: "@rocket.chat/fuselage-tokens@npm:0.32.0-dev.376" + checksum: 8054593aa24eb77c0ec71e93ec07bf91b65c0d9d6f413641bce2f451a12416432c43271ceebb3a8439d5ed7148795d632716231907a93a35715d736fed4d834a languageName: node linkType: hard @@ -7656,14 +7656,14 @@ __metadata: linkType: soft "@rocket.chat/fuselage@npm:next": - version: 0.32.0-dev.417 - resolution: "@rocket.chat/fuselage@npm:0.32.0-dev.417" - dependencies: - "@rocket.chat/css-in-js": ~0.31.26-dev.7 - "@rocket.chat/css-supports": ~0.31.26-dev.7 - "@rocket.chat/fuselage-tokens": ~0.32.0-dev.367 - "@rocket.chat/memo": ~0.31.26-dev.7 - "@rocket.chat/styled": ~0.31.26-dev.7 + version: 0.32.0-dev.426 + resolution: "@rocket.chat/fuselage@npm:0.32.0-dev.426" + dependencies: + "@rocket.chat/css-in-js": ~0.31.26-dev.16 + "@rocket.chat/css-supports": ~0.31.26-dev.16 + "@rocket.chat/fuselage-tokens": ~0.32.0-dev.376 + "@rocket.chat/memo": ~0.31.26-dev.16 + "@rocket.chat/styled": ~0.31.26-dev.16 invariant: ^2.2.4 react-aria: ~3.23.1 react-keyed-flatten-children: ^1.3.0 @@ -7675,7 +7675,7 @@ __metadata: react: ^17.0.2 react-dom: ^17.0.2 react-virtuoso: 1.2.4 - checksum: 5b94df847d0714bf96ac09277d62178345a4ccee2f50e87985bebd9ed366da7950643315870a2c1f92732f0f06728219ebbd4d9ce0fe24434e3bf84da8e7f0f3 + checksum: 477a54211e5cb4676fdd5783f96a9a91622c8c99a3cb74a8f574d2d4a604a0f8c3fb415ea51ecfbabba17063fbfff077228cfbdacfed6449208ecd5f5312488a languageName: node linkType: hard @@ -7944,10 +7944,10 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/memo@npm:~0.31.26-dev.7": - version: 0.31.26-dev.7 - resolution: "@rocket.chat/memo@npm:0.31.26-dev.7" - checksum: 7a73682525be39b058d643b8435b4259d6f1e409df8425bda0830dc0ff7d3e02593d3d80a0fdacbb20d9ce74ab9cd5c442f531bc9694d31aca9b3d0a113a39c5 +"@rocket.chat/memo@npm:~0.31.26-dev.16": + version: 0.31.26-dev.16 + resolution: "@rocket.chat/memo@npm:0.31.26-dev.16" + checksum: e50a53c5574e5f133ced89b8d7d85e839c565e6e2ee1e0e4ee6d07d1af51de67f5e02fe10cf8e652a91f10b0e4e06705dd5734aebfde10b7986bcde618779ea5 languageName: node linkType: hard @@ -8127,7 +8127,6 @@ __metadata: "@types/use-subscription": ^1.0.0 "@types/use-sync-external-store": ^0.0.3 "@types/uuid": ^8.3.4 - "@types/webpack-bundle-analyzer": ^4 "@types/xml-crypto": ~1.4.2 "@types/xml-encryption": ~1.2.1 "@typescript-eslint/eslint-plugin": ~5.60.1 @@ -8329,7 +8328,6 @@ __metadata: uuid: ^8.3.2 vm2: ^3.9.19 webdav: ^4.11.2 - webpack-bundle-analyzer: ^4.9.0 xml-crypto: ~3.1.0 xml-encryption: ~3.0.2 xml2js: ~0.5.0 @@ -8789,12 +8787,12 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/styled@npm:~0.31.26-dev.7": - version: 0.31.26-dev.7 - resolution: "@rocket.chat/styled@npm:0.31.26-dev.7" +"@rocket.chat/styled@npm:~0.31.26-dev.16": + version: 0.31.26-dev.16 + resolution: "@rocket.chat/styled@npm:0.31.26-dev.16" dependencies: - "@rocket.chat/css-in-js": ~0.31.26-dev.7 - checksum: 750ff71076cc8beb8c8280790303e167dd5d84db79aa6ce1d6a4912891474388d6c88cf35bde4103ec9cd91baa8323c3bd65065b3c800a8f6e29c4c3a18d39ad + "@rocket.chat/css-in-js": ~0.31.26-dev.16 + checksum: 337de6bfc6b1dde0d42e2aa1d9bb089ceaba53119371bc6c5008e8e74a3a84fad2f90d00bdfdcb76360e6530ede75ef2bf1889ee0a9f2eacf1f1b02c337206b1 languageName: node linkType: hard @@ -8809,14 +8807,14 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/stylis-logical-props-middleware@npm:~0.31.26-dev.7": - version: 0.31.26-dev.7 - resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.26-dev.7" +"@rocket.chat/stylis-logical-props-middleware@npm:~0.31.26-dev.16": + version: 0.31.26-dev.16 + resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.26-dev.16" dependencies: - "@rocket.chat/css-supports": ~0.31.26-dev.7 + "@rocket.chat/css-supports": ~0.31.26-dev.16 peerDependencies: stylis: 4.0.10 - checksum: a60bdeb134db3666887fa858475a07cb6506a4c616e5b30e32e02a5693554e688db4b062b7a8f2fe18eb401fb9047442fce6c35c790f375a0fc73b6fd15b7272 + checksum: 37e47fb2912349edeb8fba9c08614394ce88b9438fff61647f55dbc3d78c8ad88516b49e03e969a096089db0372c23b9c45994d43db7fb76d20bcfbebb73b4b1 languageName: node linkType: hard From 9e10de0d791dbe01fe3b04f459a199a7795157d8 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 30 Aug 2023 10:46:15 -0300 Subject: [PATCH 025/275] regression: fix wrong spread props for apps stream (#30219) --- apps/meteor/ee/client/apps/communication/websockets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/ee/client/apps/communication/websockets.js b/apps/meteor/ee/client/apps/communication/websockets.js index 817b42c86809..ddea19163639 100644 --- a/apps/meteor/ee/client/apps/communication/websockets.js +++ b/apps/meteor/ee/client/apps/communication/websockets.js @@ -27,7 +27,7 @@ export class AppWebsocketReceiver extends Emitter { } listenStreamerEvents() { - sdk.stream('apps', ['apps'], (key, args) => { + sdk.stream('apps', ['apps'], ([key, args]) => { switch (key) { case AppEvents.COMMAND_ADDED: this.onCommandAddedOrUpdated(...args); From 04fe492555f908bdc3d4192320144e543d79353b Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Wed, 30 Aug 2023 12:09:55 -0300 Subject: [PATCH 026/275] feat: Added new trigger condition `after-guest-registration` (#29785) --- .changeset/eighty-kids-jog.md | 6 + .../omnichannel/triggers/TriggersForm.tsx | 22 ++- .../rocketchat-i18n/i18n/en.i18n.json | 1 + .../rocketchat-i18n/i18n/pt-BR.i18n.json | 1 + .../omnichannel/omnichannel-triggers.spec.ts | 143 ++++++++++++++---- .../e2e/page-objects/omnichannel-livechat.ts | 31 ++++ .../e2e/page-objects/omnichannel-triggers.ts | 126 +++++++++------ packages/core-typings/src/ILivechatTrigger.ts | 1 + packages/livechat/src/components/App/App.tsx | 13 +- .../src/components/Composer/index.tsx | 1 + .../livechat/src/helpers/canRenderMessage.ts | 3 + packages/livechat/src/helpers/upsert.ts | 2 +- packages/livechat/src/lib/room.js | 2 +- packages/livechat/src/lib/triggers.js | 47 ++++-- .../livechat/src/routes/Chat/connector.tsx | 2 +- .../livechat/src/routes/Chat/container.js | 4 +- .../src/routes/TriggerMessage/container.js | 2 +- packages/rest-typings/src/v1/omnichannel.ts | 2 +- 18 files changed, 305 insertions(+), 104 deletions(-) create mode 100644 .changeset/eighty-kids-jog.md diff --git a/.changeset/eighty-kids-jog.md b/.changeset/eighty-kids-jog.md new file mode 100644 index 000000000000..6410813d80a6 --- /dev/null +++ b/.changeset/eighty-kids-jog.md @@ -0,0 +1,6 @@ +--- +'@rocket.chat/livechat': minor +'@rocket.chat/meteor': minor +--- + +Added new Omnichannel's trigger condition "After starting a chat". diff --git a/apps/meteor/client/views/omnichannel/triggers/TriggersForm.tsx b/apps/meteor/client/views/omnichannel/triggers/TriggersForm.tsx index 75f22872ff6f..72c8d30d973e 100644 --- a/apps/meteor/client/views/omnichannel/triggers/TriggersForm.tsx +++ b/apps/meteor/client/views/omnichannel/triggers/TriggersForm.tsx @@ -62,6 +62,7 @@ const TriggersForm: FC = ({ values, handlers, className }) => ['page-url', t('Visitor_page_URL')], ['time-on-site', t('Visitor_time_on_site')], ['chat-opened-by-visitor', t('Chat_opened_by_visitor')], + ['after-guest-registration', t('After_guest_registration')], ], [t], ); @@ -167,11 +168,16 @@ const TriggersForm: FC = ({ values, handlers, className }) => {t('Condition')} - {conditionValuePlaceholder && ( - + )} @@ -181,15 +187,21 @@ const TriggersForm: FC = ({ values, handlers, className }) => - {actionSender === 'custom' && ( - + )} - + {msgError} diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index bc6c31ff04d7..8db626688c16 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -360,6 +360,7 @@ "Adult_images_are_not_allowed": "Adult images are not allowed", "Aerospace_and_Defense": "Aerospace & Defense", "After_OAuth2_authentication_users_will_be_redirected_to_this_URL": "After OAuth2 authentication, users will be redirected to an URL on this list. You can add one URL per line.", + "After_guest_registration": "After guest registration", "Agent": "Agent", "Agent_added": "Agent added", "Agent_Info": "Agent Info", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json index a4cb7abf8b68..bf2f838d442a 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json @@ -325,6 +325,7 @@ "Adult_images_are_not_allowed": "Imagens com conteúdo adulto não são permitidas", "Aerospace_and_Defense": "Aeroespacial e Defesa", "After_OAuth2_authentication_users_will_be_redirected_to_this_URL": "Após a autenticação OAuth2, os usuários serão redirecionados para este URL. Você poderá adicionar um URL por linha.", + "After_guest_registration": "Após registro do convidado", "Agent": "Agente", "Agent_added": "Agente adicionado", "Agent_Info": "Informações do agente", diff --git a/apps/meteor/tests/e2e/omnichannel/omnichannel-triggers.spec.ts b/apps/meteor/tests/e2e/omnichannel/omnichannel-triggers.spec.ts index d882296fae44..4cf3b82b2c66 100644 --- a/apps/meteor/tests/e2e/omnichannel/omnichannel-triggers.spec.ts +++ b/apps/meteor/tests/e2e/omnichannel/omnichannel-triggers.spec.ts @@ -6,7 +6,7 @@ import { Users } from '../fixtures/userStates'; import { OmnichannelLiveChat, HomeOmnichannel } from '../page-objects'; import { test, expect } from '../utils/test'; -test.describe.serial('omnichannel-triggers', () => { +test.describe.serial('Omnichannel Triggers', () => { let triggersName: string; let triggerMessage: string; let poLiveChat: OmnichannelLiveChat; @@ -19,17 +19,16 @@ test.describe.serial('omnichannel-triggers', () => { email: faker.internet.email(), }; triggersName = faker.string.uuid(); - triggerMessage = 'Welcome to Rocket.chat'; - await Promise.all([ + triggerMessage = 'This is a trigger message'; + const requests = await Promise.all([ api.post('/livechat/users/agent', { username: 'user1' }), api.post('/livechat/users/manager', { username: 'user1' }), + api.post('/settings/Livechat_clear_local_storage_when_chat_ended', { value: true }), ]); + requests.every((e) => expect(e.status()).toBe(200)); - const { page } = await createAuxContext(browser, Users.user1); + const { page } = await createAuxContext(browser, Users.user1, '/omnichannel/triggers'); agent = { page, poHomeOmnichannel: new HomeOmnichannel(page) }; - - await page.goto('/omnichannel/triggers'); - await page.locator('.main-content').waitFor(); }); test.beforeEach(async ({ page, api }) => { @@ -37,37 +36,121 @@ test.describe.serial('omnichannel-triggers', () => { }); test.afterAll(async ({ api }) => { - await Promise.all([api.delete('/livechat/users/agent/user1'), api.delete('/livechat/users/manager/user1')]); + await Promise.all([ + api.delete('/livechat/users/agent/user1'), + api.delete('/livechat/users/manager/user1'), + api.post('/settings/Livechat_clear_local_storage_when_chat_ended', { value: false }), + ]); await agent.page.close(); }); - test('Triggers', async ({ page }) => { + test('trigger baseline', async ({ page }) => { + await page.goto('/livechat'); + await poLiveChat.openLiveChat(); + + await test.step('expect to register visitor', async () => { + await expect(poLiveChat.btnChatNow).not.toBeVisible(); + await poLiveChat.sendMessage(newUser, false); + }); + + await test.step('expect send a message as a visitor', async () => { + await poLiveChat.onlineAgentMessage.type('this_a_test_message_from_user'); + await poLiveChat.btnSendMessageToOnlineAgent.click(); + await expect(poLiveChat.txtChatMessage('this_a_test_message_from_user')).toBeVisible(); + }); + + await test.step('expect to finish this chat', async () => { + await poLiveChat.closeChat(); + await expect(poLiveChat.txtHeaderTitle).toBeVisible(); + }); + }); + + test('create and edit trigger', async () => { await test.step('expect create new trigger', async () => { await agent.poHomeOmnichannel.triggers.createTrigger(triggersName, triggerMessage); - await expect(agent.poHomeOmnichannel.triggers.toastMessage).toBeVisible(); + await agent.poHomeOmnichannel.triggers.btnCloseToastMessage.click(); }); + await test.step('expect update trigger', async () => { - const newTriggerName = `edited-${triggersName}`; await agent.poHomeOmnichannel.triggers.firstRowInTriggerTable(triggersName).click(); - await agent.poHomeOmnichannel.triggers.updateTrigger(newTriggerName); - await expect(agent.poHomeOmnichannel.triggers.toastMessage).toBeVisible(); - }); - await test.step('expect triggers to be displaye on Livechat', async () => { - await test.step('Expect send a message as a visitor', async () => { - await page.goto('/livechat'); - await poLiveChat.openLiveChat(); - if (await page.locator('[type="button"] >> text="Chat now"').isVisible()) { - await page.locator('[type="button"] >> text="Chat now"').click(); - } - await poLiveChat.sendMessage(newUser, false); - await expect(page.locator(`text=${triggerMessage} >> nth=0`)).toBeVisible(); - await page.goBack(); - }); - }); - await test.step('expect deleting trigger', async () => { - await agent.poHomeOmnichannel.triggers.btnDeletefirstRowInTable.click(); - await agent.poHomeOmnichannel.triggers.btnModalRemove.click(); - await expect(agent.poHomeOmnichannel.triggers.removeToastMessage).toBeVisible(); + await agent.poHomeOmnichannel.triggers.updateTrigger(triggersName); + await agent.poHomeOmnichannel.triggers.btnCloseToastMessage.click(); + }); + }); + + test('trigger condition: chat opened by visitor', async ({ page }) => { + await test.step('expect to start conversation', async () => { + await page.goto('/livechat'); + await poLiveChat.openLiveChat(); + }); + + await test.step('expect trigger message before registration', async () => { + await expect(poLiveChat.txtChatMessage(triggerMessage)).toBeVisible(); + }); + + await test.step('expect to register visitor', async () => { + await poLiveChat.btnChatNow.click(); + await poLiveChat.sendMessage(newUser, false); + }); + + await test.step('expect trigger message after registration', async () => { + await expect(poLiveChat.txtChatMessage(triggerMessage)).not.toBeVisible(); }); + + await test.step('expect send a message as a visitor', async () => { + await poLiveChat.onlineAgentMessage.type('this_a_test_message_from_user'); + await poLiveChat.btnSendMessageToOnlineAgent.click(); + await expect(poLiveChat.txtChatMessage('this_a_test_message_from_user')).toBeVisible(); + }); + + await test.step('expect to finish this chat', async () => { + await poLiveChat.closeChat(); + await expect(poLiveChat.txtHeaderTitle).toBeVisible(); + }); + }); + + test('trigger condition: after guest registration', async ({ page }) => { + await test.step('expect update trigger to after guest registration', async () => { + await agent.poHomeOmnichannel.triggers.firstRowInTriggerTable(`edited-${triggersName}`).click(); + await agent.poHomeOmnichannel.triggers.fillTriggerForm({ condition: 'after-guest-registration', triggerMessage }); + await agent.poHomeOmnichannel.triggers.btnSave.click(); + await agent.poHomeOmnichannel.triggers.btnCloseToastMessage.click(); + await agent.page.waitForTimeout(500); + }); + + await test.step('expect to start conversation', async () => { + await page.goto('/livechat'); + await poLiveChat.openLiveChat(); + }); + + await test.step('expect not to have trigger message before registration', async () => { + await expect(poLiveChat.txtChatMessage(triggerMessage)).not.toBeVisible(); + await expect(poLiveChat.btnChatNow).not.toBeVisible(); + }); + + await test.step('expect to register visitor', async () => { + await poLiveChat.sendMessage(newUser, false); + }); + + await test.step('expect trigger message after registration', async () => { + await expect(poLiveChat.txtChatMessage(triggerMessage)).toBeVisible(); + }); + + await test.step('expect send a message as a visitor', async () => { + await poLiveChat.onlineAgentMessage.type('this_a_test_message_from_user'); + await poLiveChat.btnSendMessageToOnlineAgent.click(); + await expect(poLiveChat.txtChatMessage('this_a_test_message_from_user')).toBeVisible(); + }); + + await test.step('expect to finish this chat', async () => { + await poLiveChat.closeChat(); + await expect(poLiveChat.txtHeaderTitle).toBeVisible(); + }); + }); + + test('delete trigger', async () => { + await agent.poHomeOmnichannel.triggers.btnDeletefirstRowInTable.click(); + await agent.poHomeOmnichannel.triggers.btnModalRemove.click(); + await expect(agent.poHomeOmnichannel.triggers.removeToastMessage).toBeVisible(); }); }); diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts index 1bff6b651990..754ab9c01d7a 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts @@ -11,6 +11,36 @@ export class OmnichannelLiveChat { return this.page.locator(`role=button[name="${label}"]`); } + get btnOptions(): Locator { + return this.page.locator(`button >> text="Options"`); + } + + get btnCloseChat(): Locator { + return this.page.locator(`button >> text="Finish this chat"`); + } + + get btnCloseChatConfirm(): Locator { + return this.page.locator(`button >> text="Yes"`); + } + + get txtHeaderTitle(): Locator { + return this.page.locator('div >> text="Chat Finished"'); + } + + get btnChatNow(): Locator { + return this.page.locator('[type="button"] >> text="Chat now"'); + } + + txtChatMessage(message: string): Locator { + return this.page.locator(`text="${message}"`); + } + + async closeChat(): Promise { + await this.btnOptions.click(); + await this.btnCloseChat.click(); + await this.btnCloseChatConfirm.click(); + } + async openLiveChat(): Promise { const { value: siteName } = await (await this.api.get('/settings/Site_Name')).json(); await this.btnOpenLiveChat(siteName).click(); @@ -62,5 +92,6 @@ export class OmnichannelLiveChat { await this.textAreaMessage.type('any_message'); } await this.btnSendMessage(buttonLabel).click(); + await this.page.waitForSelector('[data-qa="livechat-composer"]'); } } diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-triggers.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-triggers.ts index 1bbe83867a00..a90171f74422 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-triggers.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-triggers.ts @@ -16,51 +16,27 @@ export class OmnichannelTriggers { return this.page.locator(`role=main >> role=button[name="${name}"]`).first(); } - get Name(): Locator { + get inputName(): Locator { return this.page.locator('[placeholder="Name"]'); } - get Description(): Locator { + get inputDescription(): Locator { return this.page.locator('[placeholder="Description"]'); } - get visitorTimeOnSite(): Locator { - return this.page.locator('text=Visitor time on site'); - } - - get visitorPageURL(): Locator { - return this.page.locator('text=Visitor page URL'); - } - - get chatOpenedByVisitor(): Locator { - return this.page.locator('text=Chat opened by the visitor'); - } - get addTime(): Locator { return this.page.locator('[placeholder="Time in seconds"]'); } - get impersonateAgent(): Locator { - return this.page.locator('text=Impersonate next agent from queue'); - } - get impersonateAgentListBox(): Locator { return this.page.locator('ol[role="listbox"] >> text=Impersonate next agent from queue'); } - get customAgent(): Locator { - return this.page.locator('text=Custom agent'); - } - - get agentName(): Locator { - return this.page.locator('[placeholder="Name of agent"]'); - } - get textArea(): Locator { return this.page.locator('textarea'); } - get saveBtn(): Locator { + get btnSave(): Locator { return this.page.locator('button >> text="Save"'); } @@ -76,6 +52,10 @@ export class OmnichannelTriggers { return this.page.locator('.rcx-toastbar.rcx-toastbar--success >> nth=0'); } + get btnCloseToastMessage(): Locator { + return this.toastMessage.locator('role=button'); + } + get inputSearch() { return this.page.locator('[placeholder="Search"]'); } @@ -96,27 +76,85 @@ export class OmnichannelTriggers { return this.page.locator('text=Trigger removed'); } + get inputCondition(): Locator { + return this.page.locator('button', { has: this.page.locator('select[name="condition"]') }); + } + + get inputConditionValue(): Locator { + return this.page.locator('input[name="conditionValue"]'); + } + + get inputSender(): Locator { + return this.page.locator('button', { has: this.page.locator('select[name="sender"]') }); + } + + get inputAgentName(): Locator { + return this.page.locator('input[name="agentName"]'); + } + + get inputTriggerMessage(): Locator { + return this.page.locator('textarea[name="triggerMessage"]'); + } + + async selectCondition(condition: string) { + await this.inputCondition.click(); + await this.page.locator(`li.rcx-option[data-key="${condition}"]`).click(); + } + + async selectSender(sender: 'queue' | 'custom') { + await this.inputSender.click(); + await this.page.locator(`li.rcx-option[data-key="${sender}"]`).click(); + } + public async createTrigger(triggersName: string, triggerMessage: string) { await this.headingButtonNew('Create trigger').click(); - await this.Name.fill(triggersName); - await this.Description.fill('Creating a fresh trigger'); - await this.visitorPageURL.click(); - await this.visitorTimeOnSite.click(); - await this.addTime.click(); - await this.addTime.fill('5s'); - await this.impersonateAgent.click(); - await this.textArea.fill(triggerMessage); - await this.saveBtn.click(); + await this.fillTriggerForm({ + name: triggersName, + description: 'Creating a fresh trigger', + condition: 'time-on-site', + conditionValue: '5s', + triggerMessage, + }); + await this.btnSave.click(); } public async updateTrigger(newName: string) { - await this.Name.fill(newName); - await this.Description.fill('Updating the existing trigger'); - await this.visitorTimeOnSite.click(); - await this.chatOpenedByVisitor.click(); - await this.impersonateAgent.click(); - await this.customAgent.click(); - await this.agentName.fill('Rocket.cat'); - await this.saveBtn.click(); + await this.fillTriggerForm({ + name: `edited-${newName}`, + description: 'Updating the existing trigger', + condition: 'chat-opened-by-visitor', + sender: 'custom', + agentName: 'Rocket.cat', + }); + await this.btnSave.click(); + } + + public async fillTriggerForm( + data: Partial<{ + name: string; + description: string; + condition: 'time-on-site' | 'chat-opened-by-visitor' | 'after-guest-registration'; + conditionValue?: string; + sender: 'queue' | 'custom'; + agentName?: string; + triggerMessage: string; + }>, + ) { + data.name && (await this.inputName.fill(data.name)); + data.description && (await this.inputDescription.fill(data.description)); + data.condition && (await this.selectCondition(data.condition)); + + if (data.conditionValue) { + await this.inputConditionValue.fill(data.conditionValue); + } + + data.sender && (await this.selectSender(data.sender)); + if (data.sender === 'custom' && !data.agentName) { + throw new Error('A custom agent is required for this action'); + } else { + data.agentName && (await this.inputAgentName.fill(data.agentName)); + } + + data.triggerMessage && (await this.inputTriggerMessage.fill(data.triggerMessage)); } } diff --git a/packages/core-typings/src/ILivechatTrigger.ts b/packages/core-typings/src/ILivechatTrigger.ts index 8d02801ce99f..f34764394fd4 100644 --- a/packages/core-typings/src/ILivechatTrigger.ts +++ b/packages/core-typings/src/ILivechatTrigger.ts @@ -4,6 +4,7 @@ export enum ILivechatTriggerType { TIME_ON_SITE = 'time-on-site', PAGE_URL = 'page-url', CHAT_OPENED_BY_VISITOR = 'chat-opened-by-visitor', + AFTER_GUEST_REGISTRATION = 'after-guest-registration', } export interface ILivechatTriggerCondition { diff --git a/packages/livechat/src/components/App/App.tsx b/packages/livechat/src/components/App/App.tsx index 31c6512d792e..0ca3f1b6b366 100644 --- a/packages/livechat/src/components/App/App.tsx +++ b/packages/livechat/src/components/App/App.tsx @@ -1,3 +1,4 @@ +import type { ILivechatTrigger } from '@rocket.chat/core-typings'; import i18next from 'i18next'; import { Component } from 'preact'; import Router, { route } from 'preact-router'; @@ -37,6 +38,7 @@ type AppProps = { online?: boolean; departments: Department[]; enabled?: boolean; + triggers: ILivechatTrigger[]; }; gdpr: { accepted: boolean; @@ -80,7 +82,7 @@ export class App extends Component { poppedOut: false, }; - protected handleRoute = async () => { + protected handleRoute = async ({ url }: { url: string }) => { setTimeout(() => { const { config: { @@ -91,10 +93,9 @@ export class App extends Component { forceAcceptDataProcessingConsent: gdprRequired, }, online, - departments = [], + departments, }, gdpr: { accepted: gdprAccepted }, - triggered, user, } = this.props; @@ -110,10 +111,10 @@ export class App extends Component { } const showDepartment = departments.filter((dept) => dept.showOnRegistration).length > 0; + const isAnyFieldVisible = nameFieldRegistrationForm || emailFieldRegistrationForm || showDepartment; + const showRegistrationForm = !user?.token && registrationForm && isAnyFieldVisible && !Triggers.showTriggerMessages(); - const showRegistrationForm = - registrationForm && (nameFieldRegistrationForm || emailFieldRegistrationForm || showDepartment) && !triggered && !user?.token; - if (showRegistrationForm) { + if (url === '/' && showRegistrationForm) { return route('/register'); } }, 100); diff --git a/packages/livechat/src/components/Composer/index.tsx b/packages/livechat/src/components/Composer/index.tsx index 944d02311aa0..2562a40debdc 100644 --- a/packages/livechat/src/components/Composer/index.tsx +++ b/packages/livechat/src/components/Composer/index.tsx @@ -271,6 +271,7 @@ export class Composer extends Component { ref={this.handleRef} contentEditable data-placeholder={placeholder} + data-qa='livechat-composer' onInput={this.handleInput(onChange)} onKeyPress={this.handleKeypress(onSubmit)} onPaste={this.handlePaste(onUpload)} diff --git a/packages/livechat/src/helpers/canRenderMessage.ts b/packages/livechat/src/helpers/canRenderMessage.ts index b7dd462498e6..ea0940893694 100644 --- a/packages/livechat/src/helpers/canRenderMessage.ts +++ b/packages/livechat/src/helpers/canRenderMessage.ts @@ -25,3 +25,6 @@ const msgTypesNotRendered = [ ]; export const canRenderMessage = ({ t }: { t: string }) => !msgTypesNotRendered.includes(t); + +export const canRenderTriggerMessage = (user: { token: string }) => (message: { trigger?: boolean; triggerAfterRegistration?: boolean }) => + !message.trigger || (!user && !message.triggerAfterRegistration) || (user && message.triggerAfterRegistration); diff --git a/packages/livechat/src/helpers/upsert.ts b/packages/livechat/src/helpers/upsert.ts index 83aa38bf80bb..deb5a2076fe0 100644 --- a/packages/livechat/src/helpers/upsert.ts +++ b/packages/livechat/src/helpers/upsert.ts @@ -8,7 +8,7 @@ const getInsertIndex = (array: T[], item: T, ranking: (item: T) => number) => const guessedOrder = ranking(array[guess]); if (guessedOrder < order) { min = guess + 1; - } else if (guessedOrder > ranking(array[guess + 1])) { + } else if (guess + 1 <= max && guessedOrder > ranking(array[guess + 1])) { return guess; } else { max = guess - 1; diff --git a/packages/livechat/src/lib/room.js b/packages/livechat/src/lib/room.js index 0dcfb8a6def5..ad447726d9b0 100644 --- a/packages/livechat/src/lib/room.js +++ b/packages/livechat/src/lib/room.js @@ -242,7 +242,7 @@ Livechat.onMessage(async (originalMessage) => { await doPlaySound(message); }); -export const getGreetingMessages = (messages) => messages && messages.filter((msg) => msg.trigger); +export const getGreetingMessages = (messages) => messages && messages.filter((msg) => msg.trigger && msg.triggerAfterRegistration); export const getLatestCallMessage = (messages) => messages && messages.filter((msg) => isVideoCallMessage(msg)).pop(); export const loadMessages = async () => { diff --git a/packages/livechat/src/lib/triggers.js b/packages/livechat/src/lib/triggers.js index 038efb5876fd..4cf01090587c 100644 --- a/packages/livechat/src/lib/triggers.js +++ b/packages/livechat/src/lib/triggers.js @@ -105,12 +105,10 @@ class Triggers { this._started = true; this._triggers = [...triggers]; - firedTriggers.forEach((triggerId) => { - this._triggers.forEach((trigger) => { - if (trigger._id === triggerId) { - trigger.skip = true; - } - }); + this._triggers.forEach((trigger) => { + if (firedTriggers.includes(trigger._id)) { + trigger.skip = true; + } }); store.on('change', ([state, prevState]) => { @@ -121,11 +119,13 @@ class Triggers { } async fire(trigger) { - const { token, firedTriggers = [], user } = store.state; + const { token, user } = store.state; + if (!this._enabled || user) { return; } - const { actions } = trigger; + + const { actions, conditions } = trigger; await asyncForEach(actions, (action) => { if (action.name === 'send-message') { trigger.skip = true; @@ -140,6 +140,7 @@ class Triggers { ts: ts.toISOString(), _id: createToken(), trigger: true, + triggerAfterRegistration: conditions.some((c) => c.name === 'after-guest-registration'), }; await store.setState({ @@ -148,9 +149,10 @@ class Triggers { store.state.messages, message, ({ _id }) => _id === message._id, - ({ ts }) => ts, + ({ ts }) => new Date(ts).getTime(), ), }); + await processUnread(); if (agent && agent._id) { @@ -158,10 +160,11 @@ class Triggers { parentCall('callback', ['assign-agent', normalizeAgent(agent)]); } - const foundCondition = trigger.conditions.find((c) => c.name === 'chat-opened-by-visitor'); + const foundCondition = trigger.conditions.find((c) => ['chat-opened-by-visitor', 'after-guest-registration'].includes(c.name)); if (!foundCondition) { route('/trigger-messages'); } + store.setState({ minimized: false }); }); } @@ -169,8 +172,7 @@ class Triggers { if (trigger.runOnce) { trigger.skip = true; - firedTriggers.push(trigger._id); - store.setState({ firedTriggers }); + store.setState({ firedTriggers: [...store.state.firedTriggers, trigger._id] }); } } @@ -178,6 +180,23 @@ class Triggers { this._requests.push(request); } + ready(triggerId, condition) { + const { activeTriggers = [] } = store.state; + store.setState({ activeTriggers: { ...activeTriggers, [triggerId]: condition } }); + } + + showTriggerMessages() { + const { activeTriggers = [] } = store.state; + + const triggers = Object.entries(activeTriggers); + + if (!triggers.length) { + return false; + } + + return triggers.some(([, condition]) => condition.name !== 'after-guest-registration'); + } + processTriggers() { this._triggers.forEach((trigger) => { if (trigger.skip) { @@ -189,19 +208,23 @@ class Triggers { case 'page-url': const hrefRegExp = new RegExp(condition.value, 'g'); if (this.parentUrl && hrefRegExp.test(this.parentUrl)) { + this.ready(trigger._id, condition); this.fire(trigger); } break; case 'time-on-site': + this.ready(trigger._id, condition); trigger.timeout = setTimeout(() => { this.fire(trigger); }, parseInt(condition.value, 10) * 1000); break; case 'chat-opened-by-visitor': + case 'after-guest-registration': const openFunc = () => { this.fire(trigger); this.callbacks.off('chat-opened-by-visitor', openFunc); }; + this.ready(trigger._id, condition); this.callbacks.on('chat-opened-by-visitor', openFunc); break; } diff --git a/packages/livechat/src/routes/Chat/connector.tsx b/packages/livechat/src/routes/Chat/connector.tsx index 7e1e432a5441..9493133f44b3 100644 --- a/packages/livechat/src/routes/Chat/connector.tsx +++ b/packages/livechat/src/routes/Chat/connector.tsx @@ -112,7 +112,7 @@ const ChatConnector = ({ ref, ...props }: ChatConnectorProps) => ( : undefined } room={room} - messages={messages?.filter((message) => canRenderMessage(message))} + messages={messages?.filter(canRenderMessage)} noMoreMessages={noMoreMessages} emoji={true} uploads={uploads} diff --git a/packages/livechat/src/routes/Chat/container.js b/packages/livechat/src/routes/Chat/container.js index b5bb4d7a2172..d3fab0102855 100644 --- a/packages/livechat/src/routes/Chat/container.js +++ b/packages/livechat/src/routes/Chat/container.js @@ -5,7 +5,7 @@ import { withTranslation } from 'react-i18next'; import { Livechat } from '../../api'; import { ModalManager } from '../../components/Modal'; import { getAvatarUrl } from '../../helpers/baseUrl'; -import { canRenderMessage } from '../../helpers/canRenderMessage'; +import { canRenderMessage, canRenderTriggerMessage } from '../../helpers/canRenderMessage'; import { debounce } from '../../helpers/debounce'; import { throttle } from '../../helpers/throttle'; import { upsert } from '../../helpers/upsert'; @@ -447,7 +447,7 @@ export const ChatConnector = ({ ref, t, ...props }) => ( : undefined } room={room} - messages={messages && messages.filter((message) => canRenderMessage(message))} + messages={messages && messages.filter(canRenderMessage).filter(canRenderTriggerMessage(user))} noMoreMessages={noMoreMessages} emoji={true} uploads={uploads} diff --git a/packages/livechat/src/routes/TriggerMessage/container.js b/packages/livechat/src/routes/TriggerMessage/container.js index 03b720ef7cb4..655279d11ea8 100644 --- a/packages/livechat/src/routes/TriggerMessage/container.js +++ b/packages/livechat/src/routes/TriggerMessage/container.js @@ -58,7 +58,7 @@ export const TriggerMessageConnector = ({ ref, ...props }) => ( } : undefined } - messages={messages && messages.filter((message) => canRenderMessage(message))} + messages={messages && messages.filter(canRenderMessage)} /> )} diff --git a/packages/rest-typings/src/v1/omnichannel.ts b/packages/rest-typings/src/v1/omnichannel.ts index 09549c71e351..f85358c38ee9 100644 --- a/packages/rest-typings/src/v1/omnichannel.ts +++ b/packages/rest-typings/src/v1/omnichannel.ts @@ -3041,7 +3041,7 @@ const POSTLivechatTriggersParamsSchema = { properties: { name: { type: 'string', - enum: ['time-on-site', 'page-url', 'chat-opened-by-visitor'], + enum: ['time-on-site', 'page-url', 'chat-opened-by-visitor', 'after-guest-registration'], }, value: { type: 'string', From 93d5a5ceb8e107f743f6dca802715e4613f0e9f2 Mon Sep 17 00:00:00 2001 From: Murtaza Patrawala <34130764+murtaza98@users.noreply.github.com> Date: Wed, 30 Aug 2023 20:23:54 +0400 Subject: [PATCH 027/275] fix: User timezone not being respected on Current Chat's filter (#30204) --- .changeset/stale-roses-knock.md | 5 +++++ .../views/omnichannel/currentChats/CurrentChatsPage.tsx | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/stale-roses-knock.md diff --git a/.changeset/stale-roses-knock.md b/.changeset/stale-roses-knock.md new file mode 100644 index 000000000000..25e93fa8c346 --- /dev/null +++ b/.changeset/stale-roses-knock.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fix: User timezone not being respected on Current Chat's filter diff --git a/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.tsx b/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.tsx index 013d91707c7c..1c3a79f30f9e 100644 --- a/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.tsx +++ b/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.tsx @@ -84,10 +84,10 @@ const currentChatQuery: useQueryType = ( if (from || to) { query.createdAt = JSON.stringify({ ...(from && { - start: moment(new Date(from)).set({ hour: 0, minutes: 0, seconds: 0 }).format('YYYY-MM-DDTHH:mm:ss'), + start: moment(new Date(from)).set({ hour: 0, minutes: 0, seconds: 0 }).toISOString(), }), ...(to && { - end: moment(new Date(to)).set({ hour: 23, minutes: 59, seconds: 59 }).format('YYYY-MM-DDTHH:mm:ss'), + end: moment(new Date(to)).set({ hour: 23, minutes: 59, seconds: 59 }).toISOString(), }), }); } From 2e2a89e199e2c9fad2bb6f223fff6bdd495691fc Mon Sep 17 00:00:00 2001 From: Hugo Costa Date: Wed, 30 Aug 2023 13:46:22 -0300 Subject: [PATCH 028/275] regression: custom multi select broken layout and fowardRef error (#30215) Co-authored-by: Guilherme Gazzo --- .../views/admin/rooms/RoomsTableFilters.tsx | 1 + .../MultiSelectCustom/MultiSelectCustom.tsx | 13 ++++--- .../MultiSelectCustomAnchor.tsx | 38 +++++++++++-------- .../MultiSelectCustomList.tsx | 21 +++++----- .../MultiSelectCustomListWrapper.tsx | 26 ++++++------- 5 files changed, 52 insertions(+), 47 deletions(-) diff --git a/apps/meteor/client/views/admin/rooms/RoomsTableFilters.tsx b/apps/meteor/client/views/admin/rooms/RoomsTableFilters.tsx index 8f64f08e38d1..0d8e5bd0c97e 100644 --- a/apps/meteor/client/views/admin/rooms/RoomsTableFilters.tsx +++ b/apps/meteor/client/views/admin/rooms/RoomsTableFilters.tsx @@ -82,6 +82,7 @@ const RoomsTableFilters = ({ setFilters }: { setFilters: Dispatch } diff --git a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsx b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsx index 3cb926a0be20..1420a62346d6 100644 --- a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsx +++ b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsx @@ -1,5 +1,5 @@ import { Box } from '@rocket.chat/fuselage'; -import { useToggle } from '@rocket.chat/fuselage-hooks'; +import { useOutsideClick, useToggle } from '@rocket.chat/fuselage-hooks'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import type { Dispatch, FormEvent, ReactElement, RefObject, SetStateAction } from 'react'; import { useCallback, useRef } from 'react'; @@ -53,8 +53,8 @@ export type OptionProp = TitleOptionProp | CheckboxOptionProp; */ type DropDownProps = { dropdownOptions: OptionProp[]; - defaultTitle: TranslationKey; // For example: 'All rooms' - selectedOptionsTitle: TranslationKey; // For example: 'Rooms (3)' + defaultTitle: TranslationKey; + selectedOptionsTitle: TranslationKey; selectedOptions: OptionProp[]; setSelectedOptions: Dispatch>; customSetSelected: Dispatch>; @@ -70,7 +70,8 @@ export const MultiSelectCustom = ({ customSetSelected, searchBarText, }: DropDownProps): ReactElement => { - const reference = useRef(null); + const reference = useRef(null); + const target = useRef(null); const [collapsed, toggleCollapsed] = useToggle(false); const onClose = useCallback( @@ -85,6 +86,8 @@ export const MultiSelectCustom = ({ [toggleCollapsed], ); + useOutsideClick([target], onClose); + const onSelect = (item: OptionProp, e?: FormEvent): void => { e?.stopPropagation(); @@ -123,7 +126,7 @@ export const MultiSelectCustom = ({ maxCount={dropdownOptions.length} /> {collapsed && ( - + )} diff --git a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomAnchor.tsx b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomAnchor.tsx index 3debd4e0b638..9f6a15d38ba1 100644 --- a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomAnchor.tsx +++ b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomAnchor.tsx @@ -14,7 +14,7 @@ type MultiSelectCustomAnchorProps = { maxCount: number; } & ComponentProps; -const MultiSelectCustomAnchor = forwardRef(function MultiSelectCustomAnchor( +const MultiSelectCustomAnchor = forwardRef(function MultiSelectCustomAnchor( { onClick, collapsed, selectedOptionsCount, selectedOptionsTitle, defaultTitle, maxCount, ...props }, ref, ) { @@ -26,36 +26,42 @@ const MultiSelectCustomAnchor = forwardRef 0 && selectedOptionsCount !== maxCount - 1; return ( - + {isDirty ? `${t(selectedOptionsTitle)} (${selectedOptionsCount})` : t(defaultTitle)} + + ); }); diff --git a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomList.tsx b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomList.tsx index 5931ed4e4d4c..7e6bfdb9fee1 100644 --- a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomList.tsx +++ b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomList.tsx @@ -1,4 +1,4 @@ -import { Box, CheckBox, Icon, Option, TextInput, Tile } from '@rocket.chat/fuselage'; +import { Box, CheckBox, Icon, Option, SearchInput, Tile } from '@rocket.chat/fuselage'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { FormEvent } from 'react'; @@ -31,15 +31,14 @@ const MultiSelectCustomList = ({ {searchBarText && ( )} {filteredOptions.map((option) => ( @@ -53,7 +52,7 @@ const MultiSelectCustomList = ({ {t(option.text as TranslationKey)} - onSelected(option, e)} pi={0} /> + onSelected(option, e)} pi={0} name={option.text} /> )} diff --git a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomListWrapper.tsx b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomListWrapper.tsx index a3f542413a0a..c579480a3c66 100644 --- a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomListWrapper.tsx +++ b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomListWrapper.tsx @@ -1,19 +1,15 @@ import { Box } from '@rocket.chat/fuselage'; -import { useOutsideClick } from '@rocket.chat/fuselage-hooks'; -import type { ComponentProps } from 'react'; -import { forwardRef, useRef } from 'react'; +import { forwardRef, type ComponentProps } from 'react'; -const MultiSelectCustomListWrapper = forwardRef & { onClose: (e: MouseEvent) => void }>( - function MultiSelectCustomListWrapper({ children, onClose }) { - const target = useRef(null); - useOutsideClick([target], onClose); - - return ( - - {children} - - ); - }, -); +const MultiSelectCustomListWrapper = forwardRef>(function MultiSelectCustomListWrapper( + { children }, + ref, +) { + return ( + + {children} + + ); +}); export default MultiSelectCustomListWrapper; From 69a5213afca6f5fd1e7447367f38421dd9e368b8 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Wed, 30 Aug 2023 12:17:30 -0600 Subject: [PATCH 029/275] fix: Don't propagate Mailer error to Livechat offline form (#30152) --- .changeset/wild-spiders-smell.md | 5 +++++ apps/meteor/app/livechat/server/api/v1/offlineMessage.ts | 9 +++++---- apps/meteor/app/livechat/server/lib/Livechat.js | 4 +--- .../app/livechat/server/methods/sendOfflineMessage.ts | 4 ++-- apps/meteor/app/mailer/server/api.ts | 3 ++- apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json | 1 + 6 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 .changeset/wild-spiders-smell.md diff --git a/.changeset/wild-spiders-smell.md b/.changeset/wild-spiders-smell.md new file mode 100644 index 000000000000..9694d6259d3a --- /dev/null +++ b/.changeset/wild-spiders-smell.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed an issue where a mailer error was being sent to customers using offline message's form on Omnichannel instead of the translated one diff --git a/apps/meteor/app/livechat/server/api/v1/offlineMessage.ts b/apps/meteor/app/livechat/server/api/v1/offlineMessage.ts index 8302e014b894..b01e60d2265f 100644 --- a/apps/meteor/app/livechat/server/api/v1/offlineMessage.ts +++ b/apps/meteor/app/livechat/server/api/v1/offlineMessage.ts @@ -10,11 +10,12 @@ API.v1.addRoute( { async post() { const { name, email, message, department, host } = this.bodyParams; - if (!(await Livechat.sendOfflineMessage({ name, email, message, department, host }))) { - return API.v1.failure({ message: i18n.t('Error_sending_livechat_offline_message') }); + try { + await Livechat.sendOfflineMessage({ name, email, message, department, host }); + return API.v1.success({ message: i18n.t('Livechat_offline_message_sent') }); + } catch (e) { + return API.v1.failure(i18n.t('Error_sending_livechat_offline_message')); } - - return API.v1.success({ message: i18n.t('Livechat_offline_message_sent') }); }, }, ); diff --git a/apps/meteor/app/livechat/server/lib/Livechat.js b/apps/meteor/app/livechat/server/lib/Livechat.js index 3963f6ce2411..52138740e295 100644 --- a/apps/meteor/app/livechat/server/lib/Livechat.js +++ b/apps/meteor/app/livechat/server/lib/Livechat.js @@ -841,7 +841,7 @@ export const Livechat = { async sendOfflineMessage(data = {}) { if (!settings.get('Livechat_display_offline_form')) { - return false; + throw new Error('error-offline-form-disabled'); } const { message, name, email, department, host } = data; @@ -894,8 +894,6 @@ export const Livechat = { setImmediate(() => { callbacks.run('livechat.offlineMessage', data); }); - - return true; }, async notifyAgentStatusChanged(userId, status) { diff --git a/apps/meteor/app/livechat/server/methods/sendOfflineMessage.ts b/apps/meteor/app/livechat/server/methods/sendOfflineMessage.ts index c5c31951894e..9a475de5e32d 100644 --- a/apps/meteor/app/livechat/server/methods/sendOfflineMessage.ts +++ b/apps/meteor/app/livechat/server/methods/sendOfflineMessage.ts @@ -9,7 +9,7 @@ import { Livechat } from '../lib/Livechat'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { - 'livechat:sendOfflineMessage'(data: { name: string; email: string; message: string }): Promise; + 'livechat:sendOfflineMessage'(data: { name: string; email: string; message: string }): Promise; } } @@ -23,7 +23,7 @@ Meteor.methods({ message: String, }); - return Livechat.sendOfflineMessage(data); + await Livechat.sendOfflineMessage(data); }, }); diff --git a/apps/meteor/app/mailer/server/api.ts b/apps/meteor/app/mailer/server/api.ts index 957bbbe3cc51..b50fdfd26a2a 100644 --- a/apps/meteor/app/mailer/server/api.ts +++ b/apps/meteor/app/mailer/server/api.ts @@ -75,11 +75,12 @@ export const wrap = (html: string, data: { [key: string]: unknown } = {}): strin } if (!body) { - throw new Error('`body` is not set yet'); + throw new Error('error-email-body-not-initialized'); } return replaceEscaped(body.replace('{{body}}', html), data); }; + export const inlinecss = (html: string): string => { const css = settings.get('email_style'); return css ? juice.inlineContent(html, css) : html; diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 8db626688c16..762886f191ff 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -1957,6 +1957,7 @@ "error-duplicate-priority-name": "A priority with the same name already exists", "error-edit-permissions-not-allowed": "Editing permissions is not allowed", "error-email-domain-blacklisted": "The email domain is blacklisted", + "error-email-body-not-initialized": "Email body not initialized. Setup Email's Header & Footer on Email settings before sending rich emails", "error-email-send-failed": "Error trying to send email: {{message}}", "error-essential-app-disabled": "Error: a Rocket.Chat App that is essential for this is disabled. Please contact your administrator", "error-failed-to-delete-department": "Failed to delete department", From 1b42dfc6c1b1fbc7194f68de2bc06b0e3ccebf87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=87=E3=83=B4=E3=81=81=E3=82=93=E3=81=99?= <61188295+Dnouv@users.noreply.github.com> Date: Thu, 31 Aug 2023 01:35:23 +0530 Subject: [PATCH 030/275] feat: add roles bridge (#29968) Co-authored-by: Douglas Gubert <1810309+d-gubert@users.noreply.github.com> --- .changeset/fuzzy-glasses-divide.md | 5 +++ .../meteor/app/apps/server/bridges/bridges.js | 6 ++++ apps/meteor/app/apps/server/bridges/roles.ts | 33 +++++++++++++++++++ .../app/apps/server/converters/index.ts | 2 ++ .../app/apps/server/converters/roles.ts | 29 ++++++++++++++++ apps/meteor/ee/server/apps/orchestrator.js | 2 ++ apps/meteor/package.json | 2 +- yarn.lock | 10 +++--- 8 files changed, 83 insertions(+), 6 deletions(-) create mode 100644 .changeset/fuzzy-glasses-divide.md create mode 100644 apps/meteor/app/apps/server/bridges/roles.ts create mode 100644 apps/meteor/app/apps/server/converters/roles.ts diff --git a/.changeset/fuzzy-glasses-divide.md b/.changeset/fuzzy-glasses-divide.md new file mode 100644 index 000000000000..cf77bbde5507 --- /dev/null +++ b/.changeset/fuzzy-glasses-divide.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': minor +--- + +Added a new Roles bridge to RC Apps-Engine for reading and retrieving role details. diff --git a/apps/meteor/app/apps/server/bridges/bridges.js b/apps/meteor/app/apps/server/bridges/bridges.js index 6c67c116ba01..6d52a1d8e56d 100644 --- a/apps/meteor/app/apps/server/bridges/bridges.js +++ b/apps/meteor/app/apps/server/bridges/bridges.js @@ -15,6 +15,7 @@ import { AppMessageBridge } from './messages'; import { AppModerationBridge } from './moderation'; import { AppOAuthAppsBridge } from './oauthApps'; import { AppPersistenceBridge } from './persistence'; +import { AppRoleBridge } from './roles'; import { AppRoomBridge } from './rooms'; import { AppSchedulerBridge } from './scheduler'; import { AppSettingBridge } from './settings'; @@ -51,6 +52,7 @@ export class RealAppBridges extends AppBridges { this._internalFedBridge = new AppInternalFederationBridge(); this._moderationBridge = new AppModerationBridge(orch); this._threadBridge = new AppThreadBridge(orch); + this._roleBridge = new AppRoleBridge(orch); } getCommandBridge() { @@ -144,4 +146,8 @@ export class RealAppBridges extends AppBridges { getModerationBridge() { return this._moderationBridge; } + + getRoleBridge() { + return this._roleBridge; + } } diff --git a/apps/meteor/app/apps/server/bridges/roles.ts b/apps/meteor/app/apps/server/bridges/roles.ts new file mode 100644 index 000000000000..f973b7f49ed2 --- /dev/null +++ b/apps/meteor/app/apps/server/bridges/roles.ts @@ -0,0 +1,33 @@ +import type { IRole } from '@rocket.chat/apps-engine/definition/roles'; +import { RoleBridge } from '@rocket.chat/apps-engine/server/bridges'; +import { Roles } from '@rocket.chat/models'; + +import type { AppServerOrchestrator } from '../../../../ee/server/apps/orchestrator'; + +export class AppRoleBridge extends RoleBridge { + constructor(private readonly orch: AppServerOrchestrator) { + super(); + } + + protected async getOneByIdOrName(idOrName: IRole['id'] | IRole['name'], appId: string): Promise { + this.orch.debugLog(`The App ${appId} is getting the roleByIdOrName: "${idOrName}"`); + + const role = await Roles.findOneByIdOrName(idOrName); + return this.orch.getConverters()?.get('roles').convertRole(role); + } + + protected async getCustomRoles(appId: string): Promise> { + this.orch.debugLog(`The App ${appId} is getting the custom roles`); + + const cursor = Roles.findCustomRoles(); + + const roles: IRole[] = []; + + for await (const role of cursor) { + const convRole = await this.orch.getConverters()?.get('roles').convertRole(role); + roles.push(convRole); + } + + return roles; + } +} diff --git a/apps/meteor/app/apps/server/converters/index.ts b/apps/meteor/app/apps/server/converters/index.ts index 39a6a260f69f..96716af03ca7 100644 --- a/apps/meteor/app/apps/server/converters/index.ts +++ b/apps/meteor/app/apps/server/converters/index.ts @@ -1,5 +1,6 @@ import { AppDepartmentsConverter } from './departments'; import { AppMessagesConverter } from './messages'; +import { AppRolesConverter } from './roles'; import { AppRoomsConverter } from './rooms'; import { AppSettingsConverter } from './settings'; import { AppUploadsConverter } from './uploads'; @@ -16,4 +17,5 @@ export { AppDepartmentsConverter, AppUploadsConverter, AppVisitorsConverter, + AppRolesConverter, }; diff --git a/apps/meteor/app/apps/server/converters/roles.ts b/apps/meteor/app/apps/server/converters/roles.ts new file mode 100644 index 000000000000..4ac1f3956420 --- /dev/null +++ b/apps/meteor/app/apps/server/converters/roles.ts @@ -0,0 +1,29 @@ +import type { IRole as AppsEngineRole } from '@rocket.chat/apps-engine/definition/roles'; +import type { IRole } from '@rocket.chat/core-typings'; +import { Roles } from '@rocket.chat/models'; + +import { transformMappedData } from '../../../../ee/lib/misc/transformMappedData'; + +export class AppRolesConverter { + async convertById(roleId: string): Promise { + const role = await Roles.findOneById(roleId); + + if (!role) { + return; + } + return this.convertRole(role); + } + + async convertRole(role: IRole): Promise { + const map = { + id: '_id', + name: 'name', + description: 'description', + mandatory2fa: 'mandatory2fa', + protected: 'protected', + scope: 'scope', + }; + + return (await transformMappedData(role, map)) as unknown as AppsEngineRole; + } +} diff --git a/apps/meteor/ee/server/apps/orchestrator.js b/apps/meteor/ee/server/apps/orchestrator.js index 4ce5de7d7766..c21508cbc626 100644 --- a/apps/meteor/ee/server/apps/orchestrator.js +++ b/apps/meteor/ee/server/apps/orchestrator.js @@ -15,6 +15,7 @@ import { AppDepartmentsConverter, AppUploadsConverter, AppVisitorsConverter, + AppRolesConverter, } from '../../../app/apps/server/converters'; import { AppThreadsConverter } from '../../../app/apps/server/converters/threads'; import { settings, settingsRegistry } from '../../../app/settings/server'; @@ -66,6 +67,7 @@ export class AppServerOrchestrator { this._converters.set('uploads', new AppUploadsConverter(this)); this._converters.set('videoConferences', new AppVideoConferencesConverter()); this._converters.set('threads', new AppThreadsConverter(this)); + this._converters.set('roles', new AppRolesConverter(this)); this._bridges = new RealAppBridges(this); diff --git a/apps/meteor/package.json b/apps/meteor/package.json index dd1af33f6b5c..0e3167a0886c 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -225,7 +225,7 @@ "@rocket.chat/account-utils": "workspace:^", "@rocket.chat/agenda": "workspace:^", "@rocket.chat/api-client": "workspace:^", - "@rocket.chat/apps-engine": "1.41.0-alpha.295", + "@rocket.chat/apps-engine": "1.41.0-alpha.305", "@rocket.chat/base64": "workspace:^", "@rocket.chat/cas-validate": "workspace:^", "@rocket.chat/core-services": "workspace:^", diff --git a/yarn.lock b/yarn.lock index aa54f641b42b..2cb0275d9a31 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7183,9 +7183,9 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/apps-engine@npm:1.41.0-alpha.295": - version: 1.41.0-alpha.295 - resolution: "@rocket.chat/apps-engine@npm:1.41.0-alpha.295" +"@rocket.chat/apps-engine@npm:1.41.0-alpha.305": + version: 1.41.0-alpha.305 + resolution: "@rocket.chat/apps-engine@npm:1.41.0-alpha.305" dependencies: adm-zip: ^0.5.9 cryptiles: ^4.1.3 @@ -7197,7 +7197,7 @@ __metadata: vm2: ^3.9.19 peerDependencies: "@rocket.chat/ui-kit": "*" - checksum: 14a7deb978460c5e615fa0103001ebee04b9db0823b4c8bbe1447ee94195233e8cfbb09ef42405249a978a2418f38ce2f55a546138735a69e2ecafc36a866ea7 + checksum: 83ec73dac6e1f25722080cf32143ada914c4adb9aef8ebf770af13a5456cef1c81d1a9eedc4063549b8105277f2254d6c307c3c0c5f6ed7f99233a2d464bf6da languageName: node linkType: hard @@ -7988,7 +7988,7 @@ __metadata: "@rocket.chat/account-utils": "workspace:^" "@rocket.chat/agenda": "workspace:^" "@rocket.chat/api-client": "workspace:^" - "@rocket.chat/apps-engine": 1.41.0-alpha.295 + "@rocket.chat/apps-engine": 1.41.0-alpha.305 "@rocket.chat/base64": "workspace:^" "@rocket.chat/cas-validate": "workspace:^" "@rocket.chat/core-services": "workspace:^" From 781ed63d0a2ad09eeb7e31579e3165fd0ff68c4b Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 30 Aug 2023 17:58:25 -0300 Subject: [PATCH 031/275] chore: PasswordVerifier spec (#29995) Co-authored-by: juliajforesti --- .../account/profile/AccountProfileForm.tsx | 20 ++- .../rocketchat-i18n/i18n/en.i18n.json | 2 + packages/ui-client/jest.config.ts | 4 +- packages/ui-client/package.json | 1 + .../PasswordVerifier.stories.tsx | 48 ++++++ .../PasswordVerifier/PasswordVerifier.tsx | 47 +++--- .../PasswordVerifierCorrect.tsx | 5 - .../PasswordVerifierInvalid.tsx | 5 - .../PasswordVerifier/PasswordVerifierItem.tsx | 50 +++++-- .../PasswordVerifiers.spec.tsx | 140 ++++++++++++++++++ packages/ui-client/src/components/index.ts | 1 + .../src/hooks/useValidatePassword.spec.ts | 66 +++++++++ .../src/hooks/useValidatePassword.ts | 8 + .../src/hooks/useVerifyPassword.ts | 14 +- .../web-ui-registration/src/RegisterForm.tsx | 22 ++- .../src/ResetPassword/ResetPasswordPage.tsx | 30 +++- yarn.lock | 3 +- 17 files changed, 402 insertions(+), 64 deletions(-) create mode 100644 packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.stories.tsx delete mode 100644 packages/ui-client/src/components/PasswordVerifier/PasswordVerifierCorrect.tsx delete mode 100644 packages/ui-client/src/components/PasswordVerifier/PasswordVerifierInvalid.tsx create mode 100644 packages/ui-client/src/components/PasswordVerifier/PasswordVerifiers.spec.tsx create mode 100644 packages/ui-client/src/hooks/useValidatePassword.spec.ts create mode 100644 packages/ui-client/src/hooks/useValidatePassword.ts diff --git a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx index 34a1c029e65d..14540220b7e4 100644 --- a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx +++ b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx @@ -1,7 +1,7 @@ import type { IUser } from '@rocket.chat/core-typings'; import { Field, FieldGroup, TextInput, TextAreaInput, Box, Icon, PasswordInput, Button } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; -import { CustomFieldsForm, PasswordVerifier } from '@rocket.chat/ui-client'; +import { CustomFieldsForm, PasswordVerifier, useValidatePassword } from '@rocket.chat/ui-client'; import { useAccountsCustomFields, useToastMessageDispatch, @@ -91,6 +91,8 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle } }; + const passwordIsValid = useValidatePassword(password); + // FIXME: replace to endpoint const updateOwnBasicInfo = useMethod('saveUserProfile'); @@ -128,6 +130,7 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle const emailId = useUniqueId(); const passwordId = useUniqueId(); const confirmPasswordId = useUniqueId(); + const passwordVerifierId = useUniqueId(); return ( @@ -292,13 +295,23 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle (!passwordIsValid ? t('Password_must_meet_the_complexity_requirements') : true), + })} error={errors.password?.message} flexGrow={1} addon={} disabled={!allowPasswordChange} + aria-describedby={passwordVerifierId} + aria-invalid={errors.password ? 'true' : 'false'} /> + {errors?.password && ( + + {errors.password.message} + + )} + {allowPasswordChange && } {t('Confirm_password')} @@ -311,7 +324,7 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle error={errors.confirmationPassword?.message} flexGrow={1} addon={} - disabled={!allowPasswordChange} + disabled={!allowPasswordChange || !passwordIsValid} aria-required={password !== '' ? 'true' : 'false'} aria-invalid={errors.confirmationPassword ? 'true' : 'false'} aria-describedby={`${confirmPasswordId}-error ${confirmPasswordId}-hint`} @@ -323,7 +336,6 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle {errors.confirmationPassword.message} )} - {allowPasswordChange && } {customFieldsMetadata && } diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 762886f191ff..6edabf409f00 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -3935,6 +3935,8 @@ "Password_History_Amount_Description": "Amount of most recently used passwords to prevent users from reusing.", "Password_must_have": "Password must have:", "Password_Policy": "Password Policy", + "Password_Policy_Aria_Description": "Below it's listed the password requirement verifications", + "Password_must_meet_the_complexity_requirements": "Password must meet the complexity requirements.", "Password_to_access": "Password to access", "Passwords_do_not_match": "Passwords do not match", "Past_Chats": "Past Chats", diff --git a/packages/ui-client/jest.config.ts b/packages/ui-client/jest.config.ts index 636d50c6a980..d5dd6be2fd45 100644 --- a/packages/ui-client/jest.config.ts +++ b/packages/ui-client/jest.config.ts @@ -1,6 +1,5 @@ export default { errorOnDeprecated: true, - testEnvironment: 'jsdom', modulePathIgnorePatterns: ['/dist/'], testMatch: ['/src/**/**.spec.[jt]s?(x)'], @@ -22,4 +21,7 @@ export default { '\\.css$': 'identity-obj-proxy', '^react($|/.+)': '/../../node_modules/react$1', }, + collectCoverage: true, + collectCoverageFrom: ['src/**/*.{ts,tsx}'], + setupFilesAfterEnv: ['@testing-library/jest-dom/extend-expect'], }; diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 21ebbd9a58b7..911953307fad 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -21,6 +21,7 @@ "@storybook/react": "~6.5.16", "@storybook/testing-library": "~0.0.13", "@swc/jest": "^0.2.26", + "@testing-library/jest-dom": "~5.16.5", "@testing-library/react": "^12.1.2", "@testing-library/react-hooks": "^8.0.1", "@types/babel__core": "~7.20.1", diff --git a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.stories.tsx b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.stories.tsx new file mode 100644 index 000000000000..fe3be924ab18 --- /dev/null +++ b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.stories.tsx @@ -0,0 +1,48 @@ +import { mockAppRoot } from '@rocket.chat/mock-providers'; +import type { ComponentMeta, ComponentStory } from '@storybook/react'; + +import { PasswordVerifier } from './PasswordVerifier'; + +type Response = { + enabled: boolean; + policy: [ + name: string, + value?: + | { + [x: string]: number; + } + | undefined, + ][]; +}; + +export default { + title: 'Components/PasswordVerifier', + component: PasswordVerifier, +} as ComponentMeta; + +const response: Response = { + enabled: true, + policy: [ + ['get-password-policy-minLength', { minLength: 10 }], + ['get-password-policy-forbidRepeatingCharactersCount', { maxRepeatingChars: 3 }], + ['get-password-policy-mustContainAtLeastOneLowercase'], + ['get-password-policy-mustContainAtLeastOneUppercase'], + ['get-password-policy-mustContainAtLeastOneNumber'], + ['get-password-policy-mustContainAtLeastOneSpecialCharacter'], + ], +}; + +const Wrapper = mockAppRoot() + .withEndpoint('GET', '/v1/pw.getPolicy', () => response) + .build(); + +export const Default: ComponentStory = (args) => ( + + + +); + +Default.storyName = 'PasswordVerifier'; +Default.args = { + password: 'asd', +}; diff --git a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.tsx b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.tsx index a9c17f7063db..465d82725d87 100644 --- a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.tsx +++ b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.tsx @@ -1,37 +1,44 @@ -import { Box } from '@rocket.chat/fuselage'; +import { Box, Skeleton } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useVerifyPassword } from '@rocket.chat/ui-contexts'; import { useTranslation } from 'react-i18next'; -import { PasswordVerifierItemCorrect } from './PasswordVerifierCorrect'; -import { PasswordVerifierItemInvalid } from './PasswordVerifierInvalid'; +import { PasswordVerifierItem } from './PasswordVerifierItem'; type PasswordVerifierProps = { password: string; + id?: string; }; -export const PasswordVerifier = ({ password }: PasswordVerifierProps) => { +export const PasswordVerifier = ({ password, id }: PasswordVerifierProps) => { const { t } = useTranslation(); + const uniqueId = useUniqueId(); - const passwordVerifications = useVerifyPassword(password); + const { data: passwordVerifications, isLoading } = useVerifyPassword(password); - if (!passwordVerifications.length) { - return <>; + if (isLoading) { + return ; + } + + if (!passwordVerifications?.length) { + return null; } return ( - - - {t('Password_must_have')} - - - {passwordVerifications.map(({ isValid, limit, name }) => - isValid ? ( - - ) : ( - - ), - )} + <> + + + + {t('Password_must_have')} + + + {passwordVerifications.map(({ isValid, limit, name }) => ( + + ))} + - + ); }; diff --git a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifierCorrect.tsx b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifierCorrect.tsx deleted file mode 100644 index 9ce1b7b6c689..000000000000 --- a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifierCorrect.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { PasswordVerifierItem } from './PasswordVerifierItem'; - -export const PasswordVerifierItemCorrect = ({ text }: { text: string }) => ( - -); diff --git a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifierInvalid.tsx b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifierInvalid.tsx deleted file mode 100644 index e47329b4d5a8..000000000000 --- a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifierInvalid.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import { PasswordVerifierItem } from './PasswordVerifierItem'; - -export const PasswordVerifierItemInvalid = ({ text }: { text: string }) => ( - -); diff --git a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifierItem.tsx b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifierItem.tsx index 97091fe03771..97499c0eaf73 100644 --- a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifierItem.tsx +++ b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifierItem.tsx @@ -1,16 +1,42 @@ import { Box, Icon } from '@rocket.chat/fuselage'; +import { AllHTMLAttributes, ComponentProps } from 'react'; + +const variants: { + [key: string]: { + icon: ComponentProps['name']; + color: string; + }; +} = { + success: { + icon: 'success-circle', + color: 'status-font-on-success', + }, + error: { + icon: 'error-circle', + color: 'status-font-on-danger', + }, +}; export const PasswordVerifierItem = ({ text, - color, - icon, -}: { - text: string; - color: 'status-font-on-success' | 'status-font-on-danger'; - icon: 'success-circle' | 'error-circle'; -}) => ( - - - {text} - -); + isValid, + ...props +}: { text: string; isValid: boolean } & Omit, 'is'>) => { + const { icon, color } = variants[isValid ? 'success' : 'error']; + return ( + + + {text} + + ); +}; diff --git a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifiers.spec.tsx b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifiers.spec.tsx new file mode 100644 index 000000000000..95614491c3bd --- /dev/null +++ b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifiers.spec.tsx @@ -0,0 +1,140 @@ +import { mockAppRoot } from '@rocket.chat/mock-providers'; +import { passwordVerificationsTemplate } from '@rocket.chat/ui-contexts/dist/hooks/useVerifyPassword'; +import { render, waitFor } from '@testing-library/react'; + +import { PasswordVerifier } from './PasswordVerifier'; + +type Response = { + enabled: boolean; + policy: [ + name: string, + value?: + | { + [x: string]: number; + } + | undefined, + ][]; +}; + +jest.mock('react-i18next', () => ({ + useTranslation: () => ({ + t: (str: string) => str, + i18n: { + changeLanguage: () => new Promise(() => undefined), + }, + }), +})); + +afterEach(() => { + // restore the spy created with spyOn + jest.restoreAllMocks(); +}); + +it('should render no policy if its disabled ', () => { + const response: Response = { + enabled: false, + policy: [], + }; + + const { queryByRole } = render(, { + wrapper: mockAppRoot() + .withEndpoint('GET', '/v1/pw.getPolicy', () => response) + .build(), + }); + + expect(queryByRole('list')).toBeNull(); +}); + +it('should render no policy if its enabled but empty', async () => { + const response: Response = { + enabled: true, + policy: [], + }; + + const { queryByRole, queryByTestId } = render(, { + wrapper: mockAppRoot() + .withEndpoint('GET', '/v1/pw.getPolicy', () => response) + .build(), + }); + + await waitFor(() => { + expect(queryByTestId('password-verifier-skeleton')).toBeNull(); + }); + expect(queryByRole('list')).toBeNull(); +}); + +it('should render policy list if its enabled and not empty', async () => { + const response: Response = { + enabled: true, + policy: [['get-password-policy-minLength', { minLength: 10 }]], + }; + + const { queryByRole, queryByTestId } = render(, { + wrapper: mockAppRoot() + .withEndpoint('GET', '/v1/pw.getPolicy', () => response) + .build(), + }); + + await waitFor(() => { + expect(queryByTestId('password-verifier-skeleton')).toBeNull(); + }); + + expect(queryByRole('list')).toBeVisible(); + expect(queryByRole('listitem')).toBeVisible(); +}); + +it('should render all the policies when all policies are enabled', async () => { + const response: Response = { + enabled: true, + policy: Object.keys(passwordVerificationsTemplate).map((item) => [item]), + }; + + const { queryByTestId, queryAllByRole } = render(, { + wrapper: mockAppRoot() + .withEndpoint('GET', '/v1/pw.getPolicy', () => response) + .build(), + }); + + await waitFor(() => { + expect(queryByTestId('password-verifier-skeleton')).toBeNull(); + }); + + expect(queryAllByRole('listitem').length).toEqual(response.policy.length); +}); + +it("should render policy as invalid if password doesn't match the requirements", async () => { + const response: Response = { + enabled: true, + policy: [['get-password-policy-minLength', { minLength: 10 }]], + }; + + const { queryByTestId, getByRole } = render(, { + wrapper: mockAppRoot() + .withEndpoint('GET', '/v1/pw.getPolicy', () => response) + .build(), + }); + + await waitFor(() => { + expect(queryByTestId('password-verifier-skeleton')).toBeNull(); + }); + + expect(getByRole('listitem', { name: 'get-password-policy-minLength-label' })).toHaveAttribute('aria-invalid', 'true'); +}); + +it('should render policy as valid if password matches the requirements', async () => { + const response: Response = { + enabled: true, + policy: [['get-password-policy-minLength', { minLength: 2 }]], + }; + + const { queryByTestId, getByRole } = render(, { + wrapper: mockAppRoot() + .withEndpoint('GET', '/v1/pw.getPolicy', () => response) + .build(), + }); + + await waitFor(() => { + expect(queryByTestId('password-verifier-skeleton')).toBeNull(); + }); + expect(getByRole('listitem', { name: 'get-password-policy-minLength-label' })).toHaveAttribute('aria-invalid', 'false'); +}); diff --git a/packages/ui-client/src/components/index.ts b/packages/ui-client/src/components/index.ts index 3bf9ffe819b5..6448f37b3e68 100644 --- a/packages/ui-client/src/components/index.ts +++ b/packages/ui-client/src/components/index.ts @@ -3,6 +3,7 @@ export * from './ExternalLink'; export * from './DotLeader'; export * from './CustomFieldsForm'; export * from './PasswordVerifier/PasswordVerifier'; +export * from '../hooks/useValidatePassword'; export { default as TextSeparator } from './TextSeparator'; export * from './TooltipComponent'; export * as UserStatus from './UserStatus'; diff --git a/packages/ui-client/src/hooks/useValidatePassword.spec.ts b/packages/ui-client/src/hooks/useValidatePassword.spec.ts new file mode 100644 index 000000000000..5d1c5a635c52 --- /dev/null +++ b/packages/ui-client/src/hooks/useValidatePassword.spec.ts @@ -0,0 +1,66 @@ +import { mockAppRoot } from '@rocket.chat/mock-providers'; +import { renderHook } from '@testing-library/react-hooks'; + +import { useValidatePassword } from './useValidatePassword'; + +type Response = { + enabled: boolean; + policy: [ + name: string, + value?: + | { + [x: string]: number; + } + | undefined, + ][]; +}; + +it("should return `false` if password doesn't match all the requirements", async () => { + const response: Response = { + enabled: true, + policy: [['get-password-policy-minLength', { minLength: 8 }]], + }; + + const { result, waitForValueToChange } = renderHook(async () => useValidatePassword('secret'), { + wrapper: mockAppRoot() + .withEndpoint('GET', '/v1/pw.getPolicy', () => response) + .build(), + }); + + await waitForValueToChange(() => result.current); + const res = await result.current; + expect(res).toBeFalsy(); +}); + +it('should return `true` if password matches all the requirements', async () => { + const response: Response = { + enabled: true, + policy: [['get-password-policy-minLength', { minLength: 8 }]], + }; + + const { result, waitForValueToChange } = renderHook(async () => useValidatePassword('secret-password'), { + wrapper: mockAppRoot() + .withEndpoint('GET', '/v1/pw.getPolicy', () => response) + .build(), + }); + + await waitForValueToChange(() => result.current); + const res = await result.current; + expect(res).toBeTruthy(); +}); + +it('should return `undefined` if password validation is still loading', async () => { + const response: Response = { + enabled: true, + policy: [['get-password-policy-minLength', { minLength: 8 }]], + }; + + const { result } = renderHook(async () => useValidatePassword('secret-password'), { + wrapper: mockAppRoot() + .withEndpoint('GET', '/v1/pw.getPolicy', () => response) + .build(), + }); + + const res = await result.current; + expect(res).toBeUndefined(); +}); diff --git a/packages/ui-client/src/hooks/useValidatePassword.ts b/packages/ui-client/src/hooks/useValidatePassword.ts new file mode 100644 index 000000000000..3402bbaf8435 --- /dev/null +++ b/packages/ui-client/src/hooks/useValidatePassword.ts @@ -0,0 +1,8 @@ +import { useVerifyPassword } from '@rocket.chat/ui-contexts'; +import { useMemo } from 'react'; + +export const useValidatePassword = (password: string) => { + const { data: passwordVerifications, isLoading } = useVerifyPassword(password); + + return useMemo(() => (isLoading ? undefined : passwordVerifications.every(({ isValid }) => isValid)), [isLoading, passwordVerifications]); +}; diff --git a/packages/ui-contexts/src/hooks/useVerifyPassword.ts b/packages/ui-contexts/src/hooks/useVerifyPassword.ts index 10a43ee65152..71985e44887f 100644 --- a/packages/ui-contexts/src/hooks/useVerifyPassword.ts +++ b/packages/ui-contexts/src/hooks/useVerifyPassword.ts @@ -2,7 +2,7 @@ import { useCallback, useMemo } from 'react'; import { usePasswordPolicy } from './usePasswordPolicy'; -const passwordVerificationsTemplate: Record boolean> = { +export const passwordVerificationsTemplate: Record boolean> = { 'get-password-policy-minLength': (password: string, minLength?: number) => Boolean(minLength && password.length >= minLength), 'get-password-policy-maxLength': (password: string, maxLength?: number) => Boolean(maxLength && password.length <= maxLength), 'get-password-policy-forbidRepeatingCharactersCount': (password: string, maxRepeatingChars?: number) => { @@ -54,10 +54,16 @@ export const useVerifyPasswordByPolices = (policies?: PasswordPolicies) => { ); }; -export const useVerifyPassword = (password: string): PasswordVerifications => { - const { data } = usePasswordPolicy(); +export const useVerifyPassword = (password: string): { data: PasswordVerifications; isLoading: boolean } => { + const { data, isLoading } = usePasswordPolicy(); const validator = useVerifyPasswordByPolices((data?.enabled && data?.policy) || undefined); - return useMemo(() => validator(password), [password, validator]); + return useMemo( + () => ({ + data: validator(password), + isLoading, + }), + [password, validator, isLoading], + ); }; diff --git a/packages/web-ui-registration/src/RegisterForm.tsx b/packages/web-ui-registration/src/RegisterForm.tsx index fcba7c9c1820..db3879d6e027 100644 --- a/packages/web-ui-registration/src/RegisterForm.tsx +++ b/packages/web-ui-registration/src/RegisterForm.tsx @@ -1,7 +1,8 @@ +/* eslint-disable complexity */ import { FieldGroup, TextInput, Field, PasswordInput, ButtonGroup, Button, TextAreaInput, Callout } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { Form, ActionLink } from '@rocket.chat/layout'; -import { CustomFieldsForm, PasswordVerifier } from '@rocket.chat/ui-client'; +import { CustomFieldsForm, PasswordVerifier, useValidatePassword } from '@rocket.chat/ui-client'; import { useAccountsCustomFields, useSetting, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import { useState } from 'react'; @@ -33,6 +34,8 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo const passwordConfirmationPlaceholder = String(useSetting('Accounts_ConfirmPasswordPlaceholder')); const formLabelId = useUniqueId(); + const passwordId = useUniqueId(); + const passwordVerifierId = useUniqueId(); const registerUser = useRegisterMethod(); const customFields = useAccountsCustomFields(); @@ -49,7 +52,10 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo clearErrors, control, formState: { errors }, - } = useForm(); + } = useForm({ mode: 'onBlur' }); + + const password = watch('password'); + const passwordIsValid = useValidatePassword(password); const handleRegister = async ({ password, passwordConfirmation: _, ...formData }: LoginRegisterPayload) => { registerUser.mutate( @@ -155,13 +161,21 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo (!passwordIsValid ? t('Password_must_meet_the_complexity_requirements') : true), })} error={errors.password && (errors.password?.message || t('registration.component.form.requiredField'))} aria-invalid={errors.password ? 'true' : undefined} - id='password' + id={passwordId} placeholder={passwordPlaceholder || t('Create_a_password')} + aria-describedby={passwordVerifierId} /> + {errors?.password && ( + + {errors.password.message} + + )} + {requiresPasswordConfirmation && ( )} @@ -183,7 +198,6 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo {errors.passwordConfirmation?.type === 'required' && requiresPasswordConfirmation && ( {t('registration.component.form.requiredField')} )} - {manuallyApproveNewUsersRequired && ( diff --git a/packages/web-ui-registration/src/ResetPassword/ResetPasswordPage.tsx b/packages/web-ui-registration/src/ResetPassword/ResetPasswordPage.tsx index 2acbf30929a8..d3a3e6fa7413 100644 --- a/packages/web-ui-registration/src/ResetPassword/ResetPasswordPage.tsx +++ b/packages/web-ui-registration/src/ResetPassword/ResetPasswordPage.tsx @@ -1,6 +1,7 @@ import { Button, Field, Modal, PasswordInput } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { Form } from '@rocket.chat/layout'; -import { PasswordVerifier } from '@rocket.chat/ui-client'; +import { PasswordVerifier, useValidatePassword } from '@rocket.chat/ui-client'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useSetting, useRouter, useRouteParameter, useUser, useMethod, useTranslation, useLoginWithToken } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -20,6 +21,9 @@ const ResetPasswordPage = (): ReactElement => { const resetPassword = useMethod('resetPassword'); const token = useRouteParameter('token'); + const passwordId = useUniqueId(); + const passwordVerifierId = useUniqueId(); + const requiresPasswordConfirmation = useSetting('Accounts_RequirePasswordConfirmation'); const router = useRouter(); @@ -32,16 +36,18 @@ const ResetPasswordPage = (): ReactElement => { register, handleSubmit, setError, - formState: { errors }, - formState, + formState: { errors, isValid }, watch, } = useForm<{ password: string; passwordConfirmation: string; }>({ - mode: 'onChange', + mode: 'onBlur', }); + const password = watch('password'); + const passwordIsValid = useValidatePassword(password); + const submit = handleSubmit(async (data) => { try { if (token) { @@ -70,37 +76,45 @@ const ResetPasswordPage = (): ReactElement => { (!passwordIsValid ? t('Password_must_meet_the_complexity_requirements') : true), })} error={errors.password?.message} aria-invalid={errors.password ? 'true' : 'false'} - id='password' + id={passwordId} placeholder={t('Create_a_password')} name='password' autoComplete='off' + aria-describedby={passwordVerifierId} /> + {errors?.password && ( + + {errors.password.message} + + )} + {requiresPasswordConfirmation && ( watch('password') === val, + validate: (val: string) => password === val, })} error={errors.passwordConfirmation?.type === 'validate' ? t('registration.component.form.invalidConfirmPass') : undefined} aria-invalid={errors.passwordConfirmation ? 'true' : false} id='passwordConfirmation' placeholder={t('Confirm_password')} + disabled={!passwordIsValid} /> )} {errors && {errors.password?.message}} - - diff --git a/yarn.lock b/yarn.lock index 2cb0275d9a31..1a0da24949c9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8853,6 +8853,7 @@ __metadata: "@storybook/react": ~6.5.16 "@storybook/testing-library": ~0.0.13 "@swc/jest": ^0.2.26 + "@testing-library/jest-dom": ~5.16.5 "@testing-library/react": ^12.1.2 "@testing-library/react-hooks": ^8.0.1 "@types/babel__core": ~7.20.1 @@ -10812,7 +10813,7 @@ __metadata: languageName: node linkType: hard -"@testing-library/jest-dom@npm:^5.16.5": +"@testing-library/jest-dom@npm:^5.16.5, @testing-library/jest-dom@npm:~5.16.5": version: 5.16.5 resolution: "@testing-library/jest-dom@npm:5.16.5" dependencies: From 0f56aacc4db9ddbb9a9de1f28f261d359870fec4 Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Wed, 30 Aug 2023 18:44:13 -0300 Subject: [PATCH 032/275] chore(eslint): Update ESLint configuration (#30225) --- .changeset/yellow-schools-tell.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/yellow-schools-tell.md diff --git a/.changeset/yellow-schools-tell.md b/.changeset/yellow-schools-tell.md new file mode 100644 index 000000000000..c1040fa0856a --- /dev/null +++ b/.changeset/yellow-schools-tell.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/eslint-config': minor +--- + +Unpublished changes in ESLint config From bcf147f5153671ceb93f085cef6d5f0c54e46161 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Wed, 30 Aug 2023 21:55:30 +0000 Subject: [PATCH 033/275] Bump 6.3.3 --- .changeset/bump-patch-1693432529972.md | 5 +++++ yarn.lock | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/bump-patch-1693432529972.md diff --git a/.changeset/bump-patch-1693432529972.md b/.changeset/bump-patch-1693432529972.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1693432529972.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/yarn.lock b/yarn.lock index 9b6a545ec9fe..251222652634 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9898,9 +9898,9 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.1 + "@rocket.chat/ui-contexts": 1.0.2 "@rocket.chat/ui-kit": "*" - "@rocket.chat/ui-video-conf": 1.0.1 + "@rocket.chat/ui-video-conf": 1.0.2 "@tanstack/react-query": "*" react: "*" react-dom: "*" @@ -9982,14 +9982,14 @@ __metadata: ts-jest: ~29.0.5 typescript: ~5.1.3 peerDependencies: - "@rocket.chat/core-typings": 6.3.1 + "@rocket.chat/core-typings": 6.3.2 "@rocket.chat/css-in-js": "*" "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-tokens": "*" "@rocket.chat/message-parser": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-client": 1.0.1 - "@rocket.chat/ui-contexts": 1.0.1 + "@rocket.chat/ui-client": 1.0.2 + "@rocket.chat/ui-contexts": 1.0.2 katex: "*" react: "*" languageName: unknown @@ -11048,7 +11048,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 1.0.1 + "@rocket.chat/ui-contexts": 1.0.2 react: ~17.0.2 languageName: unknown linkType: soft @@ -11202,7 +11202,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.1 + "@rocket.chat/ui-contexts": 1.0.2 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -11268,7 +11268,7 @@ __metadata: typescript: ~5.1.3 peerDependencies: "@rocket.chat/layout": "*" - "@rocket.chat/ui-contexts": 1.0.1 + "@rocket.chat/ui-contexts": 1.0.2 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From 7e0f76b89b0b532b23a1caf3801838bdaf4ea95e Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Wed, 30 Aug 2023 20:36:09 -0600 Subject: [PATCH 034/275] refactor: Move `queueWorker` logic to CE & add it to omnichannel service (#29721) --- apps/meteor/app/livechat/lib/inquiries.ts | 9 +- .../app/livechat/server/lib/RoutingManager.ts | 8 +- apps/meteor/app/livechat/server/startup.ts | 2 +- .../livechat-enterprise/server/lib/Helper.ts | 31 ---- .../server/lib/LivechatEnterprise.ts | 127 +--------------- .../livechat-enterprise/server/lib/logger.ts | 1 - .../server/services/omnichannel/logger.ts | 3 + .../server/services/omnichannel/queue.ts | 142 ++++++++++++++++++ .../server/services/omnichannel/service.ts | 21 +++ packages/core-services/src/index.ts | 1 + .../src/types/IOmnichannelService.ts | 6 +- .../core-typings/src/omnichannel/index.ts | 1 + .../core-typings/src/omnichannel/queue.ts | 5 + 13 files changed, 191 insertions(+), 166 deletions(-) create mode 100644 apps/meteor/server/services/omnichannel/logger.ts create mode 100644 apps/meteor/server/services/omnichannel/queue.ts create mode 100644 packages/core-typings/src/omnichannel/queue.ts diff --git a/apps/meteor/app/livechat/lib/inquiries.ts b/apps/meteor/app/livechat/lib/inquiries.ts index dddf32ee5467..488151aa4166 100644 --- a/apps/meteor/app/livechat/lib/inquiries.ts +++ b/apps/meteor/app/livechat/lib/inquiries.ts @@ -6,13 +6,16 @@ type ReturnType = | { priorityWeight: SortOrder; ts: SortOrder; + _updatedAt: SortOrder; } | { estimatedWaitingTimeQueue: SortOrder; ts: SortOrder; + _updatedAt: SortOrder; } | { ts: SortOrder; + _updatedAt: SortOrder; }; export const getOmniChatSortQuery = ( @@ -20,11 +23,11 @@ export const getOmniChatSortQuery = ( ): ReturnType => { switch (sortByMechanism) { case OmnichannelSortingMechanismSettingType.Priority: - return { priorityWeight: 1, ts: 1 }; + return { priorityWeight: 1, ts: 1, _updatedAt: -1 }; case OmnichannelSortingMechanismSettingType.SLAs: - return { estimatedWaitingTimeQueue: 1, ts: 1 }; + return { estimatedWaitingTimeQueue: 1, ts: 1, _updatedAt: -1 }; case OmnichannelSortingMechanismSettingType.Timestamp: default: - return { ts: 1 }; + return { ts: 1, _updatedAt: -1 }; } }; diff --git a/apps/meteor/app/livechat/server/lib/RoutingManager.ts b/apps/meteor/app/livechat/server/lib/RoutingManager.ts index ebbd931c1b2b..0e975ca06763 100644 --- a/apps/meteor/app/livechat/server/lib/RoutingManager.ts +++ b/apps/meteor/app/livechat/server/lib/RoutingManager.ts @@ -1,4 +1,4 @@ -import { Message } from '@rocket.chat/core-services'; +import { Message, Omnichannel } from '@rocket.chat/core-services'; import type { ILivechatInquiryRecord, ILivechatVisitor, @@ -35,7 +35,7 @@ type Routing = { methods: Record; startQueue(): void; isMethodSet(): boolean; - setMethodNameAndStartQueue(name: string): void; + setMethodNameAndStartQueue(name: string): Promise; registerMethod(name: string, Method: IRoutingMethodConstructor): void; getMethod(): IRoutingMethod; getConfig(): RoutingMethodConfig | undefined; @@ -73,7 +73,7 @@ export const RoutingManager: Routing = { return !!this.methodName; }, - setMethodNameAndStartQueue(name) { + async setMethodNameAndStartQueue(name) { logger.debug(`Changing default routing method from ${this.methodName} to ${name}`); if (!this.methods[name]) { logger.warn(`Cannot change routing method to ${name}. Selected Routing method does not exists. Defaulting to Manual_Selection`); @@ -82,7 +82,7 @@ export const RoutingManager: Routing = { this.methodName = name; } - this.startQueue(); + void (await Omnichannel.getQueueWorker()).shouldStart(); }, // eslint-disable-next-line @typescript-eslint/naming-convention diff --git a/apps/meteor/app/livechat/server/startup.ts b/apps/meteor/app/livechat/server/startup.ts index 84b2adfa0755..f24f88975b22 100644 --- a/apps/meteor/app/livechat/server/startup.ts +++ b/apps/meteor/app/livechat/server/startup.ts @@ -73,7 +73,7 @@ Meteor.startup(async () => { }); settings.watch('Livechat_Routing_Method', (value) => { - RoutingManager.setMethodNameAndStartQueue(value); + void RoutingManager.setMethodNameAndStartQueue(value); }); // Remove when accounts.onLogout is async diff --git a/apps/meteor/ee/app/livechat-enterprise/server/lib/Helper.ts b/apps/meteor/ee/app/livechat-enterprise/server/lib/Helper.ts index 7944ca88320c..0df5d95c86c9 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/lib/Helper.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/lib/Helper.ts @@ -11,8 +11,6 @@ import { import moment from 'moment'; import type { Document } from 'mongodb'; -import { dispatchAgentDelegated } from '../../../../../app/livechat/server/lib/Helper'; -import { RoutingManager } from '../../../../../app/livechat/server/lib/RoutingManager'; import { getInquirySortMechanismSetting } from '../../../../../app/livechat/server/lib/settings'; import { settings } from '../../../../../app/settings/server'; import { callbacks } from '../../../../../lib/callbacks'; @@ -146,35 +144,6 @@ const dispatchWaitingQueueStatus = async (department?: string) => { // but we don't need to notify _each_ change that takes place, just their final position export const debouncedDispatchWaitingQueueStatus = memoizeDebounce(dispatchWaitingQueueStatus, 1200); -export const processWaitingQueue = async (department: string | undefined, inquiry: InquiryWithAgentInfo) => { - const queue = department || 'Public'; - helperLogger.debug(`Processing items on queue ${queue}`); - - helperLogger.debug(`Processing inquiry ${inquiry._id} from queue ${queue}`); - const { defaultAgent } = inquiry; - // TODO: remove this typecast when routing manager becomes TS - const room = (await RoutingManager.delegateInquiry(inquiry, defaultAgent)) as IOmnichannelRoom; - - const propagateAgentDelegated = async (rid: string, agentId: string) => { - await dispatchAgentDelegated(rid, agentId); - }; - - if (room?.servedBy) { - const { - _id: rid, - servedBy: { _id: agentId }, - } = room; - helperLogger.debug(`Inquiry ${inquiry._id} taken successfully by agent ${agentId}. Notifying`); - setTimeout(() => { - void propagateAgentDelegated(rid, agentId); - }, 1000); - - return true; - } - - return false; -}; - export const setPredictedVisitorAbandonmentTime = async (room: IOmnichannelRoom) => { if ( !room.v?.lastMessageTs || diff --git a/apps/meteor/ee/app/livechat-enterprise/server/lib/LivechatEnterprise.ts b/apps/meteor/ee/app/livechat-enterprise/server/lib/LivechatEnterprise.ts index d4d71ac14493..83a2963a54d8 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/lib/LivechatEnterprise.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/lib/LivechatEnterprise.ts @@ -1,11 +1,5 @@ -import type { - IOmnichannelBusinessUnit, - IOmnichannelServiceLevelAgreements, - LivechatDepartmentDTO, - InquiryWithAgentInfo, -} from '@rocket.chat/core-typings'; +import type { IOmnichannelBusinessUnit, IOmnichannelServiceLevelAgreements, LivechatDepartmentDTO } from '@rocket.chat/core-typings'; import { - LivechatInquiry, Users, LivechatDepartment as LivechatDepartmentRaw, OmnichannelServiceLevelAgreements, @@ -17,16 +11,12 @@ import { Match, check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { updateDepartmentAgents } from '../../../../../app/livechat/server/lib/Helper'; -import { RoutingManager } from '../../../../../app/livechat/server/lib/RoutingManager'; -import { getInquirySortMechanismSetting } from '../../../../../app/livechat/server/lib/settings'; -import { settings } from '../../../../../app/settings/server'; import { callbacks } from '../../../../../lib/callbacks'; import { addUserRolesAsync } from '../../../../../server/lib/roles/addUserRoles'; import { removeUserFromRolesAsync } from '../../../../../server/lib/roles/removeUserFromRoles'; import { hasLicense } from '../../../license/server/license'; -import { processWaitingQueue, updateSLAInquiries } from './Helper'; +import { updateSLAInquiries } from './Helper'; import { removeSLAFromRooms } from './SlaHelper'; -import { queueLogger } from './logger'; export const LivechatEnterprise = { async addMonitor(username: string) { @@ -292,116 +282,3 @@ export const LivechatEnterprise = { return hasLicense('livechat-enterprise') || (await LivechatDepartmentRaw.countTotal()) === 0; }, }; - -const DEFAULT_RACE_TIMEOUT = 5000; -let queueDelayTimeout = DEFAULT_RACE_TIMEOUT; - -type QueueWorker = { - running: boolean; - queues: (string | undefined)[]; - start(): Promise; - stop(): Promise; - getActiveQueues(): Promise<(string | undefined)[]>; - nextQueue(): Promise; - execute(): Promise; - checkQueue(queue: string | undefined): Promise; -}; - -const queueWorker: QueueWorker = { - running: false, - queues: [], - async start() { - queueLogger.debug('Starting queue'); - if (this.running) { - queueLogger.debug('Queue already running'); - return; - } - - const activeQueues = await this.getActiveQueues(); - queueLogger.debug(`Active queues: ${activeQueues.length}`); - - this.running = true; - return this.execute(); - }, - async stop() { - queueLogger.debug('Stopping queue'); - await LivechatInquiry.unlockAll(); - - this.running = false; - }, - async getActiveQueues() { - // undefined = public queue(without department) - return ([undefined] as (undefined | string)[]).concat(await LivechatInquiry.getDistinctQueuedDepartments({})); - }, - async nextQueue() { - if (!this.queues.length) { - queueLogger.debug('No more registered queues. Refreshing'); - this.queues = await this.getActiveQueues(); - } - - return this.queues.shift(); - }, - async execute() { - if (!this.running) { - queueLogger.debug('Queue stopped. Cannot execute'); - return; - } - - const queue = await this.nextQueue(); - queueLogger.debug(`Executing queue ${queue || 'Public'} with timeout of ${queueDelayTimeout}`); - - setTimeout(this.checkQueue.bind(this, queue), queueDelayTimeout); - }, - - async checkQueue(queue) { - queueLogger.debug(`Processing items for queue ${queue || 'Public'}`); - try { - const nextInquiry = await LivechatInquiry.findNextAndLock(getInquirySortMechanismSetting(), queue); - if (!nextInquiry) { - queueLogger.debug(`No more items for queue ${queue || 'Public'}`); - return; - } - - const result = await processWaitingQueue(queue, nextInquiry as InquiryWithAgentInfo); - - if (!result) { - await LivechatInquiry.unlock(nextInquiry._id); - } - } catch (e) { - queueLogger.error({ - msg: `Error processing queue ${queue || 'public'}`, - err: e, - }); - } finally { - void this.execute(); - } - }, -}; - -let omnichannelIsEnabled = false; -function shouldQueueStart() { - if (!omnichannelIsEnabled) { - void queueWorker.stop(); - return; - } - - const routingSupportsAutoAssign = RoutingManager.getConfig()?.autoAssignAgent; - queueLogger.debug( - `Routing method ${RoutingManager.methodName} supports auto assignment: ${routingSupportsAutoAssign}. ${ - routingSupportsAutoAssign ? 'Starting' : 'Stopping' - } queue`, - ); - - void (routingSupportsAutoAssign ? queueWorker.start() : queueWorker.stop()); -} - -RoutingManager.startQueue = shouldQueueStart; - -settings.watch('Livechat_enabled', (enabled) => { - omnichannelIsEnabled = enabled; - void (omnichannelIsEnabled && RoutingManager.isMethodSet() ? shouldQueueStart() : queueWorker.stop()); -}); - -settings.watch('Omnichannel_queue_delay_timeout', (timeout) => { - queueDelayTimeout = timeout < 1 ? DEFAULT_RACE_TIMEOUT : timeout * 1000; -}); diff --git a/apps/meteor/ee/app/livechat-enterprise/server/lib/logger.ts b/apps/meteor/ee/app/livechat-enterprise/server/lib/logger.ts index cef654325050..4e7a8eab5932 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/lib/logger.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/lib/logger.ts @@ -3,7 +3,6 @@ import { Logger } from '@rocket.chat/logger'; export const logger = new Logger('LivechatEnterprise'); export const queriesLogger = logger.section('Queries'); -export const queueLogger = logger.section('Queue'); export const helperLogger = logger.section('Helper'); export const cbLogger = logger.section('Callbacks'); export const bhLogger = logger.section('Business-Hours'); diff --git a/apps/meteor/server/services/omnichannel/logger.ts b/apps/meteor/server/services/omnichannel/logger.ts new file mode 100644 index 000000000000..208d1e5e9adf --- /dev/null +++ b/apps/meteor/server/services/omnichannel/logger.ts @@ -0,0 +1,3 @@ +import { Logger } from '@rocket.chat/logger'; + +export const queueLogger = new Logger('OmnichannelQueue'); diff --git a/apps/meteor/server/services/omnichannel/queue.ts b/apps/meteor/server/services/omnichannel/queue.ts new file mode 100644 index 000000000000..8bf5453587ce --- /dev/null +++ b/apps/meteor/server/services/omnichannel/queue.ts @@ -0,0 +1,142 @@ +import type { InquiryWithAgentInfo, IOmnichannelQueue } from '@rocket.chat/core-typings'; +import { LivechatInquiry } from '@rocket.chat/models'; + +import { dispatchAgentDelegated } from '../../../app/livechat/server/lib/Helper'; +import { RoutingManager } from '../../../app/livechat/server/lib/RoutingManager'; +import { getInquirySortMechanismSetting } from '../../../app/livechat/server/lib/settings'; +import { settings } from '../../../app/settings/server'; +import { queueLogger } from './logger'; + +const DEFAULT_RACE_TIMEOUT = 5000; + +export class OmnichannelQueue implements IOmnichannelQueue { + private running = false; + + private queues: (string | undefined)[] = []; + + private delay() { + const timeout = settings.get('Omnichannel_queue_delay_timeout'); + return timeout < 1 ? DEFAULT_RACE_TIMEOUT : timeout * 1000; + } + + async start() { + queueLogger.debug('Starting queue'); + if (this.running) { + queueLogger.debug('Queue already running'); + return; + } + + const activeQueues = await this.getActiveQueues(); + queueLogger.debug(`Active queues: ${activeQueues.length}`); + + this.running = true; + return this.execute(); + } + + async stop() { + queueLogger.debug('Stopping queue'); + await LivechatInquiry.unlockAll(); + + this.running = false; + } + + private async getActiveQueues() { + // undefined = public queue(without department) + return ([undefined] as typeof this.queues).concat(await LivechatInquiry.getDistinctQueuedDepartments({})); + } + + private async nextQueue() { + if (!this.queues.length) { + queueLogger.debug('No more registered queues. Refreshing'); + this.queues = await this.getActiveQueues(); + } + + return this.queues.shift(); + } + + private async execute() { + if (!this.running) { + queueLogger.debug('Queue stopped. Cannot execute'); + return; + } + + const queue = await this.nextQueue(); + const queueDelayTimeout = this.delay(); + queueLogger.debug(`Executing queue ${queue || 'Public'} with timeout of ${queueDelayTimeout}`); + + setTimeout(this.checkQueue.bind(this, queue), queueDelayTimeout); + } + + private async checkQueue(queue: string | undefined) { + queueLogger.debug(`Processing items for queue ${queue || 'Public'}`); + try { + const nextInquiry = await LivechatInquiry.findNextAndLock(getInquirySortMechanismSetting(), queue); + if (!nextInquiry) { + queueLogger.debug(`No more items for queue ${queue || 'Public'}`); + return; + } + + const result = await this.processWaitingQueue(queue, nextInquiry as InquiryWithAgentInfo); + + if (!result) { + // Note: this removes the "one-shot" behavior of queue, allowing it to take a conversation again in the future + // And sorting them by _updatedAt: -1 will make it so that the oldest inquiries are taken first + // preventing us from playing with the same inquiry over and over again + await LivechatInquiry.unlock(nextInquiry._id); + } + } catch (e) { + queueLogger.error({ + msg: 'Error processing queue', + queue: queue || 'Public', + err: e, + }); + } finally { + void this.execute(); + } + } + + shouldStart() { + if (!settings.get('Livechat_enabled')) { + void this.stop(); + return; + } + + const routingSupportsAutoAssign = RoutingManager.getConfig()?.autoAssignAgent; + queueLogger.debug({ + msg: 'Routing method supports auto assignment', + method: RoutingManager.methodName, + status: routingSupportsAutoAssign ? 'Starting' : 'Stopping', + }); + + void (routingSupportsAutoAssign ? this.start() : this.stop()); + } + + private async processWaitingQueue(department: string | undefined, inquiry: InquiryWithAgentInfo) { + const queue = department || 'Public'; + queueLogger.debug(`Processing items on queue ${queue}`); + + queueLogger.debug(`Processing inquiry ${inquiry._id} from queue ${queue}`); + const { defaultAgent } = inquiry; + const room = await RoutingManager.delegateInquiry(inquiry, defaultAgent); + + const propagateAgentDelegated = async (rid: string, agentId: string) => { + await dispatchAgentDelegated(rid, agentId); + }; + + if (room?.servedBy) { + const { + _id: rid, + servedBy: { _id: agentId }, + } = room; + queueLogger.debug(`Inquiry ${inquiry._id} taken successfully by agent ${agentId}. Notifying`); + setTimeout(() => { + void propagateAgentDelegated(rid, agentId); + }, 1000); + + return true; + } + + queueLogger.debug(`Inquiry ${inquiry._id} not taken by any agent. Queueing again`); + return false; + } +} diff --git a/apps/meteor/server/services/omnichannel/service.ts b/apps/meteor/server/services/omnichannel/service.ts index b5e83e30836b..7f35de104e1c 100644 --- a/apps/meteor/server/services/omnichannel/service.ts +++ b/apps/meteor/server/services/omnichannel/service.ts @@ -1,11 +1,22 @@ import { ServiceClassInternal } from '@rocket.chat/core-services'; import type { IOmnichannelService } from '@rocket.chat/core-services'; +import type { IOmnichannelQueue } from '@rocket.chat/core-typings'; import { Livechat } from '../../../app/livechat/server'; +import { RoutingManager } from '../../../app/livechat/server/lib/RoutingManager'; +import { settings } from '../../../app/settings/server'; +import { OmnichannelQueue } from './queue'; export class OmnichannelService extends ServiceClassInternal implements IOmnichannelService { protected name = 'omnichannel'; + private queueWorker: IOmnichannelQueue; + + constructor() { + super(); + this.queueWorker = new OmnichannelQueue(); + } + async created() { this.onEvent('presence.status', async ({ user }): Promise => { if (!user?._id) { @@ -18,4 +29,14 @@ export class OmnichannelService extends ServiceClassInternal implements IOmnicha } }); } + + async started() { + settings.watch('Livechat_enabled', (enabled) => { + void (enabled && RoutingManager.isMethodSet() ? this.queueWorker.shouldStart() : this.queueWorker.stop()); + }); + } + + getQueueWorker(): IOmnichannelQueue { + return this.queueWorker; + } } diff --git a/packages/core-services/src/index.ts b/packages/core-services/src/index.ts index 723b3b27103c..def7622c9881 100644 --- a/packages/core-services/src/index.ts +++ b/packages/core-services/src/index.ts @@ -153,6 +153,7 @@ export const Settings = proxifyWithWait('settings'); export const OmnichannelIntegration = proxifyWithWait('omnichannel-integration'); export const Federation = proxifyWithWait('federation'); export const FederationEE = proxifyWithWait('federation-enterprise'); +export const Omnichannel = proxifyWithWait('omnichannel'); export const OmnichannelEEService = proxifyWithWait('omnichannel-ee'); export const Import = proxifyWithWait('import'); diff --git a/packages/core-services/src/types/IOmnichannelService.ts b/packages/core-services/src/types/IOmnichannelService.ts index d5aaae341dad..fb3cc60d9243 100644 --- a/packages/core-services/src/types/IOmnichannelService.ts +++ b/packages/core-services/src/types/IOmnichannelService.ts @@ -1,3 +1,7 @@ +import type { IOmnichannelQueue } from '@rocket.chat/core-typings'; + import type { IServiceClass } from './ServiceClass'; -export type IOmnichannelService = IServiceClass; +export interface IOmnichannelService extends IServiceClass { + getQueueWorker(): IOmnichannelQueue; +} diff --git a/packages/core-typings/src/omnichannel/index.ts b/packages/core-typings/src/omnichannel/index.ts index 0995968370e4..703cf3b4ca77 100644 --- a/packages/core-typings/src/omnichannel/index.ts +++ b/packages/core-typings/src/omnichannel/index.ts @@ -1,3 +1,4 @@ export * from './sms'; export * from './routing'; +export * from './queue'; export * from './reports'; diff --git a/packages/core-typings/src/omnichannel/queue.ts b/packages/core-typings/src/omnichannel/queue.ts new file mode 100644 index 000000000000..46036622713f --- /dev/null +++ b/packages/core-typings/src/omnichannel/queue.ts @@ -0,0 +1,5 @@ +export interface IOmnichannelQueue { + start(): Promise; + shouldStart(): void; + stop(): Promise; +} From 772839b70a4b690caa5bb1315380e91c150eecc1 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Thu, 31 Aug 2023 08:11:44 -0300 Subject: [PATCH 035/275] fix: Departments submit button not being disabled while submit is going on (#30211) --- .../client/views/omnichannel/departments/EditDepartment.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx b/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx index 02287f6b7310..3a408bfa7507 100644 --- a/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx +++ b/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx @@ -123,7 +123,7 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen control, handleSubmit, watch, - formState: { errors, isValid, isDirty }, + formState: { errors, isValid, isDirty, isSubmitting }, } = useForm({ mode: 'onChange', defaultValues: initialValues }); const requestTagBeforeClosingChat = watch('requestTagBeforeClosingChat'); @@ -211,7 +211,7 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen departmentsRoute.push({}); }); - const isFormValid = isValid && isDirty; + const isFormValid = isValid && isDirty && !isSubmitting; const formId = useUniqueId(); From c2fe38cb34f54f725030c22c82fede46c87f02c2 Mon Sep 17 00:00:00 2001 From: Douglas Gubert Date: Thu, 31 Aug 2023 09:47:26 -0300 Subject: [PATCH 036/275] feat: Ability to disable private app installation and updates via envvars (#30227) --- .changeset/hip-hounds-ring.md | 5 ++++ .../views/marketplace/AppInstallPage.js | 28 +++++++++---------- .../marketplace/helpers/handleAPIError.ts | 16 +++++------ .../ee/server/apps/communication/rest.ts | 12 ++++++++ apps/meteor/ee/server/apps/orchestrator.js | 6 ++++ .../rocketchat-i18n/i18n/en.i18n.json | 2 ++ 6 files changed, 46 insertions(+), 23 deletions(-) create mode 100644 .changeset/hip-hounds-ring.md diff --git a/.changeset/hip-hounds-ring.md b/.changeset/hip-hounds-ring.md new file mode 100644 index 000000000000..79dfba6dd031 --- /dev/null +++ b/.changeset/hip-hounds-ring.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Added ability to disable private app installation via envvar (DISABLE_PRIVATE_APP_INSTALLATION) diff --git a/apps/meteor/client/views/marketplace/AppInstallPage.js b/apps/meteor/client/views/marketplace/AppInstallPage.js index 860a09d6ab75..47dae3621666 100644 --- a/apps/meteor/client/views/marketplace/AppInstallPage.js +++ b/apps/meteor/client/views/marketplace/AppInstallPage.js @@ -76,23 +76,23 @@ function AppInstallPage() { } else { app = await uploadAppEndpoint(fileData); } + + router.navigate({ + name: 'marketplace', + params: { + context: 'private', + page: 'info', + id: appId || app.app.id, + }, + }); + + reload(); } catch (e) { handleAPIError(e); + } finally { + setInstalling(false); + setModal(null); } - - router.navigate({ - name: 'marketplace', - params: { - context: 'private', - page: 'info', - id: appId || app.app.id, - }, - }); - - reload(); - - setInstalling(false); - setModal(null); }; const cancelAction = useCallback(() => { diff --git a/apps/meteor/client/views/marketplace/helpers/handleAPIError.ts b/apps/meteor/client/views/marketplace/helpers/handleAPIError.ts index 6226d38ac662..61ec512bd6ee 100644 --- a/apps/meteor/client/views/marketplace/helpers/handleAPIError.ts +++ b/apps/meteor/client/views/marketplace/helpers/handleAPIError.ts @@ -1,3 +1,4 @@ +import { t } from '../../../../app/utils/lib/i18n'; import { dispatchToastMessage } from '../../../lib/toast'; const shouldHandleErrorAsWarning = (message: string): boolean => { @@ -6,15 +7,12 @@ const shouldHandleErrorAsWarning = (message: string): boolean => { return warnings.includes(message); }; -export const handleAPIError = (error: unknown): void => { - if (error instanceof Error) { - const { message } = error; +export const handleAPIError = (errorObject: unknown): void => { + const { message = '', error = '' } = errorObject as { message?: string; error?: string }; - if (shouldHandleErrorAsWarning(message)) { - dispatchToastMessage({ type: 'warning', message }); - return; - } - - dispatchToastMessage({ type: 'error', message }); + if (shouldHandleErrorAsWarning(message)) { + return dispatchToastMessage({ type: 'warning', message: t(message) }); } + + dispatchToastMessage({ type: 'error', message: t(`Apps_Error_${error}`) }); }; diff --git a/apps/meteor/ee/server/apps/communication/rest.ts b/apps/meteor/ee/server/apps/communication/rest.ts index 790e5a87a19d..5805f53afd46 100644 --- a/apps/meteor/ee/server/apps/communication/rest.ts +++ b/apps/meteor/ee/server/apps/communication/rest.ts @@ -383,6 +383,11 @@ export class AppsRestApi { return API.v1.failure({ error: 'Failed to get a file to install for the App. ' }); } + // Used mostly in Cloud hosting for security reasons + if (!marketplaceInfo && orchestrator.shouldDisablePrivateAppInstallation()) { + return API.v1.internalError('private_app_install_disabled'); + } + const user = orchestrator ?.getConverters() ?.get('users') @@ -666,6 +671,7 @@ export class AppsRestApi { async post() { let buff; let permissionsGranted; + let isPrivateAppUpload = false; if (this.bodyParams.url) { const response = await fetch(this.bodyParams.url); @@ -708,6 +714,8 @@ export class AppsRestApi { return API.v1.internalError(); } } else { + isPrivateAppUpload = true; + const app = await getUploadFormData( { request: this.request, @@ -732,6 +740,10 @@ export class AppsRestApi { return API.v1.failure({ error: 'Failed to get a file to install for the App. ' }); } + if (isPrivateAppUpload && orchestrator.shouldDisablePrivateAppInstallation()) { + return API.v1.internalError('private_app_install_disabled'); + } + const aff = await manager.update(buff, permissionsGranted); const info: IAppInfo & { status?: AppStatus } = aff.getAppInfo(); diff --git a/apps/meteor/ee/server/apps/orchestrator.js b/apps/meteor/ee/server/apps/orchestrator.js index 69fe03d3b2da..3822601323bb 100644 --- a/apps/meteor/ee/server/apps/orchestrator.js +++ b/apps/meteor/ee/server/apps/orchestrator.js @@ -26,6 +26,8 @@ function isTesting() { return process.env.TEST_MODE === 'true'; } +const DISABLED_PRIVATE_APP_INSTALLATION = ['yes', 'true'].includes(String(process.env.DISABLE_PRIVATE_APP_INSTALLATION).toLowerCase()); + let appsSourceStorageType; let appsSourceStorageFilesystemPath; @@ -137,6 +139,10 @@ export class AppServerOrchestrator { return !isTesting(); } + shouldDisablePrivateAppInstallation() { + return DISABLED_PRIVATE_APP_INSTALLATION; + } + /** * @returns {Logger} */ diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 1239bf6d8038..cf4267c34713 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -521,6 +521,7 @@ "Apps_disabled_when_Enterprise_trial_ended_description": "Workspaces on Community Edition can have up to 5 marketplace apps and 3 private apps enabled. Ask your workspace admin to reenable apps.", "Apps_disabled_when_Enterprise_trial_ended_description_admin": "Workspaces on Community Edition can have up to 5 marketplace apps and 3 private apps enabled. Reenable the apps you require.", "Apps_Engine_Version": "Apps Engine Version", + "Apps_Error_private_app_install_disabled": "Private app installation and updates are disabled in this workspace", "Apps_Essential_Alert": "This app is essential for the following events:", "Apps_Essential_Disclaimer": "Events listed above will be disrupted if this app is disabled. If you want Rocket.Chat to work without this app's functionality, you need to uninstall it", "Apps_Framework_Source_Package_Storage_Type": "Apps' Source Package Storage type", @@ -622,6 +623,7 @@ "Apps_Manual_Update_Modal_Title": "This app is already installed", "Apps_Manual_Update_Modal_Body": "Do you want to update it?", "Apps_User_Already_Exists": "The username \"{{username}}\" is already being used. Rename or remove the user using it to install this App", + "AutoLinker": "AutoLinker", "Apps_WhatIsIt": "Apps: What Are They?", "Apps_WhatIsIt_paragraph1": "A new icon in the administration area! What does this mean and what are Apps?", From 66b26a04c8ca7df588c1b23f6a4a1fb9cdc986a5 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Thu, 31 Aug 2023 11:37:31 -0300 Subject: [PATCH 037/275] chore: improve apps-stream handling (#30221) --- .../client/hooks/useAppActionButtons.ts | 17 ++-- .../client/hooks/useAppSlashCommands.ts | 38 ++++----- .../meteor/client/hooks/useAppTranslations.ts | 70 ++++++++++++++++ .../providers/ActionManagerProvider.tsx | 2 + apps/meteor/client/providers/AppsProvider.tsx | 60 ++++---------- .../ee/client/apps/communication/index.ts | 1 - .../client/apps/communication/websockets.js | 81 ------------------- apps/meteor/ee/client/apps/i18n.js | 39 --------- apps/meteor/ee/client/apps/orchestrator.ts | 16 +--- packages/rest-typings/src/apps/index.ts | 9 ++- 10 files changed, 124 insertions(+), 209 deletions(-) create mode 100644 apps/meteor/client/hooks/useAppTranslations.ts delete mode 100644 apps/meteor/ee/client/apps/communication/index.ts delete mode 100644 apps/meteor/ee/client/apps/communication/websockets.js delete mode 100644 apps/meteor/ee/client/apps/i18n.js diff --git a/apps/meteor/client/hooks/useAppActionButtons.ts b/apps/meteor/client/hooks/useAppActionButtons.ts index 68c4a2d3c2a6..402c0f3c9775 100644 --- a/apps/meteor/client/hooks/useAppActionButtons.ts +++ b/apps/meteor/client/hooks/useAppActionButtons.ts @@ -1,5 +1,6 @@ import type { IUIActionButton, UIActionButtonContext } from '@rocket.chat/apps-engine/definition/ui'; -import { useEndpoint, useStream, useUserId } from '@rocket.chat/ui-contexts'; +import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks'; +import { useEndpoint, useSingleStream, useUserId } from '@rocket.chat/ui-contexts'; import type { UseQueryResult } from '@tanstack/react-query'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useEffect, useMemo } from 'react'; @@ -16,7 +17,7 @@ const getIdForActionButton = ({ appId, actionId }: IUIActionButton): string => ` export const useAppActionButtons = (context?: `${UIActionButtonContext}`) => { const queryClient = useQueryClient(); - const apps = useStream('apps'); + const apps = useSingleStream('apps'); const uid = useUserId(); const getActionButtons = useEndpoint('GET', '/apps/actionButtons'); @@ -28,15 +29,21 @@ export const useAppActionButtons = (context?: `${UIActionButtonContext}`) => { staleTime: Infinity, }); + const invalidate = useDebouncedCallback(() => { + queryClient.invalidateQueries(['apps', 'actionButtons']); + }, 100); + useEffect(() => { if (!uid) { return; } - return apps('actions/changed', () => { - queryClient.invalidateQueries(['apps', 'actionButtons']); + return apps('apps', ([key]) => { + if (['actions/changed'].includes(key)) { + invalidate(); + } }); - }, [uid, queryClient, apps]); + }, [uid, apps, invalidate]); return result; }; diff --git a/apps/meteor/client/hooks/useAppSlashCommands.ts b/apps/meteor/client/hooks/useAppSlashCommands.ts index bf72973aa705..3cb6ff2ce090 100644 --- a/apps/meteor/client/hooks/useAppSlashCommands.ts +++ b/apps/meteor/client/hooks/useAppSlashCommands.ts @@ -1,39 +1,33 @@ -import { useEndpoint, useStream, useUserId } from '@rocket.chat/ui-contexts'; +import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks'; +import { useEndpoint, useSingleStream, useUserId } from '@rocket.chat/ui-contexts'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import { useEffect } from 'react'; import { slashCommands } from '../../app/utils/lib/slashCommand'; -const stop = (...args: (() => void)[]) => args.forEach((s) => s()); - export const useAppSlashCommands = () => { const queryClient = useQueryClient(); - const apps = useStream('apps'); + const apps = useSingleStream('apps'); const uid = useUserId(); + const invalidate = useDebouncedCallback(() => { + queryClient.invalidateQueries(['apps', 'slashCommands']); + }, 100); + useEffect(() => { if (!uid) { return; } - return stop( - apps('command/added', () => { - queryClient.invalidateQueries(['apps', 'slashCommands']); - }), - - apps('command/updated', () => { - queryClient.invalidateQueries(['apps', 'slashCommands']); - }), - - apps('command/removed', () => { - queryClient.invalidateQueries(['apps', 'slashCommands']); - }), - - apps('command/disabled', () => { - queryClient.invalidateQueries(['apps', 'slashCommands']); - }), - ); - }, [apps, queryClient, uid]); + return apps('apps', ([key, [command]]) => { + if (['command/added', 'command/updated', 'command/disabled', 'command/removed'].includes(key)) { + if (typeof command === 'string') { + delete slashCommands.commands[command]; + } + invalidate(); + } + }); + }, [apps, uid, invalidate]); const getSlashCommands = useEndpoint('GET', '/v1/commands.list'); diff --git a/apps/meteor/client/hooks/useAppTranslations.ts b/apps/meteor/client/hooks/useAppTranslations.ts new file mode 100644 index 000000000000..eba0686aab55 --- /dev/null +++ b/apps/meteor/client/hooks/useAppTranslations.ts @@ -0,0 +1,70 @@ +import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks'; +import { useEndpoint, useSingleStream, useUserId } from '@rocket.chat/ui-contexts'; +import { useQuery, useQueryClient } from '@tanstack/react-query'; +import { useEffect } from 'react'; + +import { i18n } from '../../app/utils/lib/i18n'; +import { Utilities } from '../../ee/lib/misc/Utilities'; + +export const useAppTranslations = () => { + const queryClient = useQueryClient(); + + const apps = useSingleStream('apps'); + const uid = useUserId(); + + const getAppsLanguages = useEndpoint('GET', '/apps/languages'); + + const result = useQuery(['apps', 'translations'], () => getAppsLanguages(), { + staleTime: Infinity, + }); + + useEffect(() => { + if (result.data) { + result.data.apps.forEach(({ id, languages }) => { + loadAppI18nResources(id, languages); + }); + } + }, [result.data]); + + const invalidate = useDebouncedCallback(() => { + queryClient.invalidateQueries(['apps', 'translations']); + }, 100); + + useEffect(() => { + if (!uid) { + return; + } + + return apps('apps', ([key]) => { + if (['app/added'].includes(key)) { + invalidate(); + } + }); + }, [uid, apps, invalidate]); + + const loadAppI18nResources = ( + appId: string, + languages: { + [key: string]: { + Params: string; + Description: string; + Setting_Name: string; + Setting_Description: string; + }; + }, + ) => { + Object.entries(languages).forEach(([language, translations]) => { + const regex = /([a-z]{2,3})-([a-z]{2,4})/; + const match = regex.exec(language); + const normalizedLanguage = match ? `${match[1]}-${match[2].toUpperCase()}` : language; + + // Translations keys must be scoped under app id + const scopedTranslations = Object.entries(translations).reduce>((acc, [key, value]) => { + acc[Utilities.getI18nKeyForApp(key, appId)] = value; + return translations; + }, {}); + + i18n.addResourceBundle(normalizedLanguage, 'core', scopedTranslations); + }); + }; +}; diff --git a/apps/meteor/client/providers/ActionManagerProvider.tsx b/apps/meteor/client/providers/ActionManagerProvider.tsx index b6d09bedf9a4..8faa55260f13 100644 --- a/apps/meteor/client/providers/ActionManagerProvider.tsx +++ b/apps/meteor/client/providers/ActionManagerProvider.tsx @@ -5,6 +5,7 @@ import React from 'react'; import * as ActionManager from '../../app/ui-message/client/ActionManager'; import { useAppActionButtons } from '../hooks/useAppActionButtons'; import { useAppSlashCommands } from '../hooks/useAppSlashCommands'; +import { useAppTranslations } from '../hooks/useAppTranslations'; import { useAppUiKitInteraction } from '../hooks/useAppUiKitInteraction'; type ActionManagerProviderProps = { @@ -12,6 +13,7 @@ type ActionManagerProviderProps = { }; const ActionManagerProvider = ({ children }: ActionManagerProviderProps): ReactElement => { + useAppTranslations(); useAppActionButtons(); useAppSlashCommands(); useAppUiKitInteraction(ActionManager.handlePayloadUserInteraction); diff --git a/apps/meteor/client/providers/AppsProvider.tsx b/apps/meteor/client/providers/AppsProvider.tsx index 773e15a6535e..6b9de2344fa7 100644 --- a/apps/meteor/client/providers/AppsProvider.tsx +++ b/apps/meteor/client/providers/AppsProvider.tsx @@ -1,9 +1,9 @@ -import { usePermission } from '@rocket.chat/ui-contexts'; +import { useDebouncedCallback } from '@rocket.chat/fuselage-hooks'; +import { usePermission, useSingleStream } from '@rocket.chat/ui-contexts'; import { useQuery, useQueryClient } from '@tanstack/react-query'; import type { FC } from 'react'; import React, { useEffect } from 'react'; -import { AppEvents } from '../../ee/client/apps/communication'; import { AppClientOrchestratorInstance } from '../../ee/client/apps/orchestrator'; import PageSkeleton from '../components/PageSkeleton'; import { AppsContext } from '../contexts/AppsContext'; @@ -11,27 +11,6 @@ import { AsyncStatePhase } from '../lib/asyncState'; import { useInvalidateAppsCountQueryCallback } from '../views/marketplace/hooks/useAppsCountQuery'; import type { App } from '../views/marketplace/types'; -type ListenersMapping = { - readonly [P in keyof typeof AppEvents]?: (...args: any[]) => void; -}; - -const registerListeners = (listeners: ListenersMapping): (() => void) => { - const entries = Object.entries(listeners) as Exclude< - { - [K in keyof ListenersMapping]: [K, ListenersMapping[K]]; - }[keyof ListenersMapping], - undefined - >[]; - for (const [event, callback] of entries) { - AppClientOrchestratorInstance.getWsListener()?.registerListener(AppEvents[event], callback); - } - return (): void => { - for (const [event, callback] of entries) { - AppClientOrchestratorInstance.getWsListener()?.unregisterListener(AppEvents[event], callback); - } - }; -}; - const sortByName = (apps: App[]): App[] => apps.sort((a, b) => (a.name.toLowerCase() > b.name.toLowerCase() ? 1 : -1)); const AppsProvider: FC = ({ children }) => { @@ -41,29 +20,20 @@ const AppsProvider: FC = ({ children }) => { const invalidateAppsCountQuery = useInvalidateAppsCountQueryCallback(); + const stream = useSingleStream('apps'); + + const invalidate = useDebouncedCallback(() => { + queryClient.invalidateQueries(['marketplace', 'apps-instance']); + invalidateAppsCountQuery(); + }, 100); + useEffect(() => { - const listeners = { - APP_ADDED: (): void => { - queryClient.invalidateQueries(['marketplace', 'apps-instance']); - }, - APP_UPDATED: (): void => { - queryClient.invalidateQueries(['marketplace', 'apps-instance']); - }, - APP_REMOVED: (): void => { - queryClient.invalidateQueries(['marketplace', 'apps-instance']); - }, - APP_STATUS_CHANGE: (): void => { - queryClient.invalidateQueries(['marketplace', 'apps-instance']); - }, - APP_SETTING_UPDATED: (): void => { - queryClient.invalidateQueries(['marketplace', 'apps-instance']); - }, - }; - const unregisterListeners = registerListeners(listeners); - - // eslint-disable-next-line no-unsafe-finally - return unregisterListeners; - }, [invalidateAppsCountQuery, isAdminUser, queryClient]); + return stream('apps', ([key]) => { + if (['app/added', 'app/removed', 'app/updated', 'app/statusUpdate', 'app/settingUpdated'].includes(key)) { + invalidate(); + } + }); + }, [invalidate, stream]); const marketplace = useQuery( ['marketplace', 'apps-marketplace', isAdminUser], diff --git a/apps/meteor/ee/client/apps/communication/index.ts b/apps/meteor/ee/client/apps/communication/index.ts deleted file mode 100644 index 321bbb7f15b7..000000000000 --- a/apps/meteor/ee/client/apps/communication/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { AppWebsocketReceiver, AppEvents } from './websockets'; diff --git a/apps/meteor/ee/client/apps/communication/websockets.js b/apps/meteor/ee/client/apps/communication/websockets.js deleted file mode 100644 index ddea19163639..000000000000 --- a/apps/meteor/ee/client/apps/communication/websockets.js +++ /dev/null @@ -1,81 +0,0 @@ -import { Emitter } from '@rocket.chat/emitter'; - -import { CachedCollectionManager } from '../../../../app/ui-cached-collection/client'; -import { sdk } from '../../../../app/utils/client/lib/SDKClient'; -import { slashCommands } from '../../../../app/utils/lib/slashCommand'; - -export const AppEvents = Object.freeze({ - APP_ADDED: 'app/added', - APP_REMOVED: 'app/removed', - APP_UPDATED: 'app/updated', - APP_STATUS_CHANGE: 'app/statusUpdate', - APP_SETTING_UPDATED: 'app/settingUpdated', - COMMAND_ADDED: 'command/added', - COMMAND_DISABLED: 'command/disabled', - COMMAND_UPDATED: 'command/updated', - COMMAND_REMOVED: 'command/removed', - ACTIONS_CHANGED: 'actions/changed', -}); - -export class AppWebsocketReceiver extends Emitter { - constructor() { - super(); - - CachedCollectionManager.onLogin(() => { - this.listenStreamerEvents(); - }); - } - - listenStreamerEvents() { - sdk.stream('apps', ['apps'], ([key, args]) => { - switch (key) { - case AppEvents.COMMAND_ADDED: - this.onCommandAddedOrUpdated(...args); - break; - case AppEvents.COMMAND_UPDATED: - this.onCommandAddedOrUpdated(...args); - break; - case AppEvents.COMMAND_REMOVED: - this.onCommandRemovedOrDisabled(...args); - break; - case AppEvents.COMMAND_DISABLED: - this.onCommandRemovedOrDisabled(...args); - break; - } - this.emit(key, ...args); - }); - } - - registerListener(event, listener) { - this.on(event, listener); - } - - unregisterListener(event, listener) { - this.off(event, listener); - } - - onCommandAddedOrUpdated = (command) => { - const retryOnFailure = (retries) => { - sdk.rest - .get('/v1/commands.get', { command }) - .then((result) => { - slashCommands.add(result.command); - }) - .catch((error) => { - if (retries - 1 === 0) { - throw error; - } - - setTimeout(() => { - retryOnFailure(retries - 1); - }, 3000); - }); - }; - - retryOnFailure(3); - }; - - onCommandRemovedOrDisabled = (command) => { - delete slashCommands.commands[command]; - }; -} diff --git a/apps/meteor/ee/client/apps/i18n.js b/apps/meteor/ee/client/apps/i18n.js deleted file mode 100644 index bdece5e69061..000000000000 --- a/apps/meteor/ee/client/apps/i18n.js +++ /dev/null @@ -1,39 +0,0 @@ -import { i18n } from '../../../app/utils/lib/i18n'; -import { Utilities } from '../../lib/misc/Utilities'; -import { AppEvents } from './communication'; -import { AppClientOrchestratorInstance } from './orchestrator'; - -const loadAppI18nResources = (appId, languages) => { - Object.entries(languages).forEach(([language, translations]) => { - try { - const regex = /([a-z]{2,3})-([a-z]{2,4})/; - const match = regex.exec(language); - const normalizedLanguage = match ? `${match[1]}-${match[2].toUpperCase()}` : language; - - // Translations keys must be scoped under app id - const scopedTranslations = Object.entries(translations).reduce((translations, [key, value]) => { - translations[Utilities.getI18nKeyForApp(key, appId)] = value; - return translations; - }, {}); - - i18n.addResourceBundle(normalizedLanguage, 'core', scopedTranslations); - } catch (error) { - AppClientOrchestratorInstance.handleError(error); - } - }); -}; - -const handleAppAdded = async (appId) => { - const languages = await AppClientOrchestratorInstance.getAppLanguages(appId); - loadAppI18nResources(appId, languages); -}; - -export const handleI18nResources = async () => { - const apps = await AppClientOrchestratorInstance.getAppsLanguages(); - apps.forEach(({ id, languages }) => { - loadAppI18nResources(id, languages); - }); - - AppClientOrchestratorInstance.getWsListener().unregisterListener(AppEvents.APP_ADDED, handleAppAdded); - AppClientOrchestratorInstance.getWsListener().registerListener(AppEvents.APP_ADDED, handleAppAdded); -}; diff --git a/apps/meteor/ee/client/apps/orchestrator.ts b/apps/meteor/ee/client/apps/orchestrator.ts index eb37890680bd..2433d79aa7b5 100644 --- a/apps/meteor/ee/client/apps/orchestrator.ts +++ b/apps/meteor/ee/client/apps/orchestrator.ts @@ -2,7 +2,6 @@ import { AppClientManager } from '@rocket.chat/apps-engine/client/AppClientManag import type { IApiEndpointMetadata } from '@rocket.chat/apps-engine/definition/api'; import type { IPermission } from '@rocket.chat/apps-engine/definition/permissions/IPermission'; import type { ISetting } from '@rocket.chat/apps-engine/definition/settings'; -import type { IAppStorageItem } from '@rocket.chat/apps-engine/server/storage/IAppStorageItem'; import type { AppScreenshot, AppRequestFilter, Serialized, AppRequestsStats, PaginatedAppRequests } from '@rocket.chat/core-typings'; import { hasAtLeastOnePermission } from '../../../app/authorization/client'; @@ -11,8 +10,6 @@ import { dispatchToastMessage } from '../../../client/lib/toast'; import type { App } from '../../../client/views/marketplace/types'; import type { IAppLanguage, IAppExternalURL, ICategory } from './@types/IOrchestrator'; import { RealAppsEngineUIHost } from './RealAppsEngineUIHost'; -import { AppWebsocketReceiver } from './communication'; -import { handleI18nResources } from './i18n'; class AppClientOrchestrator { private _appClientUIHost: RealAppsEngineUIHost; @@ -21,8 +18,6 @@ class AppClientOrchestrator { private _isLoaded: boolean; - private _ws: AppWebsocketReceiver; - constructor() { this._appClientUIHost = new RealAppsEngineUIHost(); this._manager = new AppClientManager(this._appClientUIHost); @@ -31,15 +26,8 @@ class AppClientOrchestrator { public async load(): Promise { if (!this._isLoaded) { - this._ws = new AppWebsocketReceiver(); this._isLoaded = true; } - - await handleI18nResources(); - } - - public getWsListener(): AppWebsocketReceiver { - return this._ws; } public getAppClientManager(): AppClientManager { @@ -99,7 +87,7 @@ class AppClientOrchestrator { return apps; } - public async getAppsLanguages(): Promise { + public async getAppsLanguages(): Promise { const { apps } = await sdk.rest.get('/apps/languages'); return apps; } @@ -141,7 +129,7 @@ class AppClientOrchestrator { return apis; } - public async getAppLanguages(appId: string): Promise { + public async getAppLanguages(appId: string) { const { languages } = await sdk.rest.get(`/apps/${appId}/languages`); return languages; } diff --git a/packages/rest-typings/src/apps/index.ts b/packages/rest-typings/src/apps/index.ts index 59516adfe096..06ce6d98169e 100644 --- a/packages/rest-typings/src/apps/index.ts +++ b/packages/rest-typings/src/apps/index.ts @@ -60,7 +60,7 @@ export type AppsEndpoints = { Setting_Description: string; }; }; - }; + }[]; }; }; @@ -91,7 +91,12 @@ export type AppsEndpoints = { '/apps/:id/languages': { GET: () => { languages: { - [key: string]: object; + [key: string]: { + Params: string; + Description: string; + Setting_Name: string; + Setting_Description: string; + }; }; }; }; From dcfb7719ef036bb6eb4d6a469e2aef82960e1ba8 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Thu, 31 Aug 2023 12:14:50 -0300 Subject: [PATCH 038/275] regression: fix build ci --- apps/meteor/app/integrations/server/api/api.js | 2 -- apps/meteor/app/integrations/server/lib/triggerHandler.js | 2 -- 2 files changed, 4 deletions(-) diff --git a/apps/meteor/app/integrations/server/api/api.js b/apps/meteor/app/integrations/server/api/api.js index 17b9c4f9e0e5..e1db46729011 100644 --- a/apps/meteor/app/integrations/server/api/api.js +++ b/apps/meteor/app/integrations/server/api/api.js @@ -18,8 +18,6 @@ import { deleteOutgoingIntegration } from '../methods/outgoing/deleteOutgoingInt const DISABLE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.DISABLE_INTEGRATION_SCRIPTS).toLowerCase()); -const DISABLE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.DISABLE_INTEGRATION_SCRIPTS).toLowerCase()); - export const forbiddenModelMethods = ['registerModel', 'getCollectionName']; const compiledScripts = {}; diff --git a/apps/meteor/app/integrations/server/lib/triggerHandler.js b/apps/meteor/app/integrations/server/lib/triggerHandler.js index 90659d8e10d5..b122b22ff355 100644 --- a/apps/meteor/app/integrations/server/lib/triggerHandler.js +++ b/apps/meteor/app/integrations/server/lib/triggerHandler.js @@ -20,8 +20,6 @@ import { outgoingLogger } from '../logger'; const DISABLE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.DISABLE_INTEGRATION_SCRIPTS).toLowerCase()); -const DISABLE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.DISABLE_INTEGRATION_SCRIPTS).toLowerCase()); - class RocketChatIntegrationHandler { constructor() { this.successResults = [200, 201, 202]; From a56f5f0a5fb90cdcb39c6e5e7a21f0ba539f1f32 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Thu, 17 Aug 2023 14:42:20 -0300 Subject: [PATCH 039/275] chore(release): add engine versions to release (#30021) --- .changeset/moody-comics-cheat.md | 5 +++ .../release-action/src/bumpNextVersion.ts | 4 +- packages/release-action/src/getMetadata.ts | 41 +++++++++++++++++++ packages/release-action/src/publishRelease.ts | 4 +- packages/release-action/src/utils.ts | 16 ++++++++ 5 files changed, 66 insertions(+), 4 deletions(-) create mode 100644 .changeset/moody-comics-cheat.md create mode 100644 packages/release-action/src/getMetadata.ts diff --git a/.changeset/moody-comics-cheat.md b/.changeset/moody-comics-cheat.md new file mode 100644 index 000000000000..b8b372306d0e --- /dev/null +++ b/.changeset/moody-comics-cheat.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/release-action': minor +--- + +Add back "Engine Versions" to the release notes diff --git a/packages/release-action/src/bumpNextVersion.ts b/packages/release-action/src/bumpNextVersion.ts index c957c1d81fd3..2e117703d149 100644 --- a/packages/release-action/src/bumpNextVersion.ts +++ b/packages/release-action/src/bumpNextVersion.ts @@ -7,7 +7,7 @@ import * as github from '@actions/github'; import { setupOctokit } from './setupOctokit'; import { createNpmFile } from './createNpmFile'; -import { getChangelogEntry, bumpFileVersions, readPackageJson } from './utils'; +import { getChangelogEntry, bumpFileVersions, readPackageJson, getEngineVersionsMd } from './utils'; import { fixWorkspaceVersionsBeforePublish } from './fixWorkspaceVersionsBeforePublish'; import { commitChanges, createBranch, createTag, pushNewBranch } from './gitUtils'; @@ -49,7 +49,7 @@ export async function bumpNextVersion({ throw new Error('Could not find changelog entry for version newVersion'); } - const prBody = changelogEntry.content; + const prBody = (await getEngineVersionsMd(cwd)) + changelogEntry.content; const finalVersion = newVersion.split('-')[0]; diff --git a/packages/release-action/src/getMetadata.ts b/packages/release-action/src/getMetadata.ts new file mode 100644 index 000000000000..3c677b8e7774 --- /dev/null +++ b/packages/release-action/src/getMetadata.ts @@ -0,0 +1,41 @@ +import { readFile } from 'fs/promises'; +import path from 'path'; + +import { getExecOutput } from '@actions/exec'; + +import { readPackageJson } from './utils'; + +export async function getMongoVersion(cwd: string) { + try { + const workflows = await readFile(path.join(cwd, '.github/workflows/ci.yml'), 'utf8'); + + const mongoMatch = workflows.match(/compatibleMongoVersions\\": \[([^\]]+)\]/); + if (!mongoMatch) { + return []; + } + + return mongoMatch[1].replace(/["'\\ ]/g, '').split(','); + } catch (e) { + console.error(e); + } + return []; +} + +export async function getNodeNpmVersions(cwd: string): Promise<{ node: string; yarn: string; npm: string }> { + const packageJson = await readPackageJson(cwd); + + return packageJson.engines; +} + +export async function getAppsEngineVersion() { + try { + const result = await getExecOutput('yarn why @rocket.chat/apps-engine --json'); + + const match = result.stdout.match(/"@rocket\.chat\/meteor@workspace:apps\/meteor".*"@rocket\.chat\/apps\-engine@[^#]+#npm:([^"]+)"/); + if (match) { + return match[1]; + } + } catch (e) { + console.error(e); + } +} diff --git a/packages/release-action/src/publishRelease.ts b/packages/release-action/src/publishRelease.ts index d418e857736e..c712b8a7681a 100644 --- a/packages/release-action/src/publishRelease.ts +++ b/packages/release-action/src/publishRelease.ts @@ -7,7 +7,7 @@ import * as core from '@actions/core'; import { createNpmFile } from './createNpmFile'; import { setupOctokit } from './setupOctokit'; -import { bumpFileVersions, createBumpFile, getChangelogEntry, readPackageJson } from './utils'; +import { bumpFileVersions, createBumpFile, getChangelogEntry, getEngineVersionsMd, readPackageJson } from './utils'; import { fixWorkspaceVersionsBeforePublish } from './fixWorkspaceVersionsBeforePublish'; import { checkoutBranch, commitChanges, createTag, getCurrentBranch, mergeBranch, pushChanges } from './gitUtils'; @@ -73,7 +73,7 @@ export async function publishRelease({ throw new Error('Could not find changelog entry for version newVersion'); } - const releaseBody = changelogEntry.content; + const releaseBody = (await getEngineVersionsMd(cwd)) + changelogEntry.content; core.info('update version in all files to new'); await bumpFileVersions(cwd, currentVersion, newVersion); diff --git a/packages/release-action/src/utils.ts b/packages/release-action/src/utils.ts index d82098e7a19f..c8c72f4f36a6 100644 --- a/packages/release-action/src/utils.ts +++ b/packages/release-action/src/utils.ts @@ -6,6 +6,8 @@ import remarkParse from 'remark-parse'; import remarkStringify from 'remark-stringify'; import mdastToString from 'mdast-util-to-string'; +import { getAppsEngineVersion, getMongoVersion, getNodeNpmVersions } from './getMetadata'; + export const BumpLevels = { dep: 0, patch: 1, @@ -103,3 +105,17 @@ Bump ${pkgName} version. await writeFile(filePath, data, 'utf8'); } + +export async function getEngineVersionsMd(cwd: string) { + const { node } = await getNodeNpmVersions(cwd); + const appsEngine = await getAppsEngineVersion(); + const mongo = await getMongoVersion(cwd); + + return `### Engine versions + +- Node: \`${node}\` +- MongoDB: \`${mongo.join(', ')}\` +- Apps-Engine: \`${appsEngine}\` + +`; +} From f25081bc8a50a27b2ccde130ffe8d805475d3f8b Mon Sep 17 00:00:00 2001 From: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com> Date: Thu, 31 Aug 2023 13:54:59 -0300 Subject: [PATCH 040/275] [FIX] Never-used imported accounts can be accessed without proper authentication. (#670) --- .changeset/ten-games-roll.md | 5 +++++ apps/meteor/server/methods/registerUser.ts | 10 +--------- 2 files changed, 6 insertions(+), 9 deletions(-) create mode 100644 .changeset/ten-games-roll.md diff --git a/.changeset/ten-games-roll.md b/.changeset/ten-games-roll.md new file mode 100644 index 000000000000..883ce6260bcb --- /dev/null +++ b/.changeset/ten-games-roll.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Removed an unused authentication flow diff --git a/apps/meteor/server/methods/registerUser.ts b/apps/meteor/server/methods/registerUser.ts index 535203f3369f..2463e9ccacb4 100644 --- a/apps/meteor/server/methods/registerUser.ts +++ b/apps/meteor/server/methods/registerUser.ts @@ -95,15 +95,7 @@ Meteor.methods({ let userId; try { - // Check if user has already been imported and never logged in. If so, set password and let it through - const importedUser = await Users.findOneByEmailAddress(formData.email); - - if (importedUser?.importIds?.length && !importedUser.lastLogin) { - await Accounts.setPasswordAsync(importedUser._id, userData.password); - userId = importedUser._id; - } else { - userId = await Accounts.createUserAsync(userData); - } + userId = await Accounts.createUserAsync(userData); } catch (e) { if (e instanceof Meteor.Error) { throw e; From 8a59855fcf622cb9787d9d37f7e3dc30d67958ff Mon Sep 17 00:00:00 2001 From: Heitor Tanoue <68477006+heitortanoue@users.noreply.github.com> Date: Thu, 31 Aug 2023 15:28:50 -0300 Subject: [PATCH 041/275] fix: Unmuting users on average rooms allows them to speak if room is later set as read-only (#30050) Co-authored-by: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com> --- .changeset/fair-cats-destroy.md | 6 +++++ .../federation/server/endpoints/dispatch.js | 4 +-- apps/meteor/server/methods/muteUserInRoom.ts | 6 ++++- .../meteor/server/methods/unmuteUserInRoom.ts | 6 ++++- apps/meteor/server/models/raw/Rooms.ts | 26 ++++++++++++++++++- .../model-typings/src/models/IRoomsModel.ts | 4 ++- 6 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 .changeset/fair-cats-destroy.md diff --git a/.changeset/fair-cats-destroy.md b/.changeset/fair-cats-destroy.md new file mode 100644 index 000000000000..7dfb74955a94 --- /dev/null +++ b/.changeset/fair-cats-destroy.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": patch +"@rocket.chat/model-typings": patch +--- + +When setting a room as read-only, do not allow previously unmuted users to send messages. diff --git a/apps/meteor/app/federation/server/endpoints/dispatch.js b/apps/meteor/app/federation/server/endpoints/dispatch.js index cf9e91b44af9..59ffcb0f342f 100644 --- a/apps/meteor/app/federation/server/endpoints/dispatch.js +++ b/apps/meteor/app/federation/server/endpoints/dispatch.js @@ -457,8 +457,8 @@ const eventHandlers = { // Denormalize user const denormalizedUser = normalizers.denormalizeUser(user); - // Mute user - await Rooms.unmuteUsernameByRoomId(roomId, denormalizedUser.username); + // Unmute user + await Rooms.unmuteMutedUsernameByRoomId(roomId, denormalizedUser.username); } return eventResult; diff --git a/apps/meteor/server/methods/muteUserInRoom.ts b/apps/meteor/server/methods/muteUserInRoom.ts index eac10e320ead..90e4b61a57ed 100644 --- a/apps/meteor/server/methods/muteUserInRoom.ts +++ b/apps/meteor/server/methods/muteUserInRoom.ts @@ -65,7 +65,11 @@ export const muteUserInRoom = async (fromId: string, data: { rid: IRoom['_id']; await callbacks.run('beforeMuteUser', { mutedUser, fromUser }, room); - await Rooms.muteUsernameByRoomId(data.rid, mutedUser.username); + if (room.ro) { + await Rooms.muteReadOnlyUsernameByRoomId(data.rid, mutedUser.username); + } else { + await Rooms.muteUsernameByRoomId(data.rid, mutedUser.username); + } await Message.saveSystemMessage('user-muted', data.rid, mutedUser.username, fromUser); diff --git a/apps/meteor/server/methods/unmuteUserInRoom.ts b/apps/meteor/server/methods/unmuteUserInRoom.ts index 991e66840ca8..d9e65815fd11 100644 --- a/apps/meteor/server/methods/unmuteUserInRoom.ts +++ b/apps/meteor/server/methods/unmuteUserInRoom.ts @@ -65,7 +65,11 @@ export const unmuteUserInRoom = async (fromId: string, data: { rid: IRoom['_id'] await callbacks.run('beforeUnmuteUser', { unmutedUser, fromUser }, room); - await Rooms.unmuteUsernameByRoomId(data.rid, unmutedUser.username); + if (room.ro) { + await Rooms.unmuteReadOnlyUsernameByRoomId(data.rid, unmutedUser.username); + } else { + await Rooms.unmuteMutedUsernameByRoomId(data.rid, unmutedUser.username); + } await Message.saveSystemMessage('user-unmuted', data.rid, unmutedUser.username, fromUser); diff --git a/apps/meteor/server/models/raw/Rooms.ts b/apps/meteor/server/models/raw/Rooms.ts index 10fad0f436eb..9dad0fa60da3 100644 --- a/apps/meteor/server/models/raw/Rooms.ts +++ b/apps/meteor/server/models/raw/Rooms.ts @@ -1708,9 +1708,33 @@ export class RoomsRaw extends BaseRaw implements IRoomsModel { return this.updateOne(query, update); } - unmuteUsernameByRoomId(_id: IRoom['_id'], username: IUser['username']): Promise { + muteReadOnlyUsernameByRoomId(_id: IRoom['_id'], username: IUser['username']): Promise { + const query: Filter = { _id, ro: true }; + + const update: UpdateFilter = { + $pull: { + unmuted: username, + }, + }; + + return this.updateOne(query, update); + } + + unmuteMutedUsernameByRoomId(_id: IRoom['_id'], username: IUser['username']): Promise { const query: Filter = { _id }; + const update: UpdateFilter = { + $pull: { + muted: username, + }, + }; + + return this.updateOne(query, update); + } + + unmuteReadOnlyUsernameByRoomId(_id: string, username: string): Promise { + const query: Filter = { _id, ro: true }; + const update: UpdateFilter = { $pull: { muted: username, diff --git a/packages/model-typings/src/models/IRoomsModel.ts b/packages/model-typings/src/models/IRoomsModel.ts index a0053d7ea7ba..de0cf9d10f96 100644 --- a/packages/model-typings/src/models/IRoomsModel.ts +++ b/packages/model-typings/src/models/IRoomsModel.ts @@ -251,7 +251,9 @@ export interface IRoomsModel extends IBaseModel { ): Promise; setCustomFieldsById(rid: string, customFields: Record): Promise; muteUsernameByRoomId(rid: string, username: string): Promise; - unmuteUsernameByRoomId(rid: string, username: string): Promise; + muteReadOnlyUsernameByRoomId(rid: string, username: string): Promise; + unmuteMutedUsernameByRoomId(rid: string, username: string): Promise; + unmuteReadOnlyUsernameByRoomId(rid: string, username: string): Promise; saveFeaturedById(rid: string, featured: boolean): Promise; saveDefaultById(rid: string, defaultValue: boolean): Promise; saveFavoriteById(rid: string, favorite: boolean, defaultValue: boolean): Promise; From 761cad43828ff3d90cda1836254c5db82004a7b1 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Thu, 31 Aug 2023 15:58:54 -0300 Subject: [PATCH 042/275] fix: CORS not being set for assets (#30237) --- .changeset/shiny-garlics-carry.md | 5 +++++ apps/meteor/app/cors/server/cors.ts | 2 +- apps/meteor/tests/end-to-end/api/32-assets.ts | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .changeset/shiny-garlics-carry.md create mode 100644 apps/meteor/tests/end-to-end/api/32-assets.ts diff --git a/.changeset/shiny-garlics-carry.md b/.changeset/shiny-garlics-carry.md new file mode 100644 index 000000000000..117063d93f6f --- /dev/null +++ b/.changeset/shiny-garlics-carry.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fix CORS headers not being set for assets diff --git a/apps/meteor/app/cors/server/cors.ts b/apps/meteor/app/cors/server/cors.ts index 69a0b557ee64..03a42e45a17b 100644 --- a/apps/meteor/app/cors/server/cors.ts +++ b/apps/meteor/app/cors/server/cors.ts @@ -79,7 +79,7 @@ WebApp.rawConnectHandlers.use((_req: http.IncomingMessage, res: http.ServerRespo const _staticFilesMiddleware = WebAppInternals.staticFilesMiddleware; // @ts-expect-error - accessing internal property of webapp -WebAppInternals._staticFilesMiddleware = function ( +WebAppInternals.staticFilesMiddleware = function ( staticFiles: StaticFiles, req: http.IncomingMessage, res: http.ServerResponse, diff --git a/apps/meteor/tests/end-to-end/api/32-assets.ts b/apps/meteor/tests/end-to-end/api/32-assets.ts new file mode 100644 index 000000000000..76c24a99765b --- /dev/null +++ b/apps/meteor/tests/end-to-end/api/32-assets.ts @@ -0,0 +1,17 @@ +import { describe, it } from 'mocha'; + +import { request } from '../../data/api-data.js'; + +describe('assets', function () { + this.retries(0); + + it('should always have CORS headers for assets', async () => { + await request.get('/assets/favicon.svg').expect('Content-Type', 'image/svg+xml').expect('Access-Control-Allow-Origin', '*').expect(200); + + await request + .get('/fonts/rocketchat.woff2') + .expect('Content-Type', 'font/woff2') + .expect('Access-Control-Allow-Origin', '*') + .expect(200); + }); +}); From ded9666f27d6ca8e617d28368d61f9804cc4c1df Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Thu, 31 Aug 2023 15:58:54 -0300 Subject: [PATCH 043/275] fix: CORS not being set for assets (#30237) --- .changeset/shiny-garlics-carry.md | 5 +++++ apps/meteor/app/cors/server/cors.ts | 2 +- apps/meteor/tests/end-to-end/api/32-assets.ts | 17 +++++++++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .changeset/shiny-garlics-carry.md create mode 100644 apps/meteor/tests/end-to-end/api/32-assets.ts diff --git a/.changeset/shiny-garlics-carry.md b/.changeset/shiny-garlics-carry.md new file mode 100644 index 000000000000..117063d93f6f --- /dev/null +++ b/.changeset/shiny-garlics-carry.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fix CORS headers not being set for assets diff --git a/apps/meteor/app/cors/server/cors.ts b/apps/meteor/app/cors/server/cors.ts index 534a65aa6d95..a3a585585fe4 100644 --- a/apps/meteor/app/cors/server/cors.ts +++ b/apps/meteor/app/cors/server/cors.ts @@ -79,7 +79,7 @@ WebApp.rawConnectHandlers.use(function (_req: http.IncomingMessage, res: http.Se const _staticFilesMiddleware = WebAppInternals.staticFilesMiddleware; // @ts-expect-error - accessing internal property of webapp -WebAppInternals._staticFilesMiddleware = function ( +WebAppInternals.staticFilesMiddleware = function ( staticFiles: StaticFiles, req: http.IncomingMessage, res: http.ServerResponse, diff --git a/apps/meteor/tests/end-to-end/api/32-assets.ts b/apps/meteor/tests/end-to-end/api/32-assets.ts new file mode 100644 index 000000000000..76c24a99765b --- /dev/null +++ b/apps/meteor/tests/end-to-end/api/32-assets.ts @@ -0,0 +1,17 @@ +import { describe, it } from 'mocha'; + +import { request } from '../../data/api-data.js'; + +describe('assets', function () { + this.retries(0); + + it('should always have CORS headers for assets', async () => { + await request.get('/assets/favicon.svg').expect('Content-Type', 'image/svg+xml').expect('Access-Control-Allow-Origin', '*').expect(200); + + await request + .get('/fonts/rocketchat.woff2') + .expect('Content-Type', 'font/woff2') + .expect('Access-Control-Allow-Origin', '*') + .expect(200); + }); +}); From 5321e873634e9037c805ce135cf7cf37cc3de187 Mon Sep 17 00:00:00 2001 From: Rafael Tapia Date: Thu, 31 Aug 2023 16:32:38 -0300 Subject: [PATCH 044/275] fix: seat counter including bots (#30216) --- .changeset/moody-pans-act.md | 5 +++++ apps/meteor/server/models/raw/Users.js | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/moody-pans-act.md diff --git a/.changeset/moody-pans-act.md b/.changeset/moody-pans-act.md new file mode 100644 index 000000000000..6c307604eaa9 --- /dev/null +++ b/.changeset/moody-pans-act.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fix seat counter including bots users diff --git a/apps/meteor/server/models/raw/Users.js b/apps/meteor/server/models/raw/Users.js index 03c3ab2769c9..dc3441092892 100644 --- a/apps/meteor/server/models/raw/Users.js +++ b/apps/meteor/server/models/raw/Users.js @@ -2921,13 +2921,13 @@ export class UsersRaw extends BaseRaw { this.col.countDocuments({ active: true, }), - // Count all active that are guests, apps or federated + // Count all active that are guests, apps, bots or federated // Fast based on indexes, usually based on guest index as is usually small this.col.countDocuments({ active: true, - $or: [{ roles: ['guest'] }, { type: 'app' }, { federated: true }, { isRemote: true }], + $or: [{ roles: ['guest'] }, { type: { $in: ['app', 'bot'] } }, { federated: true }, { isRemote: true }], }), - // Get all active and remove the guests, apps, federated, etc + // Get all active and remove the guests, apps, bots and federated ]).then((results) => results.reduce((a, b) => a - b)); } From 01dec055a0255f531824d3b9b74d31d75f3b6d97 Mon Sep 17 00:00:00 2001 From: Yash Rajpal <58601732+yash-rajpal@users.noreply.github.com> Date: Fri, 1 Sep 2023 02:07:04 +0530 Subject: [PATCH 045/275] regression: Accounts profile form name change not working (#30239) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .changeset/unlucky-turtles-search.md | 5 +++++ .../client/views/account/profile/AccountProfileForm.tsx | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/unlucky-turtles-search.md diff --git a/.changeset/unlucky-turtles-search.md b/.changeset/unlucky-turtles-search.md new file mode 100644 index 000000000000..fffa51020e30 --- /dev/null +++ b/.changeset/unlucky-turtles-search.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Fixed Accounts profile form name change was not working diff --git a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx index 14540220b7e4..4efa05e32da0 100644 --- a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx +++ b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx @@ -102,7 +102,7 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle try { await updateOwnBasicInfo( { - ...(allowRealNameChange ? { name } : {}), + ...(allowRealNameChange ? { realname: name } : {}), ...(allowEmailChange && user ? getUserEmailAddress(user) !== email && { email } : {}), ...(allowPasswordChange ? { newPassword: password } : {}), ...(canChangeUsername ? { username } : {}), From 3826f7e5f311e6a840e2e55d1256d40d25fc1482 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Thu, 31 Aug 2023 20:44:04 +0000 Subject: [PATCH 046/275] Release 6.3.3 [no ci] --- .changeset/bump-patch-1693432529972.md | 5 ---- .changeset/hip-hounds-ring.md | 5 ---- .changeset/moody-comics-cheat.md | 5 ---- .changeset/shiny-garlics-carry.md | 5 ---- .changeset/ten-games-roll.md | 5 ---- apps/meteor/.docker/Dockerfile.rhel | 2 +- apps/meteor/CHANGELOG.md | 28 +++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 10 +++++++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 10 +++++++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 10 +++++++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 12 ++++++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 11 ++++++++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 10 +++++++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 10 +++++++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 9 ++++++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 7 +++++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 7 +++++ ee/packages/ddp-client/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 11 ++++++++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 6 ++++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 8 ++++++ ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 8 ++++++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 2 ++ packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 7 +++++ packages/cron/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 8 ++++++ packages/fuselage-ui-kit/package.json | 6 ++-- packages/gazzodown/CHANGELOG.md | 8 ++++++ packages/gazzodown/package.json | 8 +++--- packages/instance-status/CHANGELOG.md | 6 ++++ packages/instance-status/package.json | 2 +- packages/model-typings/CHANGELOG.md | 6 ++++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 6 ++++ packages/models/package.json | 2 +- packages/release-action/CHANGELOG.md | 6 ++++ packages/release-action/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 6 ++++ packages/rest-typings/package.json | 2 +- packages/ui-client/CHANGELOG.md | 6 ++++ packages/ui-client/package.json | 4 +-- packages/ui-contexts/CHANGELOG.md | 8 ++++++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 6 ++++ packages/ui-video-conf/package.json | 4 +-- packages/uikit-playground/CHANGELOG.md | 7 +++++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 6 ++++ packages/web-ui-registration/package.json | 4 +-- 66 files changed, 285 insertions(+), 65 deletions(-) delete mode 100644 .changeset/bump-patch-1693432529972.md delete mode 100644 .changeset/hip-hounds-ring.md delete mode 100644 .changeset/moody-comics-cheat.md delete mode 100644 .changeset/shiny-garlics-carry.md delete mode 100644 .changeset/ten-games-roll.md diff --git a/.changeset/bump-patch-1693432529972.md b/.changeset/bump-patch-1693432529972.md deleted file mode 100644 index e1eaa7980afb..000000000000 --- a/.changeset/bump-patch-1693432529972.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Bump @rocket.chat/meteor version. diff --git a/.changeset/hip-hounds-ring.md b/.changeset/hip-hounds-ring.md deleted file mode 100644 index 79dfba6dd031..000000000000 --- a/.changeset/hip-hounds-ring.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Added ability to disable private app installation via envvar (DISABLE_PRIVATE_APP_INSTALLATION) diff --git a/.changeset/moody-comics-cheat.md b/.changeset/moody-comics-cheat.md deleted file mode 100644 index b8b372306d0e..000000000000 --- a/.changeset/moody-comics-cheat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/release-action': minor ---- - -Add back "Engine Versions" to the release notes diff --git a/.changeset/shiny-garlics-carry.md b/.changeset/shiny-garlics-carry.md deleted file mode 100644 index 117063d93f6f..000000000000 --- a/.changeset/shiny-garlics-carry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fix CORS headers not being set for assets diff --git a/.changeset/ten-games-roll.md b/.changeset/ten-games-roll.md deleted file mode 100644 index 883ce6260bcb..000000000000 --- a/.changeset/ten-games-roll.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Removed an unused authentication flow diff --git a/apps/meteor/.docker/Dockerfile.rhel b/apps/meteor/.docker/Dockerfile.rhel index e14192be4b5d..3354be3ef5d6 100644 --- a/apps/meteor/.docker/Dockerfile.rhel +++ b/apps/meteor/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 6.3.2 +ENV RC_VERSION 6.3.3 MAINTAINER buildmaster@rocket.chat diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index f79e4b224826..182d30ddabb9 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,33 @@ # @rocket.chat/meteor +## 6.3.3 + +### Patch Changes + +- bcf147f515: Bump @rocket.chat/meteor version. +- Bump @rocket.chat/meteor version. +- c2fe38cb34: Added ability to disable private app installation via envvar (DISABLE_PRIVATE_APP_INSTALLATION) +- ded9666f27: Fix CORS headers not being set for assets +- f25081bc8a: Removed an unused authentication flow + - @rocket.chat/core-typings@6.3.3 + - @rocket.chat/rest-typings@6.3.3 + - @rocket.chat/api-client@0.1.3 + - @rocket.chat/omnichannel-services@0.0.9 + - @rocket.chat/pdf-worker@0.0.9 + - @rocket.chat/presence@0.0.9 + - @rocket.chat/core-services@0.1.3 + - @rocket.chat/cron@0.0.5 + - @rocket.chat/gazzodown@1.0.3 + - @rocket.chat/model-typings@0.0.9 + - @rocket.chat/ui-contexts@1.0.3 + - @rocket.chat/fuselage-ui-kit@1.0.3 + - @rocket.chat/models@0.0.9 + - @rocket.chat/ui-theming@0.0.1 + - @rocket.chat/ui-client@1.0.3 + - @rocket.chat/ui-video-conf@1.0.3 + - @rocket.chat/web-ui-registration@1.0.3 + - @rocket.chat/instance-status@0.0.9 + ## 6.3.2 ### Patch Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index 8f6924c05df6..5dfa1f853b47 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.3.2" + "version": "6.3.3" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index 4752bbfc2387..c9759c95b0af 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,15 @@ # rocketchat-services +## 1.1.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/rest-typings@6.3.3 +- @rocket.chat/core-services@0.1.3 +- @rocket.chat/model-typings@0.0.9 +- @rocket.chat/models@0.0.9 + ## 1.1.2 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index a56021bd5476..944f9a463c30 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.2", + "version": "1.1.3", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 169ab5f9b9f7..8e6b64d735ef 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.3.2", + "version": "6.3.3", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index fe01147f8704..67bb7a8164f5 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/account-service +## 0.2.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/rest-typings@6.3.3 +- @rocket.chat/core-services@0.1.3 +- @rocket.chat/model-typings@0.0.9 +- @rocket.chat/models@0.0.9 + ## 0.2.2 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index e90407d2f305..e85e9da0a40a 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.2.2", + "version": "0.2.3", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index c56c6d10a6ea..882144f1602f 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/authorization-service +## 0.2.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/rest-typings@6.3.3 +- @rocket.chat/core-services@0.1.3 +- @rocket.chat/model-typings@0.0.9 +- @rocket.chat/models@0.0.9 + ## 0.2.2 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index 7baefffdc21b..dba72198c2cd 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.2.2", + "version": "0.2.3", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index 6e15ad002fea..242f5b517039 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/ddp-streamer +## 0.1.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/rest-typings@6.3.3 +- @rocket.chat/core-services@0.1.3 +- @rocket.chat/model-typings@0.0.9 +- @rocket.chat/ui-contexts@1.0.3 +- @rocket.chat/models@0.0.9 +- @rocket.chat/instance-status@0.0.9 + ## 0.1.2 ### Patch Changes diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 0a44315c98b0..230865187241 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.1.2", + "version": "0.1.3", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index 38a18f743624..f7de2c547ab0 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-transcript +## 0.2.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/omnichannel-services@0.0.9 +- @rocket.chat/pdf-worker@0.0.9 +- @rocket.chat/core-services@0.1.3 +- @rocket.chat/model-typings@0.0.9 +- @rocket.chat/models@0.0.9 + ## 0.2.2 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index 2c71e8094528..2554f60ebab3 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.2.2", + "version": "0.2.3", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index 0cca9a024ae6..5bb3ef39b101 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/presence-service +## 0.2.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/presence@0.0.9 +- @rocket.chat/core-services@0.1.3 +- @rocket.chat/model-typings@0.0.9 +- @rocket.chat/models@0.0.9 + ## 0.2.2 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index cac74f8d74b0..737a831fef2d 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.2.2", + "version": "0.2.3", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index 941c23bb500a..1490afbb40ab 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/queue-worker +## 0.2.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/omnichannel-services@0.0.9 +- @rocket.chat/core-services@0.1.3 +- @rocket.chat/model-typings@0.0.9 +- @rocket.chat/models@0.0.9 + ## 0.2.2 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index 396f38927415..fe2e2cf285d7 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.2.2", + "version": "0.2.3", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index fb3c7cfbaa93..6af9dfb7b0e0 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/stream-hub-service +## 0.2.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/core-services@0.1.3 +- @rocket.chat/model-typings@0.0.9 +- @rocket.chat/models@0.0.9 + ## 0.2.2 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index 617e956b5db8..f9f47bd2f25b 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.2.2", + "version": "0.2.3", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index 876504a2d52b..030d8cae3b99 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/api-client +## 0.1.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/rest-typings@6.3.3 + ## 0.1.2 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index bc2711fe0839..10ca54425b42 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/api-client", - "version": "0.1.2", + "version": "0.1.3", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index 33071a0c207c..6a656d38a488 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/ddp-client +## 0.1.3 + +### Patch Changes + +- @rocket.chat/rest-typings@6.3.3 +- @rocket.chat/api-client@0.1.3 + ## 0.1.2 ### Patch Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index fd8e6b5c5a44..eb42619f9161 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ddp-client", - "version": "0.1.2", + "version": "0.1.3", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index 776e700d87b6..c141b4205af5 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-services +## 0.0.9 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/rest-typings@6.3.3 +- @rocket.chat/pdf-worker@0.0.9 +- @rocket.chat/core-services@0.1.3 +- @rocket.chat/model-typings@0.0.9 +- @rocket.chat/models@0.0.9 + ## 0.0.8 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 2275fea8a415..a81f3397031a 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.0.8", + "version": "0.0.9", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index 2853ae79e061..bf50d15ae71b 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/pdf-worker +## 0.0.9 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 + ## 0.0.8 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index af3fdd404579..a3c2dc78c4c5 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.8", + "version": "0.0.9", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index 9cb69013abaa..1ed57117b68e 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/presence +## 0.0.9 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/core-services@0.1.3 +- @rocket.chat/models@0.0.9 + ## 0.0.8 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index a1d3bc29c4cc..0d1ff4a5b7bc 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.0.8", + "version": "0.0.9", "private": true, "devDependencies": { "@babel/core": "~7.22.5", diff --git a/package.json b/package.json index 3964cde06c27..714a0c87d130 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.3.2", + "version": "6.3.3", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index b3d2bfd937c5..07a137608d92 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/core-services +## 0.1.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/rest-typings@6.3.3 +- @rocket.chat/models@0.0.9 + ## 0.1.2 ### Patch Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 62c995718460..d3629f688c58 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.1.2", + "version": "0.1.3", "private": true, "devDependencies": { "@babel/core": "^7.21.4", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index 05fa92d17d54..5e6880b649a4 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,7 @@ # @rocket.chat/core-typings +## 6.3.3 + ## 6.3.2 ## 6.3.1 diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index ed3ee6d6bd33..1710424e83e2 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-typings", - "version": "6.3.2", + "version": "6.3.3", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.43.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index 6a505427f51a..44b205dda1e7 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/cron +## 0.0.5 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/models@0.0.9 + ## 0.0.4 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index 0c1d39329150..53c610b82b14 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.4", + "version": "0.0.5", "private": true, "devDependencies": { "@types/jest": "^27.4.1", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index 9093a1b0a79f..6d52e9064b16 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 1.0.3 + +### Patch Changes + +- @rocket.chat/gazzodown@1.0.3 +- @rocket.chat/ui-contexts@1.0.3 +- @rocket.chat/ui-video-conf@1.0.3 + ## 1.0.2 ### Patch Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index b873255504e9..e0eb2d4624bb 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "1.0.2", + "version": "1.0.3", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -47,9 +47,9 @@ "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "1.0.2", + "@rocket.chat/ui-contexts": "1.0.3", "@rocket.chat/ui-kit": "*", - "@rocket.chat/ui-video-conf": "1.0.2", + "@rocket.chat/ui-video-conf": "1.0.3", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index b1403cc5bfc2..88c0f11d0cdb 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/gazzodown +## 1.0.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/ui-contexts@1.0.3 +- @rocket.chat/ui-client@1.0.3 + ## 1.0.2 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index c0e4d97b3695..4661ffb98c46 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "1.0.2", + "version": "1.0.3", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.3.2", + "@rocket.chat/core-typings": "6.3.3", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "1.0.2", - "@rocket.chat/ui-contexts": "1.0.2", + "@rocket.chat/ui-client": "1.0.3", + "@rocket.chat/ui-contexts": "1.0.3", "katex": "*", "react": "*" }, diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index f794ae07ccd5..1b5dfc94f624 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/instance-status +## 0.0.9 + +### Patch Changes + +- @rocket.chat/models@0.0.9 + ## 0.0.8 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 2b09a5bca106..7f303b5de07a 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.8", + "version": "0.0.9", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index 0742974545e7..1d89b9145bc4 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/model-typings +## 0.0.9 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 + ## 0.0.8 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index 85c6e357f825..66233a200eff 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.0.8", + "version": "0.0.9", "private": true, "devDependencies": { "@types/jest": "~29.5.2", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index 9780e7f3cae2..c8249a587d15 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/models +## 0.0.9 + +### Patch Changes + +- @rocket.chat/model-typings@0.0.9 + ## 0.0.8 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index 9e0d2585749c..177119796cdb 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.8", + "version": "0.0.9", "private": true, "devDependencies": { "@types/jest": "~29.5.2", diff --git a/packages/release-action/CHANGELOG.md b/packages/release-action/CHANGELOG.md index ba541529faf4..ee73fe152636 100644 --- a/packages/release-action/CHANGELOG.md +++ b/packages/release-action/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/release-action +## 2.1.0 + +### Minor Changes + +- a56f5f0a5f: Add back "Engine Versions" to the release notes + ## 2.0.0 ### Major Changes diff --git a/packages/release-action/package.json b/packages/release-action/package.json index 0786d45ae40b..6e5f7866f060 100644 --- a/packages/release-action/package.json +++ b/packages/release-action/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/release-action", - "version": "2.0.0", + "version": "2.1.0", "private": true, "scripts": { "build": "tsc", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index 1b2b9d1c1c83..9c5aa19f1b07 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/rest-typings +## 6.3.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 + ## 6.3.2 ### Patch Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 7eedce13ae47..074ee532f019 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/rest-typings", - "version": "6.3.2", + "version": "6.3.3", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.2", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index 45375c1921b2..497a40137ee5 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-client +## 1.0.3 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.3 + ## 1.0.2 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index edbde8cbf606..7077c8d1f3be 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "1.0.2", + "version": "1.0.3", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -53,7 +53,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "1.0.2", + "@rocket.chat/ui-contexts": "1.0.3", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index 56918d125358..0be8b831d56b 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/ui-contexts +## 1.0.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.3 +- @rocket.chat/rest-typings@6.3.3 +- @rocket.chat/ddp-client@0.1.3 + ## 1.0.2 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index e7ff60702a83..1cd3f7f1daca 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "1.0.2", + "version": "1.0.3", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index 8885f9da62a8..b5408f61908a 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-video-conf +## 1.0.3 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.3 + ## 1.0.2 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index 13250d3e120f..31d3b9f1be45 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "1.0.2", + "version": "1.0.3", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "1.0.2", + "@rocket.chat/ui-contexts": "1.0.3", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index 57609de64f8f..852e0fe95baf 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/uikit-playground +## 0.1.3 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.3 +- @rocket.chat/fuselage-ui-kit@1.0.3 + ## 0.1.2 ### Patch Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index f1ba3f1d089f..feb99612a5ab 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.1.2", + "version": "0.1.3", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index 4555ca4e502b..cf000c3483bc 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/web-ui-registration +## 1.0.3 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.3 + ## 1.0.2 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index dd6b03f28750..fb929cc0fa5e 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "1.0.2", + "version": "1.0.3", "private": true, "devDependencies": { "@rocket.chat/layout": "next", @@ -17,7 +17,7 @@ }, "peerDependencies": { "@rocket.chat/layout": "*", - "@rocket.chat/ui-contexts": "1.0.2", + "@rocket.chat/ui-contexts": "1.0.3", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", From 8e58c2b5abbd24e8f55439d7271d7db2794ee9e0 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Thu, 31 Aug 2023 18:01:56 -0300 Subject: [PATCH 047/275] regression: fix import --- packages/release-action/src/utils.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/packages/release-action/src/utils.ts b/packages/release-action/src/utils.ts index fb5dd128d8a1..2501ae859339 100644 --- a/packages/release-action/src/utils.ts +++ b/packages/release-action/src/utils.ts @@ -8,8 +8,6 @@ import unified from 'unified'; import { getAppsEngineVersion, getMongoVersion, getNodeNpmVersions } from './getMetadata'; -import { getAppsEngineVersion, getMongoVersion, getNodeNpmVersions } from './getMetadata'; - export const BumpLevels = { dep: 0, patch: 1, From e7fbc009650910ca3560d798b54cbe90ff8f0f2e Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Thu, 31 Aug 2023 15:37:36 -0600 Subject: [PATCH 048/275] fix: On Unlock, queue room again (#30150) --- apps/meteor/server/models/raw/LivechatInquiry.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/meteor/server/models/raw/LivechatInquiry.ts b/apps/meteor/server/models/raw/LivechatInquiry.ts index bb1d386cf236..191a017244ac 100644 --- a/apps/meteor/server/models/raw/LivechatInquiry.ts +++ b/apps/meteor/server/models/raw/LivechatInquiry.ts @@ -172,13 +172,16 @@ export class LivechatInquiryRaw extends BaseRaw implemen } async unlock(inquiryId: string): Promise { - return this.updateOne({ _id: inquiryId }, { $unset: { locked: 1, lockedAt: 1 } }); + return this.updateOne( + { _id: inquiryId }, + { $unset: { locked: 1, lockedAt: 1 }, $set: { status: LivechatInquiryStatus.QUEUED, queuedAt: new Date() } }, + ); } async unlockAll(): Promise { return this.updateMany( { $or: [{ lockedAt: { $exists: true } }, { locked: { $exists: true } }] }, - { $unset: { locked: 1, lockedAt: 1 } }, + { $unset: { locked: 1, lockedAt: 1 }, $set: { status: LivechatInquiryStatus.QUEUED, queuedAt: new Date() } }, ); } From b8f3d5014f6843babdb5c3241131886827c70dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrique=20Guimar=C3=A3es=20Ribeiro?= Date: Fri, 1 Sep 2023 10:12:33 -0300 Subject: [PATCH 049/275] fix: Login page language switcher (#30106) Co-authored-by: Tasso Evangelista <2263066+tassoevan@users.noreply.github.com> --- .changeset/wise-onions-trade.md | 11 + ...f8829189deb00553559ff63.0-b31cc57c40.patch | 130 ++ .../theme/client/imports/general/base_old.css | 4 - apps/meteor/app/utils/lib/i18n.ts | 4 +- .../client/providers/TranslationProvider.tsx | 7 +- .../providers/UserProvider/UserProvider.tsx | 17 +- .../header/actions/hooks/mockAppRoot.tsx | 355 --- .../contexts/TranslationContextMock.tsx | 1 + apps/meteor/package.json | 6 +- .../rocketchat-i18n/i18n/en.i18n.json | 2 +- .../rocketchat-i18n/i18n/fi.i18n.json | 4 +- .../rocketchat-i18n/i18n/hu.i18n.json | 4 +- .../rocketchat-i18n/i18n/sv.i18n.json | 4 +- apps/meteor/server/lib/i18n.ts | 1 + package.json | 3 +- packages/i18n/babel.config.cjs | 2 +- packages/i18n/package.json | 11 +- packages/i18n/tsconfig.json | 9 - packages/livechat/package.json | 6 +- .../src/components/Calls/CallNotification.tsx | 5 +- .../src/components/Calls/JoinCallButton.tsx | 5 +- packages/mock-providers/package.json | 6 + .../src/MockedAppRootBuilder.tsx | 193 +- packages/ui-client/package.json | 2 +- .../PasswordVerifiers.spec.tsx | 9 - .../ui-contexts/src/TranslationContext.ts | 2 + packages/web-ui-registration/.babelrc.json | 7 + .../web-ui-registration/.storybook/logo.svg | 47 + .../.storybook/logo.svg.d.ts | 3 + .../web-ui-registration/.storybook/main.ts | 12 + .../.storybook/preview.tsx | 36 + packages/web-ui-registration/package.json | 48 +- .../ResetPassword/ResetPassword.stories.tsx | 6 +- .../LoginSwitchLanguageFooter.stories.tsx | 42 + .../components/LoginSwitchLanguageFooter.tsx | 94 +- .../web-ui-registration/tsconfig.build.json | 8 + packages/web-ui-registration/tsconfig.json | 7 +- yarn.lock | 2080 ++++++++++++----- 38 files changed, 2125 insertions(+), 1068 deletions(-) create mode 100644 .changeset/wise-onions-trade.md create mode 100644 .yarn/patches/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40.patch delete mode 100644 apps/meteor/client/sidebar/header/actions/hooks/mockAppRoot.tsx delete mode 100644 packages/i18n/tsconfig.json create mode 100644 packages/web-ui-registration/.babelrc.json create mode 100644 packages/web-ui-registration/.storybook/logo.svg create mode 100644 packages/web-ui-registration/.storybook/logo.svg.d.ts create mode 100644 packages/web-ui-registration/.storybook/main.ts create mode 100644 packages/web-ui-registration/.storybook/preview.tsx create mode 100644 packages/web-ui-registration/src/components/LoginSwitchLanguageFooter.stories.tsx create mode 100644 packages/web-ui-registration/tsconfig.build.json diff --git a/.changeset/wise-onions-trade.md b/.changeset/wise-onions-trade.md new file mode 100644 index 000000000000..cb5c731fb6fb --- /dev/null +++ b/.changeset/wise-onions-trade.md @@ -0,0 +1,11 @@ +--- +"@rocket.chat/meteor": patch +"@rocket.chat/i18n": patch +"@rocket.chat/livechat": patch +"@rocket.chat/mock-providers": patch +"@rocket.chat/ui-client": patch +"@rocket.chat/ui-contexts": patch +"@rocket.chat/web-ui-registration": patch +--- + +Fixed the login page language switcher, now the component has a new look, is reactive and the language selection becomes concrete upon login in. Also changed the default language of the login page to be the browser language. diff --git a/.yarn/patches/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40.patch b/.yarn/patches/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40.patch new file mode 100644 index 000000000000..ca069ee350c0 --- /dev/null +++ b/.yarn/patches/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40.patch @@ -0,0 +1,130 @@ +diff --git a/dist/generateDocgenCodeBlock.js b/dist/generateDocgenCodeBlock.js +index 0993ac13e4b2aae6d24cf408d6a585b4ddeb7337..1405896291288eb1322d6c42144afd3b4fbd1abf 100644 +--- a/dist/generateDocgenCodeBlock.js ++++ b/dist/generateDocgenCodeBlock.js +@@ -34,7 +34,7 @@ function insertTsIgnoreBeforeStatement(statement) { + * ``` + */ + function setDisplayName(d) { +- return insertTsIgnoreBeforeStatement(typescript_1.default.createExpressionStatement(typescript_1.default.createBinary(typescript_1.default.createPropertyAccess(typescript_1.default.createIdentifier(d.displayName), typescript_1.default.createIdentifier("displayName")), typescript_1.default.SyntaxKind.EqualsToken, typescript_1.default.createLiteral(d.displayName)))); ++ return insertTsIgnoreBeforeStatement(typescript_1.default.factory.createExpressionStatement(typescript_1.default.factory.createBinaryExpression(typescript_1.default.factory.createPropertyAccessExpression(typescript_1.default.factory.createIdentifier(d.displayName), typescript_1.default.factory.createIdentifier("displayName")), typescript_1.default.SyntaxKind.EqualsToken, typescript_1.default.factory.createStringLiteral(d.displayName)))); + } + /** + * Set a component prop description. +@@ -65,7 +65,7 @@ function createPropDefinition(propName, prop, options) { + * + * @param defaultValue Default prop value or null if not set. + */ +- const setDefaultValue = (defaultValue) => typescript_1.default.createPropertyAssignment(typescript_1.default.createLiteral("defaultValue"), ++ const setDefaultValue = (defaultValue) => typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createStringLiteral("defaultValue"), + // Use a more extensive check on defaultValue. Sometimes the parser + // returns an empty object. + defaultValue !== null && +@@ -75,12 +75,19 @@ function createPropDefinition(propName, prop, options) { + (typeof defaultValue.value === "string" || + typeof defaultValue.value === "number" || + typeof defaultValue.value === "boolean") +- ? typescript_1.default.createObjectLiteral([ +- typescript_1.default.createPropertyAssignment(typescript_1.default.createIdentifier("value"), typescript_1.default.createLiteral(defaultValue.value)), ++ ? typescript_1.default.factory.createObjectLiteralExpression([ ++ typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createIdentifier("value"), typeof defaultValue.value === "string" ++ ? typescript_1.default.factory.createStringLiteral(defaultValue.value) ++ : // eslint-disable-next-line no-nested-ternary ++ typeof defaultValue.value === "number" ++ ? typescript_1.default.factory.createNumericLiteral(defaultValue.value) ++ : defaultValue.value ++ ? typescript_1.default.factory.createTrue() ++ : typescript_1.default.factory.createFalse()), + ]) +- : typescript_1.default.createNull()); ++ : typescript_1.default.factory.createNull()); + /** Set a property with a string value */ +- const setStringLiteralField = (fieldName, fieldValue) => typescript_1.default.createPropertyAssignment(typescript_1.default.createLiteral(fieldName), typescript_1.default.createLiteral(fieldValue)); ++ const setStringLiteralField = (fieldName, fieldValue) => typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createStringLiteral(fieldName), typescript_1.default.factory.createStringLiteral(fieldValue)); + /** + * ``` + * SimpleComponent.__docgenInfo.props.someProp.description = "Prop description."; +@@ -101,7 +108,7 @@ function createPropDefinition(propName, prop, options) { + * ``` + * @param required Whether prop is required or not. + */ +- const setRequired = (required) => typescript_1.default.createPropertyAssignment(typescript_1.default.createLiteral("required"), required ? typescript_1.default.createTrue() : typescript_1.default.createFalse()); ++ const setRequired = (required) => typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createStringLiteral("required"), required ? typescript_1.default.factory.createTrue() : typescript_1.default.factory.createFalse()); + /** + * ``` + * SimpleComponent.__docgenInfo.props.someProp.type = { +@@ -113,7 +120,7 @@ function createPropDefinition(propName, prop, options) { + */ + const setValue = (typeValue) => Array.isArray(typeValue) && + typeValue.every((value) => typeof value.value === "string") +- ? typescript_1.default.createPropertyAssignment(typescript_1.default.createLiteral("value"), typescript_1.default.createArrayLiteral(typeValue.map((value) => typescript_1.default.createObjectLiteral([ ++ ? typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createStringLiteral("value"), typescript_1.default.factory.createArrayLiteralExpression(typeValue.map((value) => typescript_1.default.factory.createObjectLiteralExpression([ + setStringLiteralField("value", value.value), + ])))) + : undefined; +@@ -130,9 +137,9 @@ function createPropDefinition(propName, prop, options) { + if (valueField) { + objectFields.push(valueField); + } +- return typescript_1.default.createPropertyAssignment(typescript_1.default.createLiteral(options.typePropName), typescript_1.default.createObjectLiteral(objectFields)); ++ return typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createStringLiteral(options.typePropName), typescript_1.default.factory.createObjectLiteralExpression(objectFields)); + }; +- return typescript_1.default.createPropertyAssignment(typescript_1.default.createLiteral(propName), typescript_1.default.createObjectLiteral([ ++ return typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createStringLiteral(propName), typescript_1.default.factory.createObjectLiteralExpression([ + setDefaultValue(prop.defaultValue), + setDescription(prop.description), + setName(prop.name), +@@ -158,10 +165,10 @@ function createPropDefinition(propName, prop, options) { + * @param relativeFilename Relative file path of the component source file. + */ + function insertDocgenIntoGlobalCollection(d, docgenCollectionName, relativeFilename) { +- return insertTsIgnoreBeforeStatement(typescript_1.default.createIf(typescript_1.default.createBinary(typescript_1.default.createTypeOf(typescript_1.default.createIdentifier(docgenCollectionName)), typescript_1.default.SyntaxKind.ExclamationEqualsEqualsToken, typescript_1.default.createLiteral("undefined")), insertTsIgnoreBeforeStatement(typescript_1.default.createStatement(typescript_1.default.createBinary(typescript_1.default.createElementAccess(typescript_1.default.createIdentifier(docgenCollectionName), typescript_1.default.createLiteral(`${relativeFilename}#${d.displayName}`)), typescript_1.default.SyntaxKind.EqualsToken, typescript_1.default.createObjectLiteral([ +- typescript_1.default.createPropertyAssignment(typescript_1.default.createIdentifier("docgenInfo"), typescript_1.default.createPropertyAccess(typescript_1.default.createIdentifier(d.displayName), typescript_1.default.createIdentifier("__docgenInfo"))), +- typescript_1.default.createPropertyAssignment(typescript_1.default.createIdentifier("name"), typescript_1.default.createLiteral(d.displayName)), +- typescript_1.default.createPropertyAssignment(typescript_1.default.createIdentifier("path"), typescript_1.default.createLiteral(`${relativeFilename}#${d.displayName}`)), ++ return insertTsIgnoreBeforeStatement(typescript_1.default.factory.createIfStatement(typescript_1.default.factory.createBinaryExpression(typescript_1.default.factory.createTypeOfExpression(typescript_1.default.factory.createIdentifier(docgenCollectionName)), typescript_1.default.SyntaxKind.ExclamationEqualsEqualsToken, typescript_1.default.factory.createStringLiteral("undefined")), insertTsIgnoreBeforeStatement(typescript_1.default.factory.createExpressionStatement(typescript_1.default.factory.createBinaryExpression(typescript_1.default.factory.createElementAccessExpression(typescript_1.default.factory.createIdentifier(docgenCollectionName), typescript_1.default.factory.createStringLiteral(`${relativeFilename}#${d.displayName}`)), typescript_1.default.SyntaxKind.EqualsToken, typescript_1.default.factory.createObjectLiteralExpression([ ++ typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createIdentifier("docgenInfo"), typescript_1.default.factory.createPropertyAccessExpression(typescript_1.default.factory.createIdentifier(d.displayName), typescript_1.default.factory.createIdentifier("__docgenInfo"))), ++ typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createIdentifier("name"), typescript_1.default.factory.createStringLiteral(d.displayName)), ++ typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createIdentifier("path"), typescript_1.default.factory.createStringLiteral(`${relativeFilename}#${d.displayName}`)), + ])))))); + } + /** +@@ -180,15 +187,15 @@ function insertDocgenIntoGlobalCollection(d, docgenCollectionName, relativeFilen + * @param options Generator options. + */ + function setComponentDocGen(d, options) { +- return insertTsIgnoreBeforeStatement(typescript_1.default.createStatement(typescript_1.default.createBinary( ++ return insertTsIgnoreBeforeStatement(typescript_1.default.factory.createExpressionStatement(typescript_1.default.factory.createBinaryExpression( + // SimpleComponent.__docgenInfo +- typescript_1.default.createPropertyAccess(typescript_1.default.createIdentifier(d.displayName), typescript_1.default.createIdentifier("__docgenInfo")), typescript_1.default.SyntaxKind.EqualsToken, typescript_1.default.createObjectLiteral([ ++ typescript_1.default.factory.createPropertyAccessExpression(typescript_1.default.factory.createIdentifier(d.displayName), typescript_1.default.factory.createIdentifier("__docgenInfo")), typescript_1.default.SyntaxKind.EqualsToken, typescript_1.default.factory.createObjectLiteralExpression([ + // SimpleComponent.__docgenInfo.description +- typescript_1.default.createPropertyAssignment(typescript_1.default.createLiteral("description"), typescript_1.default.createLiteral(d.description)), ++ typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createStringLiteral("description"), typescript_1.default.factory.createStringLiteral(d.description)), + // SimpleComponent.__docgenInfo.displayName +- typescript_1.default.createPropertyAssignment(typescript_1.default.createLiteral("displayName"), typescript_1.default.createLiteral(d.displayName)), ++ typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createStringLiteral("displayName"), typescript_1.default.factory.createStringLiteral(d.displayName)), + // SimpleComponent.__docgenInfo.props +- typescript_1.default.createPropertyAssignment(typescript_1.default.createLiteral("props"), typescript_1.default.createObjectLiteral(Object.entries(d.props).map(([propName, prop]) => createPropDefinition(propName, prop, options)))), ++ typescript_1.default.factory.createPropertyAssignment(typescript_1.default.factory.createStringLiteral("props"), typescript_1.default.factory.createObjectLiteralExpression(Object.entries(d.props).map(([propName, prop]) => createPropDefinition(propName, prop, options)))), + ])))); + } + function generateDocgenCodeBlock(options) { +@@ -196,7 +203,7 @@ function generateDocgenCodeBlock(options) { + const relativeFilename = path_1.default + .relative("./", path_1.default.resolve("./", options.filename)) + .replace(/\\/g, "/"); +- const wrapInTryStatement = (statements) => typescript_1.default.createTry(typescript_1.default.createBlock(statements, true), typescript_1.default.createCatchClause(typescript_1.default.createVariableDeclaration(typescript_1.default.createIdentifier("__react_docgen_typescript_loader_error")), typescript_1.default.createBlock([])), undefined); ++ const wrapInTryStatement = (statements) => typescript_1.default.factory.createTryStatement(typescript_1.default.factory.createBlock(statements, true), typescript_1.default.factory.createCatchClause(typescript_1.default.factory.createVariableDeclaration(typescript_1.default.factory.createIdentifier("__react_docgen_typescript_loader_error")), typescript_1.default.factory.createBlock([])), undefined); + const codeBlocks = options.componentDocs.map((d) => wrapInTryStatement([ + options.setDisplayName ? setDisplayName(d) : null, + setComponentDocGen(d, options), +@@ -208,7 +215,7 @@ function generateDocgenCodeBlock(options) { + const printer = typescript_1.default.createPrinter({ newLine: typescript_1.default.NewLineKind.LineFeed }); + const printNode = (sourceNode) => printer.printNode(typescript_1.default.EmitHint.Unspecified, sourceNode, sourceFile); + // Concat original source code with code from generated code blocks. +- const result = codeBlocks.reduce((acc, node) => `${acc}\n${printNode(node)}`, ++ const result = codeBlocks.reduce((acc, node) => `${acc}\n${printNode(node)}`, + // Use original source text rather than using printNode on the parsed form + // to prevent issue where literals are stripped within components. + // Ref: https://github.com/strothj/react-docgen-typescript-loader/issues/7 diff --git a/apps/meteor/app/theme/client/imports/general/base_old.css b/apps/meteor/app/theme/client/imports/general/base_old.css index 6d9f5631fc6a..7f1ede6067fc 100644 --- a/apps/meteor/app/theme/client/imports/general/base_old.css +++ b/apps/meteor/app/theme/client/imports/general/base_old.css @@ -988,10 +988,6 @@ font-size: 12px; font-weight: 300; } - - & div.switch-language { - margin-top: 20px; - } } & .share { diff --git a/apps/meteor/app/utils/lib/i18n.ts b/apps/meteor/app/utils/lib/i18n.ts index 309585ee284b..13d5c667709d 100644 --- a/apps/meteor/app/utils/lib/i18n.ts +++ b/apps/meteor/app/utils/lib/i18n.ts @@ -5,9 +5,7 @@ import { isObject } from '../../../lib/utils/isObject'; export const i18n = i18next.use(sprintf); -export const addSprinfToI18n = function (t: (typeof i18n)['t']): typeof t & { - (key: string, ...replaces: any): string; -} { +export const addSprinfToI18n = function (t: (typeof i18n)['t']) { return function (key: string, ...replaces: any): string { if (replaces[0] === undefined || isObject(replaces[0])) { return t(key, ...replaces); diff --git a/apps/meteor/client/providers/TranslationProvider.tsx b/apps/meteor/client/providers/TranslationProvider.tsx index f09761be9a3b..5850f0da3982 100644 --- a/apps/meteor/client/providers/TranslationProvider.tsx +++ b/apps/meteor/client/providers/TranslationProvider.tsx @@ -122,6 +122,8 @@ const useI18next = (lng: string): typeof i18next => { }, react: { useSuspense: true, + bindI18n: 'languageChanged loaded', + bindI18nStore: 'added removed', }, interpolation: { escapeValue: false, @@ -174,7 +176,7 @@ type TranslationProviderProps = { const useAutoLanguage = () => { const serverLanguage = useSetting('Language'); const browserLanguage = filterLanguage(window.navigator.userLanguage ?? window.navigator.language); - const defaultUserLanguage = serverLanguage || browserLanguage || 'en'; + const defaultUserLanguage = browserLanguage || serverLanguage || 'en'; // if the language is supported, if not remove the region const suggestedLanguage = languages.includes(defaultUserLanguage) ? defaultUserLanguage : defaultUserLanguage.split('-').shift() ?? 'en'; @@ -209,11 +211,13 @@ const TranslationProvider = ({ children }: TranslationProviderProps): ReactEleme { en: 'Default', name: i18nextInstance.t('Default'), + ogName: i18nextInstance.t('Default'), key: '', }, ...[...new Set([...i18nextInstance.languages, ...languages])].map((key) => ({ en: key, name: getLanguageName(key, language), + ogName: getLanguageName(key, key), key, })), ], @@ -270,6 +274,7 @@ const TranslationProviderInner = ({ availableLanguages: { en: string; name: string; + ogName: string; key: string; }[]; }): ReactElement => { diff --git a/apps/meteor/client/providers/UserProvider/UserProvider.tsx b/apps/meteor/client/providers/UserProvider/UserProvider.tsx index 912cca246328..fa9d683815ed 100644 --- a/apps/meteor/client/providers/UserProvider/UserProvider.tsx +++ b/apps/meteor/client/providers/UserProvider/UserProvider.tsx @@ -1,7 +1,7 @@ import type { IRoom, ISubscription, IUser } from '@rocket.chat/core-typings'; import { useLocalStorage } from '@rocket.chat/fuselage-hooks'; -import { UserContext, useEndpoint, useSetting } from '@rocket.chat/ui-contexts'; import type { LoginService, SubscriptionWithRoom } from '@rocket.chat/ui-contexts'; +import { UserContext, useEndpoint, useSetting } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import type { ContextType, ReactElement, ReactNode } from 'react'; import React, { useEffect, useMemo } from 'react'; @@ -66,7 +66,8 @@ const UserProvider = ({ children }: UserProviderProps): ReactElement => { const userId = useReactiveValue(getUserId); const user = useReactiveValue(getUser); - const [language, setLanguage] = useLocalStorage('userLanguage', user?.language ?? 'en'); + const [userLanguage, setUserLanguage] = useLocalStorage('userLanguage', ''); + const [preferedLanguage, setPreferedLanguage] = useLocalStorage('preferedLanguage', ''); const setUserPreferences = useEndpoint('POST', '/v1/users.setPreferences'); @@ -167,10 +168,16 @@ const UserProvider = ({ children }: UserProviderProps): ReactElement => { ); useEffect(() => { - if (user?.language !== undefined && user.language !== language) { - setLanguage(user.language); + if (!!userId && preferedLanguage !== userLanguage) { + setUserPreferences({ data: { language: preferedLanguage } }); + setUserLanguage(preferedLanguage); + } + + if (user?.language !== undefined && user.language !== userLanguage) { + setUserLanguage(user.language); + setPreferedLanguage(user.language); } - }, [user?.language, language, setLanguage]); + }, [preferedLanguage, setPreferedLanguage, setUserLanguage, user?.language, userLanguage, userId, setUserPreferences]); const { data: license } = useIsEnterprise({ enabled: !!userId }); diff --git a/apps/meteor/client/sidebar/header/actions/hooks/mockAppRoot.tsx b/apps/meteor/client/sidebar/header/actions/hooks/mockAppRoot.tsx deleted file mode 100644 index a702c27e52c4..000000000000 --- a/apps/meteor/client/sidebar/header/actions/hooks/mockAppRoot.tsx +++ /dev/null @@ -1,355 +0,0 @@ -import type { Serialized } from '@rocket.chat/core-typings'; -import type { Method, OperationParams, OperationResult, PathPattern, UrlParams } from '@rocket.chat/rest-typings'; -import type { ServerMethodName, ServerMethodParameters, ServerMethodReturn, TranslationKey } from '@rocket.chat/ui-contexts'; -import { - AuthorizationContext, - ConnectionStatusContext, - RouterContext, - ServerContext, - SettingsContext, - TranslationContext, - UserContext, - ActionManagerContext, - ModalContext, -} from '@rocket.chat/ui-contexts'; -import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import type { WrapperComponent } from '@testing-library/react-hooks'; -import type { ObjectId } from 'mongodb'; -import type { ContextType, ReactNode } from 'react'; -import React from 'react'; - -class MockedAppRootBuilder { - private wrappers: Array<(children: ReactNode) => ReactNode> = []; - - private connectionStatus: ContextType = { - connected: true, - status: 'connected', - retryTime: undefined, - reconnect: () => undefined, - }; - - private server: ContextType = { - absoluteUrl: (path: string) => `http://localhost:3000/${path}`, - callEndpoint: (_args: { - method: TMethod; - pathPattern: TPathPattern; - keys: UrlParams; - params: OperationParams; - }): Promise>> => { - throw new Error('not implemented'); - }, - getSingleStream: () => () => () => undefined, - getStream: () => () => () => undefined, - uploadToEndpoint: () => Promise.reject(new Error('not implemented')), - callMethod: () => Promise.reject(new Error('not implemented')), - info: undefined, - }; - - private router: ContextType = { - buildRoutePath: () => '/', - defineRoutes: () => () => undefined, - getLocationPathname: () => '/', - getLocationSearch: () => '', - getRouteName: () => undefined, - getRouteParameters: () => ({}), - getRoutes: () => [], - getSearchParameters: () => ({}), - navigate: () => undefined, - subscribeToRouteChange: () => () => undefined, - subscribeToRoutesChange: () => () => undefined, - }; - - private settings: ContextType = { - hasPrivateAccess: true, - isLoading: false, - querySetting: (_id: string) => [() => () => undefined, () => undefined], - querySettings: () => [() => () => undefined, () => []], - dispatch: async () => undefined, - }; - - private translation: ContextType = { - language: 'en', - languages: [ - { - en: 'English', - key: 'en', - name: 'English', - }, - ], - loadLanguage: () => Promise.resolve(), - translate: Object.assign((key: string) => key, { - has: (_key: string): _key is TranslationKey => true, - }), - }; - - private user: ContextType = { - loginWithPassword: () => Promise.reject(new Error('not implemented')), - logout: () => Promise.reject(new Error('not implemented')), - loginWithService: () => () => Promise.reject(new Error('not implemented')), - loginWithToken: () => Promise.reject(new Error('not implemented')), - queryAllServices: () => [() => () => undefined, () => []], - queryPreference: () => [() => () => undefined, () => undefined], - queryRoom: () => [() => () => undefined, () => undefined], - querySubscription: () => [() => () => undefined, () => undefined], - querySubscriptions: () => [() => () => undefined, () => []], - user: null, - userId: null, - }; - - private modal: ContextType = { - currentModal: null, - modal: { - setModal: () => undefined, - }, - }; - - private authorization: ContextType = { - queryPermission: () => [() => () => undefined, () => false], - queryAtLeastOnePermission: () => [() => () => undefined, () => false], - queryAllPermissions: () => [() => () => undefined, () => false], - queryRole: () => [() => () => undefined, () => false], - roleStore: { - roles: {}, - emit: () => undefined, - on: () => () => undefined, - off: () => undefined, - events: (): Array<'change'> => ['change'], - has: () => false, - once: () => () => undefined, - }, - }; - - wrap(wrapper: (children: ReactNode) => ReactNode): this { - this.wrappers.push(wrapper); - return this; - } - - withEndpoint( - method: TMethod, - pathPattern: TPathPattern, - response: ( - params: OperationParams, - ) => Serialized> | Promise>>, - ): this { - const innerFn = this.server.callEndpoint; - - const outerFn = (args: { - method: TMethod; - pathPattern: TPathPattern; - keys: UrlParams; - params: OperationParams; - }): Promise>> => { - if (args.method === String(method) && args.pathPattern === String(pathPattern)) { - return Promise.resolve(response(args.params)) as Promise>>; - } - - return innerFn(args); - }; - - this.server.callEndpoint = outerFn; - - return this; - } - - withMethod(methodName: TMethodName, response: () => ServerMethodReturn): this { - const innerFn = this.server.callMethod; - - const outerFn = ( - innerMethodName: TMethodName, - ...innerArgs: ServerMethodParameters - ): Promise> => { - if (innerMethodName === String(methodName)) { - return Promise.resolve(response()) as Promise>; - } - - if (!innerFn) { - throw new Error('not implemented'); - } - - return innerFn(innerMethodName, ...innerArgs); - }; - - this.server.callMethod = outerFn; - - return this; - } - - withPermission(permission: string): this { - const innerFn = this.authorization.queryPermission; - - const outerFn = ( - innerPermission: string | ObjectId, - innerScope?: string | ObjectId | undefined, - innerScopedRoles?: string[] | undefined, - ): [subscribe: (onStoreChange: () => void) => () => void, getSnapshot: () => boolean] => { - if (innerPermission === permission) { - return [() => () => undefined, () => true]; - } - - return innerFn(innerPermission, innerScope, innerScopedRoles); - }; - - this.authorization.queryPermission = outerFn; - - const innerFn2 = this.authorization.queryAtLeastOnePermission; - - const outerFn2 = ( - innerPermissions: Array, - innerScope?: string | ObjectId | undefined, - innerScopedRoles?: string[] | undefined, - ): [subscribe: (onStoreChange: () => void) => () => void, getSnapshot: () => boolean] => { - if (innerPermissions.includes(permission)) { - return [() => () => undefined, () => true]; - } - - return innerFn2(innerPermissions, innerScope, innerScopedRoles); - }; - - this.authorization.queryAtLeastOnePermission = outerFn2; - - const innerFn3 = this.authorization.queryAllPermissions; - - const outerFn3 = ( - innerPermissions: Array, - innerScope?: string | ObjectId | undefined, - innerScopedRoles?: string[] | undefined, - ): [subscribe: (onStoreChange: () => void) => () => void, getSnapshot: () => boolean] => { - if (innerPermissions.includes(permission)) { - return [() => () => undefined, () => true]; - } - - return innerFn3(innerPermissions, innerScope, innerScopedRoles); - }; - - this.authorization.queryAllPermissions = outerFn3; - - return this; - } - - withJohnDoe(): this { - this.user.userId = 'john.doe'; - - this.user.user = { - _id: 'john.doe', - username: 'john.doe', - name: 'John Doe', - createdAt: new Date(), - active: true, - _updatedAt: new Date(), - roles: ['admin'], - type: 'user', - }; - - return this; - } - - withAnonymous(): this { - this.user.userId = null; - this.user.user = null; - - return this; - } - - withRole(role: string): this { - if (!this.user.user) { - throw new Error('user is not defined'); - } - - this.user.user.roles.push(role); - - const innerFn = this.authorization.queryRole; - - const outerFn = ( - innerRole: string | ObjectId, - innerScope?: string | undefined, - innerIgnoreSubscriptions?: boolean | undefined, - ): [subscribe: (onStoreChange: () => void) => () => void, getSnapshot: () => boolean] => { - if (innerRole === role) { - return [() => () => undefined, () => true]; - } - - return innerFn(innerRole, innerScope, innerIgnoreSubscriptions); - }; - - this.authorization.queryRole = outerFn; - - return this; - } - - build(): WrapperComponent<{ children: ReactNode }> { - const queryClient = new QueryClient({ - defaultOptions: { - queries: { retry: false }, - mutations: { retry: false }, - }, - }); - - const { connectionStatus, server, router, settings, translation, user, modal, authorization, wrappers } = this; - - return function MockedAppRoot({ children }) { - return ( - - - - - - - {/* - - - - - */} - - {/* */} - - - {/* - - */} - Promise.reject(new Error('not implemented')), - generateTriggerId: () => '', - getUserInteractionPayloadByViewId: () => undefined, - handlePayloadUserInteraction: () => undefined, - off: () => undefined, - on: () => undefined, - triggerActionButtonAction: () => Promise.reject(new Error('not implemented')), - triggerBlockAction: () => Promise.reject(new Error('not implemented')), - triggerCancel: () => Promise.reject(new Error('not implemented')), - triggerSubmitView: () => Promise.reject(new Error('not implemented')), - }} - > - {/* - - */} - {wrappers.reduce((children, wrapper) => wrapper(children), children)} - {/* - - */} - - {/* - - */} - - - {/* */} - - {/* - - - - - */} - - - - - - - ); - }; - } -} -export const mockAppRoot = () => new MockedAppRootBuilder(); diff --git a/apps/meteor/client/stories/contexts/TranslationContextMock.tsx b/apps/meteor/client/stories/contexts/TranslationContextMock.tsx index 7b8e8548094f..ac98cd15cd89 100644 --- a/apps/meteor/client/stories/contexts/TranslationContextMock.tsx +++ b/apps/meteor/client/stories/contexts/TranslationContextMock.tsx @@ -51,6 +51,7 @@ const TranslationContextMock = ({ children }: TranslationContextMockProps): Reac { name: 'English', en: 'English', + ogName: 'English', key: 'en', }, ], diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 0e3167a0886c..17ca54920e7b 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -180,7 +180,7 @@ "eslint-plugin-testing-library": "~5.11.0", "eslint-plugin-you-dont-need-lodash-underscore": "~6.12.0", "fast-glob": "^3.2.12", - "i18next": "^20.6.1", + "i18next": "~23.4.5", "jest": "~29.6.1", "jest-axe": "^8.0.0", "jsdom-global": "^3.0.2", @@ -398,8 +398,8 @@ "react-aria": "~3.23.1", "react-dom": "~17.0.2", "react-error-boundary": "^3.1.4", - "react-hook-form": "^7.30.0", - "react-i18next": "^11.16.7", + "react-hook-form": "~7.45.4", + "react-i18next": "~13.2.1", "react-keyed-flatten-children": "^1.3.0", "react-virtuoso": "^1.11.1", "redis": "^4.0.6", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 6edabf409f00..4dfd49cabd30 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -5799,7 +5799,7 @@ "registration.component.login": "Login", "registration.component.login.userNotFound": "User not found", "registration.component.login.incorrectPassword": "Incorrect password", - "registration.component.switchLanguage": "Switch to <1>en", + "registration.component.switchLanguage": "Change to <1>{{name}}", "registration.component.resetPassword": "Reset password", "registration.component.form.emailOrUsername": "Email or username", "registration.component.form.username": "Username", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json index 0c7119b768d2..0fc914f509f0 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json @@ -5545,7 +5545,7 @@ "registration.component.login": "Kirjaudu", "registration.component.login.userNotFound": "Käyttäjää ei löydy", "registration.component.login.incorrectPassword": "Väärä salasana", - "registration.component.switchLanguage": "Vaihda kieleksi <1>en", + "registration.component.switchLanguage": "Vaihda kieleksi <1>{{name}}", "registration.component.resetPassword": "Nollaa salasana", "registration.component.form.emailOrUsername": "Sähköpostiosoite tai käyttäjätunnus", "registration.component.form.username": "Käyttäjätunnus", @@ -5760,4 +5760,4 @@ "Uninstall_grandfathered_app": "Poistetaanko {{appName}}?", "App_will_lose_grandfathered_status": "**Tämä {{context}}sovellus menettää aikaisemmin käytetössä olleen sovelluksen tilansa.** \n \nYhteisöversion työtiloissa voi olla käytössä enintään {{limit}} {{context}} sovellusta. aikaisemmin Aikaisemmin käytössä olleet sovellukset lasketaan mukaan rajoitukseen, mutta rajoitusta ei sovelleta niihin.", "Theme_Appearence": "Teeman ulkoasu" -} \ No newline at end of file +} diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json index 0402967c47a8..3fd57ecb9a7e 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json @@ -5339,7 +5339,7 @@ "registration.component.login": "Bejelentkezés", "registration.component.login.userNotFound": "A felhasználó nem található", "registration.component.login.incorrectPassword": "Hibás jelszó", - "registration.component.switchLanguage": "Átváltás <1>angolra", + "registration.component.switchLanguage": "Átváltás <1>{{name}}", "registration.component.resetPassword": "Jelszó visszaállítása", "registration.component.form.emailOrUsername": "E-mail-cím vagy felhasználónév", "registration.component.form.username": "Felhasználónév", @@ -5438,4 +5438,4 @@ "Join_your_team": "Csatlakozás csapathoz", "Create_an_account": "Fiók létrehozása", "RegisterWorkspace_Features_Marketplace_Title": "Piactér" -} \ No newline at end of file +} diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json index 97b4015b0c1f..e111ab9c3e42 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json @@ -5550,7 +5550,7 @@ "registration.component.login": "Logga in", "registration.component.login.userNotFound": "Användare inte hittad", "registration.component.login.incorrectPassword": "Felaktigt lösenord", - "registration.component.switchLanguage": "Växla till <1>en", + "registration.component.switchLanguage": "Växla till <1>{{name}}", "registration.component.resetPassword": "Återställ lösenord", "registration.component.form.emailOrUsername": "E-postadress eller lösenord", "registration.component.form.username": "Användarnamn", @@ -5765,4 +5765,4 @@ "Uninstall_grandfathered_app": "Avinstallera {{appName}}?", "App_will_lose_grandfathered_status": "**Denna {{context}}-app kommer att förlora sin status som gammal app.** \n \nArbetsytorna i Community Edition kan ha upp till {{limit}} __kontext__-appar aktiverade. Gamla appar inkluderas i gränsen, men gränsen tillämpas inte på dem.", "Theme_Appearence": "Utseende för tema" -} \ No newline at end of file +} diff --git a/apps/meteor/server/lib/i18n.ts b/apps/meteor/server/lib/i18n.ts index 4a0ffdce5e92..265305ef71d6 100644 --- a/apps/meteor/server/lib/i18n.ts +++ b/apps/meteor/server/lib/i18n.ts @@ -1,5 +1,6 @@ import type { RocketchatI18nKeys } from '@rocket.chat/i18n'; import i18nDict from '@rocket.chat/i18n'; +import type { TOptions } from 'i18next'; import { i18n } from '../../app/utils/lib/i18n'; diff --git a/package.json b/package.json index a87c30241658..47f10019e2cc 100644 --- a/package.json +++ b/package.json @@ -62,6 +62,7 @@ "resolutions": { "minimist": "1.2.6", "adm-zip": "0.5.9", - "preact@10.15.1": "patch:preact@npm:10.15.1#.yarn/patches/preact-npm-10.15.1-bd458de913.patch" + "preact@10.15.1": "patch:preact@npm:10.15.1#.yarn/patches/preact-npm-10.15.1-bd458de913.patch", + "@storybook/react-docgen-typescript-plugin@1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0": "patch:@storybook/react-docgen-typescript-plugin@npm%3A1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0#./.yarn/patches/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40.patch" } } diff --git a/packages/i18n/babel.config.cjs b/packages/i18n/babel.config.cjs index 1f2e1d2aa3b1..ab413e04e571 100644 --- a/packages/i18n/babel.config.cjs +++ b/packages/i18n/babel.config.cjs @@ -1,3 +1,3 @@ module.exports = { - presets: ['@babel/preset-modules'], + presets: [['@babel/preset-env', { bugfixes: true }]], }; diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 146e7cc36a15..830807b7a12b 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -3,12 +3,8 @@ "version": "0.0.1", "private": true, "devDependencies": { - "@babel/core": "~7.22.9", - "@babel/preset-env": "~7.22.9", - "@babel/preset-typescript": "~7.22.5", - "@types/babel__core": "~7.20.1", - "@types/babel__preset-env": "~7.9.2", - "@types/jest": "~29.5.3", + "@babel/core": "~7.22.10", + "@babel/preset-env": "~7.22.10", "babel-jest": "^29.5.0", "eslint": "~8.45.0", "jest": "~29.6.1", @@ -20,8 +16,7 @@ "build": "node ./src/index.mjs", "lint": "eslint --ext .mjs,.js,.jsx,.ts,.tsx .", "lint:fix": "eslint --ext .mjs,.js,.jsx,.ts,.tsx . --fix", - "test": "NODE_OPTIONS=--experimental-vm-modules jest", - "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput" + "test": "NODE_OPTIONS=--experimental-vm-modules jest" }, "main": "./dist/index.js", "module": "./dist/index.mjs", diff --git a/packages/i18n/tsconfig.json b/packages/i18n/tsconfig.json deleted file mode 100644 index 91cebf125bc5..000000000000 --- a/packages/i18n/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../../tsconfig.base.client.json", - "compilerOptions": { - "rootDir": "./src", - "outDir": "./dist" - }, - "include": ["./src/**/*"], - "exclude": ["./dist/**/*"] -} diff --git a/packages/livechat/package.json b/packages/livechat/package.json index 196481935485..5857e427fc61 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -103,15 +103,15 @@ "date-fns": "^2.15.0", "emoji-mart": "^3.0.1", "history": "~5.3.0", - "i18next": "^21.8.10", + "i18next": "~23.4.5", "markdown-it": "^11.0.1", "mem": "^6.1.1", "mitt": "^2.1.0", "preact": "10.15.1", "preact-router": "^3.2.1", "query-string": "^7.1.3", - "react-hook-form": "^7.45.0", - "react-i18next": "^11.16.9", + "react-hook-form": "~7.45.4", + "react-i18next": "~13.2.1", "whatwg-fetch": "^3.6.2" }, "browserslist": [ diff --git a/packages/livechat/src/components/Calls/CallNotification.tsx b/packages/livechat/src/components/Calls/CallNotification.tsx index 5cde8fd22196..9805d45165e8 100644 --- a/packages/livechat/src/components/Calls/CallNotification.tsx +++ b/packages/livechat/src/components/Calls/CallNotification.tsx @@ -1,5 +1,5 @@ +import { type TFunction } from 'i18next'; import { useState } from 'preact/compat'; -import type { TFunction } from 'react-i18next'; import { withTranslation } from 'react-i18next'; import { Livechat } from '../../api'; @@ -9,8 +9,7 @@ import { isMobileDevice } from '../../helpers/isMobileDevice'; import PhoneAccept from '../../icons/phone.svg'; import PhoneDecline from '../../icons/phoneOff.svg'; import constants from '../../lib/constants'; -import type { Dispatch } from '../../store'; -import store from '../../store'; +import store, { type Dispatch } from '../../store'; import { Avatar } from '../Avatar'; import { Button } from '../Button'; import { CallStatus } from './CallStatus'; diff --git a/packages/livechat/src/components/Calls/JoinCallButton.tsx b/packages/livechat/src/components/Calls/JoinCallButton.tsx index 7ec1da02faf1..9a276b0e9180 100644 --- a/packages/livechat/src/components/Calls/JoinCallButton.tsx +++ b/packages/livechat/src/components/Calls/JoinCallButton.tsx @@ -1,4 +1,4 @@ -import type { TFunction } from 'react-i18next'; +import { type TFunction } from 'i18next'; import { withTranslation } from 'react-i18next'; import { getConnectionBaseUrl } from '../../helpers/baseUrl'; @@ -7,8 +7,7 @@ import VideoIcon from '../../icons/video.svg'; import constants from '../../lib/constants'; import store from '../../store'; import { Button } from '../Button'; -import type { CallStatus } from './CallStatus'; -import { isCallOngoing } from './CallStatus'; +import { type CallStatus, isCallOngoing } from './CallStatus'; import styles from './styles.scss'; type JoinCallButtonProps = { diff --git a/packages/mock-providers/package.json b/packages/mock-providers/package.json index e42f4f3055ba..d739e442879e 100644 --- a/packages/mock-providers/package.json +++ b/packages/mock-providers/package.json @@ -2,8 +2,14 @@ "name": "@rocket.chat/mock-providers", "version": "0.0.1", "private": true, + "dependencies": { + "@rocket.chat/i18n": "workspace:~", + "i18next": "~23.4.5", + "react-i18next": "~13.2.1" + }, "devDependencies": { "@rocket.chat/ui-contexts": "workspace:*", + "@storybook/react": "~6.5.16", "@tanstack/react-query": "^4.16.1", "@types/jest": "~29.5.3", "eslint": "~8.45.0", diff --git a/packages/mock-providers/src/MockedAppRootBuilder.tsx b/packages/mock-providers/src/MockedAppRootBuilder.tsx index 03136e62ec86..9e114be87d15 100644 --- a/packages/mock-providers/src/MockedAppRootBuilder.tsx +++ b/packages/mock-providers/src/MockedAppRootBuilder.tsx @@ -1,7 +1,11 @@ -import type { ISetting, Serialized, SettingValue } from '@rocket.chat/core-typings'; -import type { Method, OperationParams, OperationResult, PathPattern, UrlParams } from '@rocket.chat/rest-typings'; -import type { ServerMethodName, ServerMethodParameters, ServerMethodReturn, TranslationKey } from '@rocket.chat/ui-contexts'; +import { type ISetting, type Serialized, type SettingValue } from '@rocket.chat/core-typings'; +import languages from '@rocket.chat/i18n/dist/languages'; +import { type Method, type OperationParams, type OperationResult, type PathPattern, type UrlParams } from '@rocket.chat/rest-typings'; import { + type ServerMethodName, + type ServerMethodParameters, + type ServerMethodReturn, + type TranslationKey, AuthorizationContext, ConnectionStatusContext, RouterContext, @@ -12,11 +16,13 @@ import { ActionManagerContext, ModalContext, } from '@rocket.chat/ui-contexts'; +import { type DecoratorFn } from '@storybook/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; -import type { WrapperComponent } from '@testing-library/react-hooks'; -import type { ObjectId } from 'mongodb'; -import type { ContextType, ReactNode } from 'react'; -import React from 'react'; +import { type WrapperComponent } from '@testing-library/react-hooks'; +import { createInstance } from 'i18next'; +import { type ObjectId } from 'mongodb'; +import React, { type ContextType, type ReactNode, useEffect, useReducer } from 'react'; +import { I18nextProvider, initReactI18next } from 'react-i18next'; type Mutable = { -readonly [P in keyof T]: T[P]; @@ -71,21 +77,6 @@ export class MockedAppRootBuilder { dispatch: async () => undefined, }; - private translation: ContextType = { - language: 'en', - languages: [ - { - en: 'English', - key: 'en', - name: 'English', - }, - ], - loadLanguage: () => Promise.resolve(), - translate: Object.assign((key: string) => key, { - has: (_key: string | number | symbol): _key is TranslationKey => true, - }), - }; - private user: ContextType = { loginWithPassword: () => Promise.reject(new Error('not implemented')), logout: () => Promise.reject(new Error('not implemented')), @@ -322,6 +313,40 @@ export class MockedAppRootBuilder { return this; } + private i18n = createInstance( + { + // debug: true, + lng: 'en', + fallbackLng: 'en', + ns: ['core'], + nsSeparator: '.', + partialBundledLanguages: true, + defaultNS: 'core', + interpolation: { + escapeValue: false, + }, + initImmediate: false, + }, + () => undefined, + ).use(initReactI18next); + + withTranslations(lng: string, ns: string, resources: Record): this { + const addResources = () => { + this.i18n.addResources(lng, ns, resources); + for (const [key, value] of Object.entries(resources)) { + this.i18n.addResource(lng, ns, key, value); + } + }; + + if (this.i18n.isInitialized) { + addResources(); + return this; + } + + this.i18n.on('initialized', addResources); + return this; + } + build(): WrapperComponent<{ children: ReactNode }> { const queryClient = new QueryClient({ defaultOptions: { @@ -330,65 +355,116 @@ export class MockedAppRootBuilder { }, }); - const { connectionStatus, server, router, settings, translation, user, modal, authorization, wrappers } = this; + const { connectionStatus, server, router, settings, user, modal, i18n, authorization, wrappers } = this; + + const reduceTranslation = (translation?: ContextType): ContextType => { + return { + ...translation, + language: i18n.isInitialized ? i18n.language : 'en', + languages: [ + { + en: 'Default', + name: i18n.isInitialized ? i18n.t('Default') : 'Default', + ogName: i18n.isInitialized ? i18n.t('Default') : 'Default', + key: '', + }, + ...(i18n.isInitialized + ? [...new Set([...i18n.languages, ...languages])].map((key) => ({ + en: key, + name: new Intl.DisplayNames([key], { type: 'language' }).of(key) ?? key, + ogName: new Intl.DisplayNames([key], { type: 'language' }).of(key) ?? key, + key, + })) + : []), + ], + loadLanguage: async (language) => { + if (!i18n.isInitialized) { + return; + } + + await i18n.changeLanguage(language); + }, + translate: Object.assign( + (key: TranslationKey, options?: unknown) => (i18n.isInitialized ? i18n.t(key, options as { lng?: string }) : ''), + { + has: (key: string, options?: { lng?: string }): key is TranslationKey => + !!key && i18n.isInitialized && i18n.exists(key, options), + }, + ), + }; + }; return function MockedAppRoot({ children }) { + const [translation, updateTranslation] = useReducer(reduceTranslation, undefined, () => reduceTranslation()); + + useEffect(() => { + i18n.on('initialized', updateTranslation); + i18n.on('languageChanged', updateTranslation); + + return () => { + i18n.off('initialized', updateTranslation); + i18n.off('languageChanged', updateTranslation); + }; + }, []); + return ( - - {/* + + + {/* */} - - {/* */} - - - {/* + + {/* */} + + + {/* */} - Promise.reject(new Error('not implemented')), - generateTriggerId: () => '', - getUserInteractionPayloadByViewId: () => undefined, - handlePayloadUserInteraction: () => undefined, - off: () => undefined, - on: () => undefined, - triggerActionButtonAction: () => Promise.reject(new Error('not implemented')), - triggerBlockAction: () => Promise.reject(new Error('not implemented')), - triggerCancel: () => Promise.reject(new Error('not implemented')), - triggerSubmitView: () => Promise.reject(new Error('not implemented')), - }} - > - {/* + Promise.reject(new Error('not implemented')), + generateTriggerId: () => '', + getUserInteractionPayloadByViewId: () => undefined, + handlePayloadUserInteraction: () => undefined, + off: () => undefined, + on: () => undefined, + triggerActionButtonAction: () => Promise.reject(new Error('not implemented')), + triggerBlockAction: () => Promise.reject(new Error('not implemented')), + triggerCancel: () => Promise.reject(new Error('not implemented')), + triggerSubmitView: () => Promise.reject(new Error('not implemented')), + }} + > + {/* */} - {wrappers.reduce((children, wrapper) => wrapper(children), children)} - {/* + {wrappers.reduce((children, wrapper) => wrapper(children), children)} + {/* */} - - {/* + + {/* */} - - - {/* */} - - {/* + + + {/* */} + + {/* */} - + + @@ -397,4 +473,11 @@ export class MockedAppRootBuilder { ); }; } + + buildStoryDecorator(): DecoratorFn { + const WrapperComponent = this.build(); + + // eslint-disable-next-line react/display-name, react/no-multi-comp + return (fn) => {fn()}; + } } diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 2a4e5e97bdba..4bc9a7d8c681 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -37,7 +37,7 @@ "jest": "~29.6.1", "react": "^17.0.2", "react-dom": "^17.0.2", - "react-hook-form": "^7.30.0", + "react-hook-form": "~7.45.4", "ts-jest": "~29.0.5", "typescript": "~5.2.2" }, diff --git a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifiers.spec.tsx b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifiers.spec.tsx index 95614491c3bd..cd2a5175e59f 100644 --- a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifiers.spec.tsx +++ b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifiers.spec.tsx @@ -16,15 +16,6 @@ type Response = { ][]; }; -jest.mock('react-i18next', () => ({ - useTranslation: () => ({ - t: (str: string) => str, - i18n: { - changeLanguage: () => new Promise(() => undefined), - }, - }), -})); - afterEach(() => { // restore the spy created with spyOn jest.restoreAllMocks(); diff --git a/packages/ui-contexts/src/TranslationContext.ts b/packages/ui-contexts/src/TranslationContext.ts index ce75d08d56e5..d0f9bb6318c3 100644 --- a/packages/ui-contexts/src/TranslationContext.ts +++ b/packages/ui-contexts/src/TranslationContext.ts @@ -7,6 +7,7 @@ export { keys }; export type TranslationLanguage = { en: string; name: string; + ogName: string; key: string; }; @@ -33,6 +34,7 @@ export const TranslationContext = createContext({ { name: 'Default', en: 'Default', + ogName: 'Default', key: '', }, ], diff --git a/packages/web-ui-registration/.babelrc.json b/packages/web-ui-registration/.babelrc.json new file mode 100644 index 000000000000..9398333d1322 --- /dev/null +++ b/packages/web-ui-registration/.babelrc.json @@ -0,0 +1,7 @@ +{ + "presets": [ + "@babel/preset-env", + "@babel/preset-react", + "@babel/preset-typescript" + ] +} diff --git a/packages/web-ui-registration/.storybook/logo.svg b/packages/web-ui-registration/.storybook/logo.svg new file mode 100644 index 000000000000..6ae18fa4b93e --- /dev/null +++ b/packages/web-ui-registration/.storybook/logo.svg @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + diff --git a/packages/web-ui-registration/.storybook/logo.svg.d.ts b/packages/web-ui-registration/.storybook/logo.svg.d.ts new file mode 100644 index 000000000000..27c0914b230f --- /dev/null +++ b/packages/web-ui-registration/.storybook/logo.svg.d.ts @@ -0,0 +1,3 @@ +declare const path: string; + +export = path; diff --git a/packages/web-ui-registration/.storybook/main.ts b/packages/web-ui-registration/.storybook/main.ts new file mode 100644 index 000000000000..3f3c4d626f5a --- /dev/null +++ b/packages/web-ui-registration/.storybook/main.ts @@ -0,0 +1,12 @@ +import { type StorybookConfig } from '@storybook/core-common'; + +const config: StorybookConfig = { + stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'], + addons: ['@storybook/addon-essentials', 'storybook-dark-mode'], + features: { + postcss: false, + }, + framework: '@storybook/react', +}; + +module.exports = config; diff --git a/packages/web-ui-registration/.storybook/preview.tsx b/packages/web-ui-registration/.storybook/preview.tsx new file mode 100644 index 000000000000..d2fd6e7552a4 --- /dev/null +++ b/packages/web-ui-registration/.storybook/preview.tsx @@ -0,0 +1,36 @@ +import { themes } from '@storybook/theming'; +import { type Parameters } from '@storybook/addons'; +import manifest from '../package.json'; +import logo from './logo.svg'; +import '@rocket.chat/fuselage/dist/fuselage.css'; +import '@rocket.chat/icons/dist/rocketchat.css'; + +export const parameters: Parameters = { + actions: { argTypesRegex: "^on[A-Z].*" }, + backgrounds: { + grid: { + cellSize: 4, + cellAmount: 4, + opacity: 0.5, + }, + }, + options: { + storySort: ([, a], [, b]) => a.kind.localeCompare(b.kind), + }, + layout: 'fullscreen', + darkMode: { + dark: { + ...themes.dark, + brandTitle: manifest.name, + brandImage: logo, + brandUrl: manifest.homepage, + }, + light: { + ...themes.normal, + brandTitle: manifest.name, + brandImage: logo, + brandUrl: manifest.homepage, + }, + }, +}; + diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index d19e6cd673db..a6e7332c948f 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -2,16 +2,48 @@ "name": "@rocket.chat/web-ui-registration", "version": "1.0.3", "private": true, + "homepage": "https://rocket.chat", + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "files": [ + "/dist" + ], + "scripts": { + "lint": "eslint --ext .js,.jsx,.ts,.tsx .", + "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix", + "test": "jest", + "storybook": "start-storybook -p 6006 --no-version-updates", + "build": "tsc -p tsconfig.build.json", + "dev": "tsc -p tsconfig.build.json --watch --preserveWatchOutput" + }, "devDependencies": { + "@babel/core": "~7.22.10", + "@babel/preset-env": "~7.22.10", + "@babel/preset-react": "~7.22.5", + "@babel/preset-typescript": "~7.22.5", + "@rocket.chat/i18n": "workspace:~", "@rocket.chat/layout": "next", + "@rocket.chat/mock-providers": "workspace:~", "@rocket.chat/ui-client": "workspace:^", "@rocket.chat/ui-contexts": "workspace:^", + "@storybook/addon-actions": "~6.5.16", + "@storybook/addon-docs": "~6.5.16", + "@storybook/addon-essentials": "~6.5.16", + "@storybook/builder-webpack4": "~6.5.16", + "@storybook/manager-webpack4": "~6.5.16", + "@storybook/react": "~6.5.16", + "@storybook/testing-library": "^0.2.0", "@tanstack/react-query": "^4.16.1", "@testing-library/react": "^13.3.0", "@types/jest": "~29.5.3", + "@types/react": "~17.0.62", + "babel-loader": "~8.3.0", "eslint": "~8.45.0", "jest": "~29.6.1", - "react-hook-form": "^7.34.2", + "react": "~17.0.2", + "react-hook-form": "~7.45.4", + "react-i18next": "~13.2.1", + "storybook-dark-mode": "~3.0.1", "ts-jest": "~29.0.5", "typescript": "~5.2.2" }, @@ -22,17 +54,5 @@ "react": "*", "react-hook-form": "*", "react-i18next": "*" - }, - "scripts": { - "lint": "eslint --ext .js,.jsx,.ts,.tsx .", - "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix", - "test": "jest", - "build": "tsc -p tsconfig.json", - "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput" - }, - "main": "./dist/index.js", - "typings": "./dist/index.d.ts", - "files": [ - "/dist" - ] + } } diff --git a/packages/web-ui-registration/src/ResetPassword/ResetPassword.stories.tsx b/packages/web-ui-registration/src/ResetPassword/ResetPassword.stories.tsx index d2373c44e365..d3c213c7fcfb 100644 --- a/packages/web-ui-registration/src/ResetPassword/ResetPassword.stories.tsx +++ b/packages/web-ui-registration/src/ResetPassword/ResetPassword.stories.tsx @@ -1,8 +1,12 @@ +import { mockAppRoot } from '@rocket.chat/mock-providers'; +import { type ComponentMeta } from '@storybook/react'; + import ResetPasswordPage from './ResetPasswordPage'; export default { title: 'Login/ResetPassword', component: ResetPasswordPage, -}; + decorators: [mockAppRoot().buildStoryDecorator()], +} satisfies ComponentMeta; export const Basic = () => ; diff --git a/packages/web-ui-registration/src/components/LoginSwitchLanguageFooter.stories.tsx b/packages/web-ui-registration/src/components/LoginSwitchLanguageFooter.stories.tsx new file mode 100644 index 000000000000..a71d4410ff36 --- /dev/null +++ b/packages/web-ui-registration/src/components/LoginSwitchLanguageFooter.stories.tsx @@ -0,0 +1,42 @@ +import { Box, Tile } from '@rocket.chat/fuselage'; +import { mockAppRoot } from '@rocket.chat/mock-providers'; +import { type ComponentStory, type ComponentMeta } from '@storybook/react'; +import { createElement } from 'react'; +import { useTranslation } from 'react-i18next'; + +import LoginSwitchLanguageFooter from './LoginSwitchLanguageFooter'; + +export default { + title: 'components/LoginSwitchLanguageFooter', + component: LoginSwitchLanguageFooter, + decorators: [ + (fn) => + createElement(function ExampleTranslationDecorator() { + const { t } = useTranslation(); + + return ( + + {t('example.text')} + {fn()} + + ); + }), + mockAppRoot() + .withSetting('Language', 'fi') + .withTranslations('en', 'registration', { 'component.switchLanguage': 'Change to <1>{{ name }}' }) + .withTranslations('en', 'example', { text: 'Hello!' }) + .withTranslations('fi', 'registration', { 'component.switchLanguage': 'Vaihda kieleksi <1>{{ name }}' }) + .withTranslations('fi', 'example', { text: 'Hei!' }) + .withTranslations('pt-BR', 'registration', { 'component.switchLanguage': 'Mudar para <1>{{ name }}' }) + .withTranslations('pt', 'example', { text: 'Olá!' }) + .buildStoryDecorator(), + ], + args: { + browserLanguage: 'pt-BR', + }, + parameters: { + layout: 'centered', + }, +} satisfies ComponentMeta; + +export const Default: ComponentStory = (args) => ; diff --git a/packages/web-ui-registration/src/components/LoginSwitchLanguageFooter.tsx b/packages/web-ui-registration/src/components/LoginSwitchLanguageFooter.tsx index 9a23039f9336..17b45e9157cb 100644 --- a/packages/web-ui-registration/src/components/LoginSwitchLanguageFooter.tsx +++ b/packages/web-ui-registration/src/components/LoginSwitchLanguageFooter.tsx @@ -1,9 +1,11 @@ -import { useSetting, useLoadLanguage, useLanguage, useLanguages } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; -import { Fragment, useMemo } from 'react'; -import { Trans } from 'react-i18next'; +import { Button } from '@rocket.chat/fuselage'; +import { useLocalStorage } from '@rocket.chat/fuselage-hooks'; +import { HorizontalWizardLayoutCaption } from '@rocket.chat/layout'; +import { type TranslationLanguage, useSetting, useLoadLanguage, useLanguage, useLanguages } from '@rocket.chat/ui-contexts'; +import { type ReactElement, type UIEvent, useMemo, useEffect } from 'react'; +import { Trans, useTranslation } from 'react-i18next'; -export const normalizeLanguage = (language: string): string => { +const normalizeLanguage = (language: string): string => { // Fix browsers having all-lowercase language settings eg. pt-br, en-us const regex = /([a-z]{2,3})-([a-z]{2,4})/; const matches = regex.exec(language); @@ -14,49 +16,67 @@ export const normalizeLanguage = (language: string): string => { return language; }; -const browserLanguage = normalizeLanguage(window.navigator.language ?? 'en'); - -const LoginSwitchLanguageFooter = (): ReactElement | null => { +const useSuggestedLanguages = ({ + browserLanguage = normalizeLanguage(window.navigator.language ?? 'en'), +}: { + browserLanguage?: string; +}) => { + const availableLanguages = useLanguages(); const currentLanguage = useLanguage(); - - const languages = useLanguages(); - const loadLanguage = useLoadLanguage(); - - const serverLanguage = normalizeLanguage((useSetting('Language') as string | undefined) || 'en'); + const serverLanguage = normalizeLanguage(useSetting('Language') || 'en'); const suggestions = useMemo(() => { - const potentialSuggestions = new Set([serverLanguage, browserLanguage, 'en'].map(normalizeLanguage)); - return Array.from(potentialSuggestions).filter( - (language) => language && language !== currentLanguage && Boolean(languages.find(({ key }) => key === language)), + const potentialLanguages = new Set([serverLanguage, browserLanguage, 'en'].map(normalizeLanguage)); + const potentialSuggestions = Array.from(potentialLanguages).map((potentialLanguageKey) => + availableLanguages.find((language) => language.key === potentialLanguageKey), ); - }, [serverLanguage, currentLanguage, languages]); + return potentialSuggestions.filter((language): language is TranslationLanguage => { + return !!language && language.key !== currentLanguage; + }); + }, [serverLanguage, browserLanguage, availableLanguages, currentLanguage]); + + const { i18n } = useTranslation(); + + useEffect(() => { + i18n.loadLanguages(suggestions.map((suggestion) => suggestion.key)); + }, [i18n, suggestions]); + + return { suggestions }; +}; + +type LoginSwitchLanguageFooterProps = { + browserLanguage?: string; +}; + +const LoginSwitchLanguageFooter = ({ + browserLanguage = normalizeLanguage(window.navigator.language ?? 'en'), +}: LoginSwitchLanguageFooterProps): ReactElement | null => { + const loadLanguage = useLoadLanguage(); + const { suggestions } = useSuggestedLanguages({ browserLanguage }); - const handleSwitchLanguageClick = (language: string) => (): void => { - loadLanguage(language); - }; + const [, setPreferedLanguage] = useLocalStorage('preferedLanguage', ''); + const handleSwitchLanguageClick = + (language: TranslationLanguage) => + async (event: UIEvent): Promise => { + event.preventDefault(); + await loadLanguage(language.key); + setPreferedLanguage(language.key); + }; if (!suggestions.length) { return null; } return ( -

- - Switch to - <> - {suggestions.map((language, index) => { - return ( - - {index > 0 ? : <>} - - - ); - })} - - -

+ + {suggestions.map((suggestion) => ( + + ))} + ); }; diff --git a/packages/web-ui-registration/tsconfig.build.json b/packages/web-ui-registration/tsconfig.build.json new file mode 100644 index 000000000000..a175aec991c8 --- /dev/null +++ b/packages/web-ui-registration/tsconfig.build.json @@ -0,0 +1,8 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "ESNext" + }, + "include": ["./src/**/*"], + "exclude": ["./src/**/*.spec.ts", "./src/**/*.stories.tsx"] +} diff --git a/packages/web-ui-registration/tsconfig.json b/packages/web-ui-registration/tsconfig.json index e2be47cf5499..47119e42b814 100644 --- a/packages/web-ui-registration/tsconfig.json +++ b/packages/web-ui-registration/tsconfig.json @@ -1,8 +1,9 @@ { "extends": "../../tsconfig.base.client.json", "compilerOptions": { - "rootDir": "./src", - "outDir": "./dist" + "rootDirs": ["./src","./.storybook"], + "outDir": "./dist", + "module": "CommonJS" }, - "include": ["./src/**/*"] + "include": ["./src", "./.storybook"], } diff --git a/yarn.lock b/yarn.lock index afc0f0262a95..5e42faea4480 100644 --- a/yarn.lock +++ b/yarn.lock @@ -964,23 +964,17 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.22.5, @babel/code-frame@npm:^7.5.5, @babel/code-frame@npm:^7.8.3": - version: 7.22.5 - resolution: "@babel/code-frame@npm:7.22.5" +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.22.10, @babel/code-frame@npm:^7.22.5, @babel/code-frame@npm:^7.5.5, @babel/code-frame@npm:^7.8.3": + version: 7.22.10 + resolution: "@babel/code-frame@npm:7.22.10" dependencies: - "@babel/highlight": ^7.22.5 - checksum: cfe804f518f53faaf9a1d3e0f9f74127ab9a004912c3a16fda07fb6a633393ecb9918a053cb71804204c1b7ec3d49e1699604715e2cfb0c9f7bc4933d324ebb6 - languageName: node - linkType: hard - -"@babel/compat-data@npm:^7.20.5": - version: 7.20.5 - resolution: "@babel/compat-data@npm:7.20.5" - checksum: 523790c43ef6388fae91d1ca9acf1ab0e1b22208dcd39c0e5e7a6adf0b48a133f1831be8d5931a72ecd48860f3e3fb777cb89840794abd8647a5c8e5cfab484e + "@babel/highlight": ^7.22.10 + chalk: ^2.4.2 + checksum: 89a06534ad19759da6203a71bad120b1d7b2ddc016c8e07d4c56b35dea25e7396c6da60a754e8532a86733092b131ae7f661dbe6ba5d165ea777555daa2ed3c9 languageName: node linkType: hard -"@babel/compat-data@npm:^7.22.5, @babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.22.9": +"@babel/compat-data@npm:^7.20.5, @babel/compat-data@npm:^7.22.5, @babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.22.9": version: 7.22.9 resolution: "@babel/compat-data@npm:7.22.9" checksum: bed77d9044ce948b4327b30dd0de0779fa9f3a7ed1f2d31638714ed00229fa71fc4d1617ae0eb1fad419338d3658d0e9a5a083297451e09e73e078d0347ff808 @@ -1011,26 +1005,26 @@ __metadata: languageName: node linkType: hard -"@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.20.7, @babel/core@npm:^7.21.4, @babel/core@npm:^7.7.5, @babel/core@npm:~7.22.9": - version: 7.22.9 - resolution: "@babel/core@npm:7.22.9" +"@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.20.7, @babel/core@npm:^7.21.4, @babel/core@npm:^7.7.5, @babel/core@npm:~7.22.10, @babel/core@npm:~7.22.9": + version: 7.22.10 + resolution: "@babel/core@npm:7.22.10" dependencies: "@ampproject/remapping": ^2.2.0 - "@babel/code-frame": ^7.22.5 - "@babel/generator": ^7.22.9 - "@babel/helper-compilation-targets": ^7.22.9 + "@babel/code-frame": ^7.22.10 + "@babel/generator": ^7.22.10 + "@babel/helper-compilation-targets": ^7.22.10 "@babel/helper-module-transforms": ^7.22.9 - "@babel/helpers": ^7.22.6 - "@babel/parser": ^7.22.7 + "@babel/helpers": ^7.22.10 + "@babel/parser": ^7.22.10 "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.8 - "@babel/types": ^7.22.5 + "@babel/traverse": ^7.22.10 + "@babel/types": ^7.22.10 convert-source-map: ^1.7.0 debug: ^4.1.0 gensync: ^1.0.0-beta.2 json5: ^2.2.2 semver: ^6.3.1 - checksum: 7bf069aeceb417902c4efdaefab1f7b94adb7dea694a9aed1bda2edf4135348a080820529b1a300c6f8605740a00ca00c19b2d5e74b5dd489d99d8c11d5e56d1 + checksum: cc4efa09209fe1f733cf512e9e4bb50870b191ab2dee8014e34cd6e731f204e48476cc53b4bbd0825d4d342304d577ae43ff5fd8ab3896080673c343321acb32 languageName: node linkType: hard @@ -1048,15 +1042,15 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.12.5, @babel/generator@npm:^7.22.7, @babel/generator@npm:^7.22.9, @babel/generator@npm:^7.7.2": - version: 7.22.9 - resolution: "@babel/generator@npm:7.22.9" +"@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.12.5, @babel/generator@npm:^7.22.10, @babel/generator@npm:^7.7.2": + version: 7.22.10 + resolution: "@babel/generator@npm:7.22.10" dependencies: - "@babel/types": ^7.22.5 + "@babel/types": ^7.22.10 "@jridgewell/gen-mapping": ^0.3.2 "@jridgewell/trace-mapping": ^0.3.17 jsesc: ^2.5.1 - checksum: 7c9d2c58b8d5ac5e047421a6ab03ec2ff5d9a5ff2c2212130a0055e063ac349e0b19d435537d6886c999771aef394832e4f54cd9fc810100a7f23d982f6af06b + checksum: 59a79730abdff9070692834bd3af179e7a9413fa2ff7f83dff3eb888765aeaeb2bfc7b0238a49613ed56e1af05956eff303cc139f2407eda8df974813e486074 languageName: node linkType: hard @@ -1078,18 +1072,16 @@ __metadata: languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.13.0, @babel/helper-compilation-targets@npm:^7.20.7, @babel/helper-compilation-targets@npm:^7.22.5, @babel/helper-compilation-targets@npm:^7.22.6, @babel/helper-compilation-targets@npm:^7.22.9": - version: 7.22.9 - resolution: "@babel/helper-compilation-targets@npm:7.22.9" +"@babel/helper-compilation-targets@npm:^7.13.0, @babel/helper-compilation-targets@npm:^7.20.7, @babel/helper-compilation-targets@npm:^7.22.10, @babel/helper-compilation-targets@npm:^7.22.5, @babel/helper-compilation-targets@npm:^7.22.6": + version: 7.22.10 + resolution: "@babel/helper-compilation-targets@npm:7.22.10" dependencies: "@babel/compat-data": ^7.22.9 "@babel/helper-validator-option": ^7.22.5 browserslist: ^4.21.9 lru-cache: ^5.1.1 semver: ^6.3.1 - peerDependencies: - "@babel/core": ^7.0.0 - checksum: ea0006c6a93759025f4a35a25228ae260538c9f15023e8aac2a6d45ca68aef4cf86cfc429b19af9a402cbdd54d5de74ad3fbcf6baa7e48184dc079f1a791e178 + checksum: f6f1896816392bcff671bbe6e277307729aee53befb4a66ea126e2a91eda78d819a70d06fa384c74ef46c1595544b94dca50bef6c78438d9ffd31776dafbd435 languageName: node linkType: hard @@ -1240,17 +1232,16 @@ __metadata: languageName: node linkType: hard -"@babel/helper-remap-async-to-generator@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-remap-async-to-generator@npm:7.22.5" +"@babel/helper-remap-async-to-generator@npm:^7.22.5, @babel/helper-remap-async-to-generator@npm:^7.22.9": + version: 7.22.9 + resolution: "@babel/helper-remap-async-to-generator@npm:7.22.9" dependencies: "@babel/helper-annotate-as-pure": ^7.22.5 "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-wrap-function": ^7.22.5 - "@babel/types": ^7.22.5 + "@babel/helper-wrap-function": ^7.22.9 peerDependencies: "@babel/core": ^7.0.0 - checksum: 1e51dcff1c22e97ea3d22034b77788048eb6d8c6860325bd7a1046b7a7135730cefd93b5c96fd9839d76031095d5ffb6f0cd6ee90a5d69a4c7de980d7f4623d9 + checksum: 05538079447829b13512157491cc77f9cf1ea7e1680e15cff0682c3ed9ee162de0c4862ece20a6d6b2df28177a1520bcfe45993fbeccf2747a81795a7c3f6290 languageName: node linkType: hard @@ -1295,14 +1286,14 @@ __metadata: languageName: node linkType: hard -"@babel/helper-string-parser@npm:^7.19.4, @babel/helper-string-parser@npm:^7.22.5": +"@babel/helper-string-parser@npm:^7.22.5": version: 7.22.5 resolution: "@babel/helper-string-parser@npm:7.22.5" checksum: 836851ca5ec813077bbb303acc992d75a360267aa3b5de7134d220411c852a6f17de7c0d0b8c8dcc0f567f67874c00f4528672b2a4f1bc978a3ada64c8c78467 languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.19.1, @babel/helper-validator-identifier@npm:^7.22.5": +"@babel/helper-validator-identifier@npm:^7.22.5": version: 7.22.5 resolution: "@babel/helper-validator-identifier@npm:7.22.5" checksum: 7f0f30113474a28298c12161763b49de5018732290ca4de13cdaefd4fd0d635a6fe3f6686c37a02905fb1e64f21a5ee2b55140cf7b070e729f1bd66866506aea @@ -1316,46 +1307,45 @@ __metadata: languageName: node linkType: hard -"@babel/helper-wrap-function@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-wrap-function@npm:7.22.5" +"@babel/helper-wrap-function@npm:^7.22.9": + version: 7.22.10 + resolution: "@babel/helper-wrap-function@npm:7.22.10" dependencies: "@babel/helper-function-name": ^7.22.5 "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.5 - "@babel/types": ^7.22.5 - checksum: a4ba2d7577ad3ce92fadaa341ffce3b0e4b389808099b07c80847f9be0852f4b42344612bc1b3d1b796ffb75be56d5957c5c56a1734f6aee5ccbb7cd9ab12691 + "@babel/types": ^7.22.10 + checksum: 854bd85fc1de1d4c633f04aa1f5b6b022fbc013b47d012b6a11a7a9125a1f4a2a4f13a3e0d7a7056fe7eda8a9ecd1ea3daf8af685685a2d1b16578768cfdd28f languageName: node linkType: hard -"@babel/helpers@npm:^7.12.5, @babel/helpers@npm:^7.22.6": - version: 7.22.6 - resolution: "@babel/helpers@npm:7.22.6" +"@babel/helpers@npm:^7.12.5, @babel/helpers@npm:^7.22.10": + version: 7.22.10 + resolution: "@babel/helpers@npm:7.22.10" dependencies: "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.6 - "@babel/types": ^7.22.5 - checksum: 5c1f33241fe7bf7709868c2105134a0a86dca26a0fbd508af10a89312b1f77ca38ebae43e50be3b208613c5eacca1559618af4ca236f0abc55d294800faeff30 + "@babel/traverse": ^7.22.10 + "@babel/types": ^7.22.10 + checksum: 3b1219e362df390b6c5d94b75a53fc1c2eb42927ced0b8022d6a29b833a839696206b9bdad45b4805d05591df49fc16b6fb7db758c9c2ecfe99e3e94cb13020f languageName: node linkType: hard -"@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/highlight@npm:7.22.5" +"@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.22.10": + version: 7.22.10 + resolution: "@babel/highlight@npm:7.22.10" dependencies: "@babel/helper-validator-identifier": ^7.22.5 - chalk: ^2.0.0 + chalk: ^2.4.2 js-tokens: ^4.0.0 - checksum: f61ae6de6ee0ea8d9b5bcf2a532faec5ab0a1dc0f7c640e5047fc61630a0edb88b18d8c92eb06566d30da7a27db841aca11820ecd3ebe9ce514c9350fbed39c4 + checksum: f714a1e1a72dd9d72f6383f4f30fd342e21a8df32d984a4ea8f5eab691bb6ba6db2f8823d4b4cf135d98869e7a98925b81306aa32ee3c429f8cfa52c75889e1b 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.20.7, @babel/parser@npm:^7.22.5, @babel/parser@npm:^7.22.7": - version: 7.22.7 - resolution: "@babel/parser@npm:7.22.7" +"@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.20.7, @babel/parser@npm:^7.22.10, @babel/parser@npm:^7.22.5": + version: 7.22.10 + resolution: "@babel/parser@npm:7.22.10" bin: parser: ./bin/babel-parser.js - checksum: 02209ddbd445831ee8bf966fdf7c29d189ed4b14343a68eb2479d940e7e3846340d7cc6bd654a5f3d87d19dc84f49f50a58cf9363bee249dc5409ff3ba3dab54 + checksum: af51567b7d3cdf523bc608eae057397486c7fa6c2e5753027c01fe5c36f0767b2d01ce3049b222841326cc5b8c7fda1d810ac1a01af0a97bb04679e2ef9f7049 languageName: node linkType: hard @@ -1510,18 +1500,6 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-proposal-unicode-property-regex@npm:^7.4.4": - version: 7.18.6 - resolution: "@babel/plugin-proposal-unicode-property-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-0 - checksum: a8575ecb7ff24bf6c6e94808d5c84bb5a0c6dd7892b54f09f4646711ba0ee1e1668032b3c43e3e1dfec2c5716c302e851ac756c1645e15882d73df6ad21ae951 - languageName: node - linkType: hard - "@babel/plugin-syntax-async-generators@npm:^7.8.4": version: 7.8.4 resolution: "@babel/plugin-syntax-async-generators@npm:7.8.4" @@ -1809,17 +1787,17 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-async-generator-functions@npm:^7.22.7": - version: 7.22.7 - resolution: "@babel/plugin-transform-async-generator-functions@npm:7.22.7" +"@babel/plugin-transform-async-generator-functions@npm:^7.22.10": + version: 7.22.10 + resolution: "@babel/plugin-transform-async-generator-functions@npm:7.22.10" dependencies: "@babel/helper-environment-visitor": ^7.22.5 "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-remap-async-to-generator": ^7.22.5 + "@babel/helper-remap-async-to-generator": ^7.22.9 "@babel/plugin-syntax-async-generators": ^7.8.4 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 57cd2cce3fb696dadf00e88f168683df69e900b92dadeae07429243c43bc21d5ccdc0c2db61cf5c37bd0fbd893fc455466bef6babe4aa5b79d9cb8ba89f40ae7 + checksum: 87d77b66fda05b42450aa285fa031aa3963c52aab00190f95f6c3ddefbed683035c1f314347c888f8406fba5d436b888ff75b5e36b8ab23afd4ca4c3f086f88c languageName: node linkType: hard @@ -1847,14 +1825,14 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-block-scoping@npm:^7.12.12, @babel/plugin-transform-block-scoping@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-block-scoping@npm:7.22.5" +"@babel/plugin-transform-block-scoping@npm:^7.12.12, @babel/plugin-transform-block-scoping@npm:^7.22.10": + version: 7.22.10 + resolution: "@babel/plugin-transform-block-scoping@npm:7.22.10" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 26987002cfe6e24544e60fa35f07052b6557f590c1a1cc5cf35d6dc341d7fea163c1222a2d70d5d2692f0b9860d942fd3ba979848b2995d4debffa387b9b19ae + checksum: b1d06f358dedcb748a57e5feea4b9285c60593fb2912b921f22898c57c552c78fe18128678c8f84dd4ea1d4e5aebede8783830b24cd63f22c30261156d78bc77 languageName: node linkType: hard @@ -1914,18 +1892,18 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-destructuring@npm:^7.12.1, @babel/plugin-transform-destructuring@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-destructuring@npm:7.22.5" +"@babel/plugin-transform-destructuring@npm:^7.12.1, @babel/plugin-transform-destructuring@npm:^7.22.10": + version: 7.22.10 + resolution: "@babel/plugin-transform-destructuring@npm:7.22.10" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 76f6ea2aee1fcfa1c3791eb7a5b89703c6472650b993e8666fff0f1d6e9d737a84134edf89f63c92297f3e75064c1263219463b02dd9bc7434b6e5b9935e3f20 + checksum: 011707801bd0029fd4f0523d24d06fdc0cbe8c9da280d75728f76713d639c4dc976e1b56a1ba7bff25468f86867efb71c9b4cac81140adbdd0abf2324b19a8bb languageName: node linkType: hard -"@babel/plugin-transform-dotall-regex@npm:^7.22.5, @babel/plugin-transform-dotall-regex@npm:^7.4.4": +"@babel/plugin-transform-dotall-regex@npm:^7.22.5": version: 7.22.5 resolution: "@babel/plugin-transform-dotall-regex@npm:7.22.5" dependencies: @@ -2203,16 +2181,16 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-optional-chaining@npm:^7.22.5, @babel/plugin-transform-optional-chaining@npm:^7.22.6": - version: 7.22.6 - resolution: "@babel/plugin-transform-optional-chaining@npm:7.22.6" +"@babel/plugin-transform-optional-chaining@npm:^7.22.10, @babel/plugin-transform-optional-chaining@npm:^7.22.5": + version: 7.22.10 + resolution: "@babel/plugin-transform-optional-chaining@npm:7.22.10" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 "@babel/plugin-syntax-optional-chaining": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 9713f7920ed04090c149fc5ec024dd1638e8b97aa4ae3753b93072d84103b8de380afb96d6cf03e53b285420db4f705f3ac13149c6fd54f322b61dc19e33c54f + checksum: 522d6214bb9f6ede8a2fc56a873e791aabd62f0b3be78fb8e62ca801a9033bcadabfb77aec6739f0e67f0f15f7c739c08bafafd66d3676edf1941fe6429cebcd languageName: node linkType: hard @@ -2335,15 +2313,15 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-regenerator@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-regenerator@npm:7.22.5" +"@babel/plugin-transform-regenerator@npm:^7.22.10": + version: 7.22.10 + resolution: "@babel/plugin-transform-regenerator@npm:7.22.10" dependencies: "@babel/helper-plugin-utils": ^7.22.5 - regenerator-transform: ^0.15.1 + regenerator-transform: ^0.15.2 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: f7c5ca5151321963df777cc02725d10d1ccc3b3b8323da0423aecd9ac6144cbdd2274af5281a5580db2fc2f8b234e318517b5d76b85669118906533a559f2b6a + checksum: e13678d62d6fa96f11cb8b863f00e8693491e7adc88bfca3f2820f80cbac8336e7dec3a596eee6a1c4663b7ececc3564f2cd7fb44ed6d4ce84ac2bb7f39ecc6e languageName: node linkType: hard @@ -2428,14 +2406,14 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-unicode-escapes@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-unicode-escapes@npm:7.22.5" +"@babel/plugin-transform-unicode-escapes@npm:^7.22.10": + version: 7.22.10 + resolution: "@babel/plugin-transform-unicode-escapes@npm:7.22.10" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: da5e85ab3bb33a75cbf6181bfd236b208dc934702fd304db127232f17b4e0f42c6d3f238de8589470b4190906967eea8ca27adf3ae9d8ee4de2a2eae906ed186 + checksum: 807f40ed1324c8cb107c45358f1903384ca3f0ef1d01c5a3c5c9b271c8d8eec66936a3dcc8d75ddfceea9421420368c2e77ae3adef0a50557e778dfe296bf382 languageName: node linkType: hard @@ -2475,12 +2453,12 @@ __metadata: languageName: node linkType: hard -"@babel/preset-env@npm:^7.12.11, @babel/preset-env@npm:~7.22.9": - version: 7.22.9 - resolution: "@babel/preset-env@npm:7.22.9" +"@babel/preset-env@npm:^7.12.11, @babel/preset-env@npm:~7.22.10, @babel/preset-env@npm:~7.22.9": + version: 7.22.10 + resolution: "@babel/preset-env@npm:7.22.10" dependencies: "@babel/compat-data": ^7.22.9 - "@babel/helper-compilation-targets": ^7.22.9 + "@babel/helper-compilation-targets": ^7.22.10 "@babel/helper-plugin-utils": ^7.22.5 "@babel/helper-validator-option": ^7.22.5 "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": ^7.22.5 @@ -2505,15 +2483,15 @@ __metadata: "@babel/plugin-syntax-top-level-await": ^7.14.5 "@babel/plugin-syntax-unicode-sets-regex": ^7.18.6 "@babel/plugin-transform-arrow-functions": ^7.22.5 - "@babel/plugin-transform-async-generator-functions": ^7.22.7 + "@babel/plugin-transform-async-generator-functions": ^7.22.10 "@babel/plugin-transform-async-to-generator": ^7.22.5 "@babel/plugin-transform-block-scoped-functions": ^7.22.5 - "@babel/plugin-transform-block-scoping": ^7.22.5 + "@babel/plugin-transform-block-scoping": ^7.22.10 "@babel/plugin-transform-class-properties": ^7.22.5 "@babel/plugin-transform-class-static-block": ^7.22.5 "@babel/plugin-transform-classes": ^7.22.6 "@babel/plugin-transform-computed-properties": ^7.22.5 - "@babel/plugin-transform-destructuring": ^7.22.5 + "@babel/plugin-transform-destructuring": ^7.22.10 "@babel/plugin-transform-dotall-regex": ^7.22.5 "@babel/plugin-transform-duplicate-keys": ^7.22.5 "@babel/plugin-transform-dynamic-import": ^7.22.5 @@ -2536,32 +2514,32 @@ __metadata: "@babel/plugin-transform-object-rest-spread": ^7.22.5 "@babel/plugin-transform-object-super": ^7.22.5 "@babel/plugin-transform-optional-catch-binding": ^7.22.5 - "@babel/plugin-transform-optional-chaining": ^7.22.6 + "@babel/plugin-transform-optional-chaining": ^7.22.10 "@babel/plugin-transform-parameters": ^7.22.5 "@babel/plugin-transform-private-methods": ^7.22.5 "@babel/plugin-transform-private-property-in-object": ^7.22.5 "@babel/plugin-transform-property-literals": ^7.22.5 - "@babel/plugin-transform-regenerator": ^7.22.5 + "@babel/plugin-transform-regenerator": ^7.22.10 "@babel/plugin-transform-reserved-words": ^7.22.5 "@babel/plugin-transform-shorthand-properties": ^7.22.5 "@babel/plugin-transform-spread": ^7.22.5 "@babel/plugin-transform-sticky-regex": ^7.22.5 "@babel/plugin-transform-template-literals": ^7.22.5 "@babel/plugin-transform-typeof-symbol": ^7.22.5 - "@babel/plugin-transform-unicode-escapes": ^7.22.5 + "@babel/plugin-transform-unicode-escapes": ^7.22.10 "@babel/plugin-transform-unicode-property-regex": ^7.22.5 "@babel/plugin-transform-unicode-regex": ^7.22.5 "@babel/plugin-transform-unicode-sets-regex": ^7.22.5 - "@babel/preset-modules": ^0.1.5 - "@babel/types": ^7.22.5 - babel-plugin-polyfill-corejs2: ^0.4.4 - babel-plugin-polyfill-corejs3: ^0.8.2 - babel-plugin-polyfill-regenerator: ^0.5.1 + "@babel/preset-modules": 0.1.6-no-external-plugins + "@babel/types": ^7.22.10 + babel-plugin-polyfill-corejs2: ^0.4.5 + babel-plugin-polyfill-corejs3: ^0.8.3 + babel-plugin-polyfill-regenerator: ^0.5.2 core-js-compat: ^3.31.0 semver: ^6.3.1 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 6caa2897bbda30c6932aed0a03827deb1337c57108050c9f97dc9a857e1533c7125b168b6d70b9d191965bf05f9f233f0ad20303080505dff7ce39740aaa759d + checksum: 4145a660a7b05e21e6d8b6cdf348c6931238abb15282a258bdb5e04cd3cca9356dc120ecfe0d1b977819ade4aac50163127c86db2300227ff60392d24daa0b7c languageName: node linkType: hard @@ -2578,18 +2556,16 @@ __metadata: languageName: node linkType: hard -"@babel/preset-modules@npm:^0.1.5": - version: 0.1.5 - resolution: "@babel/preset-modules@npm:0.1.5" +"@babel/preset-modules@npm:0.1.6-no-external-plugins": + version: 0.1.6-no-external-plugins + resolution: "@babel/preset-modules@npm:0.1.6-no-external-plugins" dependencies: "@babel/helper-plugin-utils": ^7.0.0 - "@babel/plugin-proposal-unicode-property-regex": ^7.4.4 - "@babel/plugin-transform-dotall-regex": ^7.4.4 "@babel/types": ^7.4.4 esutils: ^2.0.2 peerDependencies: - "@babel/core": ^7.0.0-0 - checksum: 8430e0e9e9d520b53e22e8c4c6a5a080a12b63af6eabe559c2310b187bd62ae113f3da82ba33e9d1d0f3230930ca702843aae9dd226dec51f7d7114dc1f51c10 + "@babel/core": ^7.0.0-0 || ^8.0.0-0 <8.0.0 + checksum: 4855e799bc50f2449fb5210f78ea9e8fd46cf4f242243f1e2ed838e2bd702e25e73e822e7f8447722a5f4baa5e67a8f7a0e403f3e7ce04540ff743a9c411c375 languageName: node linkType: hard @@ -2655,12 +2631,12 @@ __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.15.4, @babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.20.1, @babel/runtime@npm:^7.20.13, @babel/runtime@npm:^7.20.6, @babel/runtime@npm:^7.5.0, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.6.2, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.9.2, @babel/runtime@npm:~7.22.6": - version: 7.22.6 - resolution: "@babel/runtime@npm:7.22.6" +"@babel/runtime@npm:^7.0.0, @babel/runtime@npm:^7.11.2, @babel/runtime@npm:^7.12.5, @babel/runtime@npm:^7.13.10, @babel/runtime@npm:^7.15.4, @babel/runtime@npm:^7.17.2, @babel/runtime@npm:^7.17.8, @babel/runtime@npm:^7.20.1, @babel/runtime@npm:^7.20.13, @babel/runtime@npm:^7.22.5, @babel/runtime@npm:^7.5.0, @babel/runtime@npm:^7.5.5, @babel/runtime@npm:^7.6.2, @babel/runtime@npm:^7.7.6, @babel/runtime@npm:^7.8.4, @babel/runtime@npm:^7.9.2, @babel/runtime@npm:~7.22.6": + version: 7.22.10 + resolution: "@babel/runtime@npm:7.22.10" dependencies: - regenerator-runtime: ^0.13.11 - checksum: e585338287c4514a713babf4fdb8fc2a67adcebab3e7723a739fc62c79cfda875b314c90fd25f827afb150d781af97bc16c85bfdbfa2889f06053879a1ddb597 + regenerator-runtime: ^0.14.0 + checksum: 524d41517e68953dbc73a4f3616b8475e5813f64e28ba89ff5fca2c044d535c2ea1a3f310df1e5bb06162e1f0b401b5c4af73fe6e2519ca2450d9d8c44cf268d languageName: node linkType: hard @@ -2684,43 +2660,32 @@ __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.22.5, @babel/traverse@npm:^7.22.6, @babel/traverse@npm:^7.22.8": - version: 7.22.8 - resolution: "@babel/traverse@npm:7.22.8" +"@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.22.10, @babel/traverse@npm:^7.22.5": + version: 7.22.10 + resolution: "@babel/traverse@npm:7.22.10" dependencies: - "@babel/code-frame": ^7.22.5 - "@babel/generator": ^7.22.7 + "@babel/code-frame": ^7.22.10 + "@babel/generator": ^7.22.10 "@babel/helper-environment-visitor": ^7.22.5 "@babel/helper-function-name": ^7.22.5 "@babel/helper-hoist-variables": ^7.22.5 "@babel/helper-split-export-declaration": ^7.22.6 - "@babel/parser": ^7.22.7 - "@babel/types": ^7.22.5 + "@babel/parser": ^7.22.10 + "@babel/types": ^7.22.10 debug: ^4.1.0 globals: ^11.1.0 - checksum: a381369bc3eedfd13ed5fef7b884657f1c29024ea7388198149f0edc34bd69ce3966e9f40188d15f56490a5e12ba250ccc485f2882b53d41b054fccefb233e33 + checksum: 9f7b358563bfb0f57ac4ed639f50e5c29a36b821a1ce1eea0c7db084f5b925e3275846d0de63bde01ca407c85d9804e0efbe370d92cd2baaafde3bd13b0f4cdb 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.2.0, @babel/types@npm:^7.22.5, @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.22.5 - resolution: "@babel/types@npm:7.22.5" +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.11, @babel/types@npm:^7.12.7, @babel/types@npm:^7.2.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.10, @babel/types@npm:^7.22.5, @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.22.10 + resolution: "@babel/types@npm:7.22.10" dependencies: "@babel/helper-string-parser": ^7.22.5 "@babel/helper-validator-identifier": ^7.22.5 to-fast-properties: ^2.0.0 - checksum: c13a9c1dc7d2d1a241a2f8363540cb9af1d66e978e8984b400a20c4f38ba38ca29f06e26a0f2d49a70bad9e57615dac09c35accfddf1bb90d23cd3e0a0bab892 - languageName: node - linkType: hard - -"@babel/types@npm:^7.20.7": - version: 7.20.7 - resolution: "@babel/types@npm:7.20.7" - dependencies: - "@babel/helper-string-parser": ^7.19.4 - "@babel/helper-validator-identifier": ^7.19.1 - to-fast-properties: ^2.0.0 - checksum: b39af241f0b72bba67fd6d0d23914f6faec8c0eba8015c181cbd5ea92e59fc91a52a1ab490d3520c7dbd19ddb9ebb76c476308f6388764f16d8201e37fae6811 + checksum: 095c4f4b7503fa816e4094113f0ec2351ef96ff32012010b771693066ff628c7c664b21c6bd3fb93aeb46fe7c61f6b3a3c9e4ed0034d6a2481201c417371c8af languageName: node linkType: hard @@ -3348,6 +3313,15 @@ __metadata: languageName: node linkType: hard +"@emotion/use-insertion-effect-with-fallbacks@npm:^1.0.0": + version: 1.0.1 + resolution: "@emotion/use-insertion-effect-with-fallbacks@npm:1.0.1" + peerDependencies: + react: ">=16.8.0" + checksum: 700b6e5bbb37a9231f203bb3af11295eed01d73b2293abece0bc2a2237015e944d7b5114d4887ad9a79776504aa51ed2a8b0ddbc117c54495dd01a6b22f93786 + languageName: node + linkType: hard + "@esbuild/android-arm64@npm:0.17.19": version: 0.17.19 resolution: "@esbuild/android-arm64@npm:0.17.19" @@ -3568,6 +3542,44 @@ __metadata: languageName: node linkType: hard +"@floating-ui/core@npm:^1.4.1": + version: 1.4.1 + resolution: "@floating-ui/core@npm:1.4.1" + dependencies: + "@floating-ui/utils": ^0.1.1 + checksum: be4ab864fe17eeba5e205bd554c264b9a4895a57c573661bbf638357fa3108677fed7ba3269ec15b4da90e29274c9b626d5a15414e8d1fe691e210d02a03695c + languageName: node + linkType: hard + +"@floating-ui/dom@npm:^1.3.0": + version: 1.5.1 + resolution: "@floating-ui/dom@npm:1.5.1" + dependencies: + "@floating-ui/core": ^1.4.1 + "@floating-ui/utils": ^0.1.1 + checksum: ddb509030978536ba7b321cf8c764ae9d0142a3b1fefb7e6bc050a5de7e825e12131fa5089009edabf7c125fb274886da211a5220fe17a71d875a7a96eb1386c + languageName: node + linkType: hard + +"@floating-ui/react-dom@npm:^2.0.0": + version: 2.0.1 + resolution: "@floating-ui/react-dom@npm:2.0.1" + dependencies: + "@floating-ui/dom": ^1.3.0 + peerDependencies: + react: ">=16.8.0" + react-dom: ">=16.8.0" + checksum: 00fef2cf69ac2b15952e47505fd9e23f6cc5c20a26adc707862932826d1682f3c30f83c9887abfc93574fdca2d34dd2fc00271527318b1db403549cd6bc9eb00 + languageName: node + linkType: hard + +"@floating-ui/utils@npm:^0.1.1": + version: 0.1.1 + resolution: "@floating-ui/utils@npm:0.1.1" + checksum: 548acdda7902f45b0afbe34e2e7f4cbff0696b95bad8c039f80936519de24ef2ec20e79902825b7815294b37f51a7c52ee86288b0688869a57cc229a164d86b4 + languageName: node + linkType: hard + "@formatjs/ecma402-abstract@npm:1.12.0": version: 1.12.0 resolution: "@formatjs/ecma402-abstract@npm:1.12.0" @@ -4162,7 +4174,7 @@ __metadata: languageName: node linkType: hard -"@juggle/resize-observer@npm:^3.4.0": +"@juggle/resize-observer@npm:^3.3.1, @juggle/resize-observer@npm:^3.4.0": version: 3.4.0 resolution: "@juggle/resize-observer@npm:3.4.0" checksum: 2505028c05cc2e17639fcad06218b1c4b60f932a4ebb4b41ab546ef8c157031ae377e3f560903801f6d01706dbefd4943b6c4704bf19ed86dfa1c62f1473a570 @@ -5085,6 +5097,574 @@ __metadata: languageName: node linkType: hard +"@radix-ui/number@npm:1.0.1": + version: 1.0.1 + resolution: "@radix-ui/number@npm:1.0.1" + dependencies: + "@babel/runtime": ^7.13.10 + checksum: 621ea8b7d4195d1a65a9c0aee918e8335e7f198088eec91577512c89c2ba3a3bab4a767cfb872a2b9c3092a78ff41cad9a924845a939f6bb87fe9356241ea0ea + languageName: node + linkType: hard + +"@radix-ui/primitive@npm:1.0.1": + version: 1.0.1 + resolution: "@radix-ui/primitive@npm:1.0.1" + dependencies: + "@babel/runtime": ^7.13.10 + checksum: 2b93e161d3fdabe9a64919def7fa3ceaecf2848341e9211520c401181c9eaebb8451c630b066fad2256e5c639c95edc41de0ba59c40eff37e799918d019822d1 + languageName: node + linkType: hard + +"@radix-ui/react-arrow@npm:1.0.3": + version: 1.0.3 + resolution: "@radix-ui/react-arrow@npm:1.0.3" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/react-primitive": 1.0.3 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 8cca086f0dbb33360e3c0142adf72f99fc96352d7086d6c2356dbb2ea5944cfb720a87d526fc48087741c602cd8162ca02b0af5e6fdf5f56d20fddb44db8b4c3 + languageName: node + linkType: hard + +"@radix-ui/react-collection@npm:1.0.3": + version: 1.0.3 + resolution: "@radix-ui/react-collection@npm:1.0.3" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/react-compose-refs": 1.0.1 + "@radix-ui/react-context": 1.0.1 + "@radix-ui/react-primitive": 1.0.3 + "@radix-ui/react-slot": 1.0.2 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: acfbc9b0b2c553d343c22f02c9f098bc5cfa99e6e48df91c0d671855013f8b877ade9c657b7420a7aa523b5aceadea32a60dd72c23b1291f415684fb45d00cff + languageName: node + linkType: hard + +"@radix-ui/react-compose-refs@npm:1.0.1": + version: 1.0.1 + resolution: "@radix-ui/react-compose-refs@npm:1.0.1" + dependencies: + "@babel/runtime": ^7.13.10 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 2b9a613b6db5bff8865588b6bf4065f73021b3d16c0a90b2d4c23deceeb63612f1f15de188227ebdc5f88222cab031be617a9dd025874c0487b303be3e5cc2a8 + languageName: node + linkType: hard + +"@radix-ui/react-context@npm:1.0.1": + version: 1.0.1 + resolution: "@radix-ui/react-context@npm:1.0.1" + dependencies: + "@babel/runtime": ^7.13.10 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 60e9b81d364f40c91a6213ec953f7c64fcd9d75721205a494a5815b3e5ae0719193429b62ee6c7002cd6aaf70f8c0e2f08bdbaba9ffcc233044d32b56d2127d1 + languageName: node + linkType: hard + +"@radix-ui/react-direction@npm:1.0.1": + version: 1.0.1 + resolution: "@radix-ui/react-direction@npm:1.0.1" + dependencies: + "@babel/runtime": ^7.13.10 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 5336a8b0d4f1cde585d5c2b4448af7b3d948bb63a1aadb37c77771b0e5902dc6266e409cf35fd0edaca7f33e26424be19e64fb8f9d7f7be2d6f1714ea2764210 + languageName: node + linkType: hard + +"@radix-ui/react-dismissable-layer@npm:1.0.4": + version: 1.0.4 + resolution: "@radix-ui/react-dismissable-layer@npm:1.0.4" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/primitive": 1.0.1 + "@radix-ui/react-compose-refs": 1.0.1 + "@radix-ui/react-primitive": 1.0.3 + "@radix-ui/react-use-callback-ref": 1.0.1 + "@radix-ui/react-use-escape-keydown": 1.0.3 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: ea86004ed56a10609dd84eef39dc1e57b400d687a35be41bb4aaa06dc7ad6dbd0a8da281e08c8c077fdbd523122e4d860cb7438a60c664f024f77c8b41299ec6 + languageName: node + linkType: hard + +"@radix-ui/react-focus-guards@npm:1.0.1": + version: 1.0.1 + resolution: "@radix-ui/react-focus-guards@npm:1.0.1" + dependencies: + "@babel/runtime": ^7.13.10 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 1f8ca8f83b884b3612788d0742f3f054e327856d90a39841a47897dbed95e114ee512362ae314177de226d05310047cabbf66b686ae86ad1b65b6b295be24ef7 + languageName: node + linkType: hard + +"@radix-ui/react-focus-scope@npm:1.0.3": + version: 1.0.3 + resolution: "@radix-ui/react-focus-scope@npm:1.0.3" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/react-compose-refs": 1.0.1 + "@radix-ui/react-primitive": 1.0.3 + "@radix-ui/react-use-callback-ref": 1.0.1 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: e5b1a089071fbe77aca11124a4ad9623fc2bcaf4c019759b0cd044bf0878ecc924131ee09c6a22d38a3f094684ef68ed18fa65c8d891918412e0afc685a464e0 + languageName: node + linkType: hard + +"@radix-ui/react-id@npm:1.0.1": + version: 1.0.1 + resolution: "@radix-ui/react-id@npm:1.0.1" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/react-use-layout-effect": 1.0.1 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 446a453d799cc790dd2a1583ff8328da88271bff64530b5a17c102fa7fb35eece3cf8985359d416f65e330cd81aa7b8fe984ea125fc4f4eaf4b3801d698e49fe + languageName: node + linkType: hard + +"@radix-ui/react-popper@npm:1.1.2": + version: 1.1.2 + resolution: "@radix-ui/react-popper@npm:1.1.2" + dependencies: + "@babel/runtime": ^7.13.10 + "@floating-ui/react-dom": ^2.0.0 + "@radix-ui/react-arrow": 1.0.3 + "@radix-ui/react-compose-refs": 1.0.1 + "@radix-ui/react-context": 1.0.1 + "@radix-ui/react-primitive": 1.0.3 + "@radix-ui/react-use-callback-ref": 1.0.1 + "@radix-ui/react-use-layout-effect": 1.0.1 + "@radix-ui/react-use-rect": 1.0.1 + "@radix-ui/react-use-size": 1.0.1 + "@radix-ui/rect": 1.0.1 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 4929daa0d1cccada3cff50de0e00c0d186ffea97a5f28545c77fa85ff9bc5c105a54dddac400c2e2dcac631f0f7ea88e59f2e5ad0f80bb2cb7b62cc7cd30400f + languageName: node + linkType: hard + +"@radix-ui/react-portal@npm:1.0.3": + version: 1.0.3 + resolution: "@radix-ui/react-portal@npm:1.0.3" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/react-primitive": 1.0.3 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: d352bcd6ad65eb43c9e0d72d0755c2aae85e03fb287770866262be3a2d5302b2885aee3cd99f2bbf62ecd14fcb1460703f1dcdc40351f77ad887b931c6f0012a + languageName: node + linkType: hard + +"@radix-ui/react-primitive@npm:1.0.3": + version: 1.0.3 + resolution: "@radix-ui/react-primitive@npm:1.0.3" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/react-slot": 1.0.2 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 9402bc22923c8e5c479051974a721c301535c36521c0237b83e5fa213d013174e77f3ad7905e6d60ef07e14f88ec7f4ea69891dc7a2b39047f8d3640e8f8d713 + languageName: node + linkType: hard + +"@radix-ui/react-roving-focus@npm:1.0.4": + version: 1.0.4 + resolution: "@radix-ui/react-roving-focus@npm:1.0.4" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/primitive": 1.0.1 + "@radix-ui/react-collection": 1.0.3 + "@radix-ui/react-compose-refs": 1.0.1 + "@radix-ui/react-context": 1.0.1 + "@radix-ui/react-direction": 1.0.1 + "@radix-ui/react-id": 1.0.1 + "@radix-ui/react-primitive": 1.0.3 + "@radix-ui/react-use-callback-ref": 1.0.1 + "@radix-ui/react-use-controllable-state": 1.0.1 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 69b1c82c2d9db3ba71549a848f2704200dab1b2cd22d050c1e081a78b9a567dbfdc7fd0403ee010c19b79652de69924d8ca2076cd031d6552901e4213493ffc7 + languageName: node + linkType: hard + +"@radix-ui/react-select@npm:^1.2.2": + version: 1.2.2 + resolution: "@radix-ui/react-select@npm:1.2.2" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/number": 1.0.1 + "@radix-ui/primitive": 1.0.1 + "@radix-ui/react-collection": 1.0.3 + "@radix-ui/react-compose-refs": 1.0.1 + "@radix-ui/react-context": 1.0.1 + "@radix-ui/react-direction": 1.0.1 + "@radix-ui/react-dismissable-layer": 1.0.4 + "@radix-ui/react-focus-guards": 1.0.1 + "@radix-ui/react-focus-scope": 1.0.3 + "@radix-ui/react-id": 1.0.1 + "@radix-ui/react-popper": 1.1.2 + "@radix-ui/react-portal": 1.0.3 + "@radix-ui/react-primitive": 1.0.3 + "@radix-ui/react-slot": 1.0.2 + "@radix-ui/react-use-callback-ref": 1.0.1 + "@radix-ui/react-use-controllable-state": 1.0.1 + "@radix-ui/react-use-layout-effect": 1.0.1 + "@radix-ui/react-use-previous": 1.0.1 + "@radix-ui/react-visually-hidden": 1.0.3 + aria-hidden: ^1.1.1 + react-remove-scroll: 2.5.5 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: af7b63cc9e2c6006ec08163392d244941e9e03534e7add1b7c5a86059d0eb8a0398d4f3e80d43ff22126874a02b985e44f1722d1de9218922f7aa653d09412e3 + languageName: node + linkType: hard + +"@radix-ui/react-separator@npm:1.0.3": + version: 1.0.3 + resolution: "@radix-ui/react-separator@npm:1.0.3" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/react-primitive": 1.0.3 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 42f8c95e404de2ce9387040d78049808a48d423cd4c3bad8cca92c4b0bcbdcb3566b5b52a920d4e939a74b51188697f20a012221f0e630fc7f56de64096c15d2 + languageName: node + linkType: hard + +"@radix-ui/react-slot@npm:1.0.2": + version: 1.0.2 + resolution: "@radix-ui/react-slot@npm:1.0.2" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/react-compose-refs": 1.0.1 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: edf5edf435ff594bea7e198bf16d46caf81b6fb559493acad4fa8c308218896136acb16f9b7238c788fd13e94a904f2fd0b6d834e530e4cae94522cdb8f77ce9 + languageName: node + linkType: hard + +"@radix-ui/react-toggle-group@npm:1.0.4": + version: 1.0.4 + resolution: "@radix-ui/react-toggle-group@npm:1.0.4" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/primitive": 1.0.1 + "@radix-ui/react-context": 1.0.1 + "@radix-ui/react-direction": 1.0.1 + "@radix-ui/react-primitive": 1.0.3 + "@radix-ui/react-roving-focus": 1.0.4 + "@radix-ui/react-toggle": 1.0.3 + "@radix-ui/react-use-controllable-state": 1.0.1 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: b6c11fbbc3ca857ff68c0fa31f293c0d0111bcc8aa0cde2566214c090907530bfcb3b862f81585c2b02d8989b5c7971acff4d5c07c429870d80bd5602e30d376 + languageName: node + linkType: hard + +"@radix-ui/react-toggle@npm:1.0.3": + version: 1.0.3 + resolution: "@radix-ui/react-toggle@npm:1.0.3" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/primitive": 1.0.1 + "@radix-ui/react-primitive": 1.0.3 + "@radix-ui/react-use-controllable-state": 1.0.1 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: ed5407f48254f20cda542017774f259d0b2c0007ea4bd7287d10d751016dbf269cb13d1142591432c269c3ab768cde2f1ba0344743027d36bbec10af909f19de + languageName: node + linkType: hard + +"@radix-ui/react-toolbar@npm:^1.0.4": + version: 1.0.4 + resolution: "@radix-ui/react-toolbar@npm:1.0.4" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/primitive": 1.0.1 + "@radix-ui/react-context": 1.0.1 + "@radix-ui/react-direction": 1.0.1 + "@radix-ui/react-primitive": 1.0.3 + "@radix-ui/react-roving-focus": 1.0.4 + "@radix-ui/react-separator": 1.0.3 + "@radix-ui/react-toggle-group": 1.0.4 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 7ebee1f8add6510108979433c5b38627e2de9d48ef2172ca15274b9edbbc106ff43bcd47ff733b03ed2215b92e7af364ff82c79e5a1728374847e2b1e315552c + languageName: node + linkType: hard + +"@radix-ui/react-use-callback-ref@npm:1.0.1": + version: 1.0.1 + resolution: "@radix-ui/react-use-callback-ref@npm:1.0.1" + dependencies: + "@babel/runtime": ^7.13.10 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: b9fd39911c3644bbda14a84e4fca080682bef84212b8d8931fcaa2d2814465de242c4cfd8d7afb3020646bead9c5e539d478cea0a7031bee8a8a3bb164f3bc4c + languageName: node + linkType: hard + +"@radix-ui/react-use-controllable-state@npm:1.0.1": + version: 1.0.1 + resolution: "@radix-ui/react-use-controllable-state@npm:1.0.1" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/react-use-callback-ref": 1.0.1 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: dee2be1937d293c3a492cb6d279fc11495a8f19dc595cdbfe24b434e917302f9ac91db24e8cc5af9a065f3f209c3423115b5442e65a5be9fd1e9091338972be9 + languageName: node + linkType: hard + +"@radix-ui/react-use-escape-keydown@npm:1.0.3": + version: 1.0.3 + resolution: "@radix-ui/react-use-escape-keydown@npm:1.0.3" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/react-use-callback-ref": 1.0.1 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: c6ed0d9ce780f67f924980eb305af1f6cce2a8acbaf043a58abe0aa3cc551d9aa76ccee14531df89bbee302ead7ecc7fce330886f82d4672c5eda52f357ef9b8 + languageName: node + linkType: hard + +"@radix-ui/react-use-layout-effect@npm:1.0.1": + version: 1.0.1 + resolution: "@radix-ui/react-use-layout-effect@npm:1.0.1" + dependencies: + "@babel/runtime": ^7.13.10 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: bed9c7e8de243a5ec3b93bb6a5860950b0dba359b6680c84d57c7a655e123dec9b5891c5dfe81ab970652e7779fe2ad102a23177c7896dde95f7340817d47ae5 + languageName: node + linkType: hard + +"@radix-ui/react-use-previous@npm:1.0.1": + version: 1.0.1 + resolution: "@radix-ui/react-use-previous@npm:1.0.1" + dependencies: + "@babel/runtime": ^7.13.10 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 66b4312e857c58b75f3bf62a2048ef090b79a159e9da06c19a468c93e62336969c33dbef60ff16969f00b20386cc25d138f6a353f1658b35baac0a6eff4761b9 + languageName: node + linkType: hard + +"@radix-ui/react-use-rect@npm:1.0.1": + version: 1.0.1 + resolution: "@radix-ui/react-use-rect@npm:1.0.1" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/rect": 1.0.1 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 433f07e61e04eb222349825bb05f3591fca131313a1d03709565d6226d8660bd1d0423635553f95ee4fcc25c8f2050972d848808d753c388e2a9ae191ebf17f3 + languageName: node + linkType: hard + +"@radix-ui/react-use-size@npm:1.0.1": + version: 1.0.1 + resolution: "@radix-ui/react-use-size@npm:1.0.1" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/react-use-layout-effect": 1.0.1 + peerDependencies: + "@types/react": "*" + react: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 6cc150ad1e9fa85019c225c5a5d50a0af6cdc4653dad0c21b4b40cd2121f36ee076db326c43e6bc91a69766ccff5a84e917d27970176b592577deea3c85a3e26 + languageName: node + linkType: hard + +"@radix-ui/react-visually-hidden@npm:1.0.3": + version: 1.0.3 + resolution: "@radix-ui/react-visually-hidden@npm:1.0.3" + dependencies: + "@babel/runtime": ^7.13.10 + "@radix-ui/react-primitive": 1.0.3 + peerDependencies: + "@types/react": "*" + "@types/react-dom": "*" + react: ^16.8 || ^17.0 || ^18.0 + react-dom: ^16.8 || ^17.0 || ^18.0 + peerDependenciesMeta: + "@types/react": + optional: true + "@types/react-dom": + optional: true + checksum: 2e9d0c8253f97e7d6ffb2e52a5cfd40ba719f813b39c3e2e42c496d54408abd09ef66b5aec4af9b8ab0553215e32452a5d0934597a49c51dd90dc39181ed0d57 + languageName: node + linkType: hard + +"@radix-ui/rect@npm:1.0.1": + version: 1.0.1 + resolution: "@radix-ui/rect@npm:1.0.1" + dependencies: + "@babel/runtime": ^7.13.10 + checksum: aeec13b234a946052512d05239067d2d63422f9ec70bf2fe7acfd6b9196693fc33fbaf43c2667c167f777d90a095c6604eb487e0bce79e230b6df0f6cacd6a55 + languageName: node + linkType: hard + "@react-aria/breadcrumbs@npm:^3.5.0": version: 3.5.1 resolution: "@react-aria/breadcrumbs@npm:3.5.1" @@ -7324,60 +7904,38 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/css-in-js@npm:^0.31.24, @rocket.chat/css-in-js@npm:~0.31.23-dev.180": - version: 0.31.24 - resolution: "@rocket.chat/css-in-js@npm:0.31.24" - dependencies: - "@emotion/hash": ^0.9.0 - "@rocket.chat/css-supports": ^0.31.24 - "@rocket.chat/memo": ^0.31.24 - "@rocket.chat/stylis-logical-props-middleware": ^0.31.24 - stylis: ~4.1.3 - checksum: aa343748e7eebdbcd95d6593fd9e039479fe7fe5fd579f81910ccf6130018a8d20a96556c19b16b356a6ce07e90b544520a839699a682fdbd943400b24ba6269 - languageName: node - linkType: hard - "@rocket.chat/css-in-js@npm:next": - version: 0.31.23-dev.180 - resolution: "@rocket.chat/css-in-js@npm:0.31.23-dev.180" + version: 0.31.26-dev.2 + resolution: "@rocket.chat/css-in-js@npm:0.31.26-dev.2" dependencies: "@emotion/hash": ^0.9.0 - "@rocket.chat/css-supports": ~0.31.23-dev.180 - "@rocket.chat/memo": ~0.31.23-dev.180 - "@rocket.chat/stylis-logical-props-middleware": ~0.31.23-dev.180 + "@rocket.chat/css-supports": ~0.31.26-dev.7 + "@rocket.chat/memo": ~0.31.26-dev.7 + "@rocket.chat/stylis-logical-props-middleware": ~0.31.26-dev.7 stylis: ~4.1.3 - checksum: e89833effb8d1a8a8e5cc3621540530e53c7aa98833f309b0df73f497afad25903252afc77da52186df975779b5a05dcfb18eee275fea81b473caf78c66d2005 + checksum: f4b1260109583ce9e47f1e7021138dae967fb5fdbd16ce1b506be5423ea39f8349f8a4a5a5aff46d3b74805370e0f9da0a6c14a3b97b954b96722938295712cb languageName: node linkType: hard -"@rocket.chat/css-in-js@npm:~0.31.26-dev.16": - version: 0.31.26-dev.16 - resolution: "@rocket.chat/css-in-js@npm:0.31.26-dev.16" +"@rocket.chat/css-in-js@npm:~0.31.26-dev.7": + version: 0.31.26-dev.7 + resolution: "@rocket.chat/css-in-js@npm:0.31.26-dev.7" dependencies: "@emotion/hash": ^0.9.0 - "@rocket.chat/css-supports": ~0.31.26-dev.16 - "@rocket.chat/memo": ~0.31.26-dev.16 - "@rocket.chat/stylis-logical-props-middleware": ~0.31.26-dev.16 + "@rocket.chat/css-supports": ~0.31.26-dev.7 + "@rocket.chat/memo": ~0.31.26-dev.7 + "@rocket.chat/stylis-logical-props-middleware": ~0.31.26-dev.7 stylis: ~4.1.3 - checksum: 232d4e31d6439cc215982f5512921b6bfc607866fa0df07aa98a1f25e6b538e9604adb6ffbc3914dc820d7b6ee455643560199da544c2d7882818cdff8b00504 - languageName: node - linkType: hard - -"@rocket.chat/css-supports@npm:^0.31.24, @rocket.chat/css-supports@npm:~0.31.23-dev.180": - version: 0.31.24 - resolution: "@rocket.chat/css-supports@npm:0.31.24" - dependencies: - "@rocket.chat/memo": ^0.31.24 - checksum: 4efe737d588566ea7a95f1f29a33dc90987aae9e6c2f0b2b7995f9c813728dd72f62472f2a2f3e1bf0350ce3ad75807ec0c842ac6e61b6ddc8f89c69dc1086d0 + checksum: ca0e2d2a1df144360e06408f6f7e2c7480d72b915402e9b7c6d29abdc030cd0b9100940f4f7803e9463f61ac1a1466882c999d1524146221916b5bf04b0b1a00 languageName: node linkType: hard -"@rocket.chat/css-supports@npm:~0.31.26-dev.16": - version: 0.31.26-dev.16 - resolution: "@rocket.chat/css-supports@npm:0.31.26-dev.16" +"@rocket.chat/css-supports@npm:~0.31.26-dev.7": + version: 0.31.26-dev.7 + resolution: "@rocket.chat/css-supports@npm:0.31.26-dev.7" dependencies: - "@rocket.chat/memo": ~0.31.26-dev.16 - checksum: f7239f70ddef249e23825c1ac5143825cab012170aa67f44a232cf6b4b33d1cc3a365bfc3be4c29150fb494107155867881722ff1ebd610067f281d9b43207d1 + "@rocket.chat/memo": ~0.31.26-dev.7 + checksum: c359422b4a7ce5047a703887a5693b6514d289028bbf36bd62049b184e6e34999ea373842d9bc8314705668bfbad7aeb0ce42bdea346d9073dd9e8a571509634 languageName: node linkType: hard @@ -7451,9 +8009,9 @@ __metadata: linkType: soft "@rocket.chat/emitter@npm:next": - version: 0.31.23-dev.180 - resolution: "@rocket.chat/emitter@npm:0.31.23-dev.180" - checksum: 4a63bed9aa5260db85cc01b0131dd7fd6e8dfef956d64298c1fee805bca5a74b971dbcaff408efb497437daf672fb13b3d3caab6fef03720991c1c56349d96da + version: 0.31.26-dev.2 + resolution: "@rocket.chat/emitter@npm:0.31.26-dev.2" + checksum: db6f527026419d84e926526c3a67f81db320d3b774930226b9fe82c436692a793ce6a2c380b57e2ea1cc11e1c9cfb48f3eaa34fda91cecc9fb9ce7add53259d0 languageName: node linkType: hard @@ -7546,21 +8104,21 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/fuselage-hooks@npm:next, @rocket.chat/fuselage-hooks@npm:~0.32.0-dev.319": - version: 0.32.0-dev.319 - resolution: "@rocket.chat/fuselage-hooks@npm:0.32.0-dev.319" +"@rocket.chat/fuselage-hooks@npm:next, @rocket.chat/fuselage-hooks@npm:~0.32.0-dev.325": + version: 0.32.0-dev.325 + resolution: "@rocket.chat/fuselage-hooks@npm:0.32.0-dev.325" dependencies: use-sync-external-store: ~1.2.0 peerDependencies: "@rocket.chat/fuselage-tokens": "*" react: ^17.0.2 - checksum: 20b28d5297a252e35e7f63c9b18825fc1d3538ad7482389cf625a8fc1d6db9e8beb12abc0260e304295bd80af9a4da466c6e08e55c1fb0756a8eaeb07a41a22e + checksum: b34f4d337db932f754999034ebb6bb00327b7afe33f30c67330dfe432fda003d62b2264b965d2d12ecc55d9e66eb5e7ce59f6b7d7d7e5f19532f50cdadec4a46 languageName: node linkType: hard "@rocket.chat/fuselage-polyfills@npm:next": - version: 0.31.23-dev.180 - resolution: "@rocket.chat/fuselage-polyfills@npm:0.31.23-dev.180" + version: 0.31.26-dev.2 + resolution: "@rocket.chat/fuselage-polyfills@npm:0.31.26-dev.2" dependencies: "@juggle/resize-observer": ^3.4.0 clipboard-polyfill: ^3.0.3 @@ -7568,13 +8126,13 @@ __metadata: focus-visible: ^5.2.0 focus-within-polyfill: ^5.2.1 new-event-polyfill: ^1.0.1 - checksum: 4eccf1cc0e1137cfe44ef39bfacd384ece58c7225d8b1d0a9acbd1f422b7d67ef117340c1fe6768142e4f8e8caba38953ba339e583fcfe6259c6560fa470ca39 + checksum: ffa346ef683bd5add3ede98d156dbf951dedfb80f35e2ce54fd2d78db6a75822f22d5f64ab469e07ca340b57783cbfa2e969a615522f1f4f11384466554e3abc languageName: node linkType: hard "@rocket.chat/fuselage-toastbar@npm:next": - version: 0.32.0-dev.380 - resolution: "@rocket.chat/fuselage-toastbar@npm:0.32.0-dev.380" + version: 0.32.0-dev.386 + resolution: "@rocket.chat/fuselage-toastbar@npm:0.32.0-dev.386" peerDependencies: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" @@ -7582,21 +8140,21 @@ __metadata: "@rocket.chat/styled": "*" react: ^17.0.2 react-dom: ^17.0.2 - checksum: 8c69007addc3831e52be3ba8e79613f16f174eca052e692a28ae89fd0ab1ca318c66c98bc60c53b39b6a12a2f805caed41f6930317f0f8990612e57e12a82fe2 + checksum: d609f2b818e39a630021239ebaa385525cfe2e3c3984cadc30aec7785f0cf43671eccda13f0deba1dd56f6cb9614f01ac0a212a99bfa19b986bfb4624bbc559e languageName: node linkType: hard "@rocket.chat/fuselage-tokens@npm:next": - version: 0.32.0-dev.356 - resolution: "@rocket.chat/fuselage-tokens@npm:0.32.0-dev.356" - checksum: 7b5786b06c458cc93cdd229e899459f25eb428a545c79eb8c98d28163b20ffa603e43b48bb3640c8b581d53ca259c7fe177007e1b232c6e950eea496706590df + version: 0.32.0-dev.362 + resolution: "@rocket.chat/fuselage-tokens@npm:0.32.0-dev.362" + checksum: 6e5964c967fd5e265f75bf8d604d00b0d1de0f798993015b9fada4d7b8a581f7f1260e6d1fcace3244cb62b682cd55a1b8bb023981a5ba4d8d20563331aac3bf languageName: node linkType: hard -"@rocket.chat/fuselage-tokens@npm:~0.32.0-dev.376": - version: 0.32.0-dev.376 - resolution: "@rocket.chat/fuselage-tokens@npm:0.32.0-dev.376" - checksum: 8054593aa24eb77c0ec71e93ec07bf91b65c0d9d6f413641bce2f451a12416432c43271ceebb3a8439d5ed7148795d632716231907a93a35715d736fed4d834a +"@rocket.chat/fuselage-tokens@npm:~0.32.0-dev.367": + version: 0.32.0-dev.367 + resolution: "@rocket.chat/fuselage-tokens@npm:0.32.0-dev.367" + checksum: ae3781d7220a45ba813f78ba7d08dec9e333204808f6c93d41d7197e44f031496706dec78249001021ff1af300169e5440924b3dba419fae45bccbbc683fec02 languageName: node linkType: hard @@ -7656,14 +8214,14 @@ __metadata: linkType: soft "@rocket.chat/fuselage@npm:next": - version: 0.32.0-dev.426 - resolution: "@rocket.chat/fuselage@npm:0.32.0-dev.426" - dependencies: - "@rocket.chat/css-in-js": ~0.31.26-dev.16 - "@rocket.chat/css-supports": ~0.31.26-dev.16 - "@rocket.chat/fuselage-tokens": ~0.32.0-dev.376 - "@rocket.chat/memo": ~0.31.26-dev.16 - "@rocket.chat/styled": ~0.31.26-dev.16 + version: 0.32.0-dev.417 + resolution: "@rocket.chat/fuselage@npm:0.32.0-dev.417" + dependencies: + "@rocket.chat/css-in-js": ~0.31.26-dev.7 + "@rocket.chat/css-supports": ~0.31.26-dev.7 + "@rocket.chat/fuselage-tokens": ~0.32.0-dev.367 + "@rocket.chat/memo": ~0.31.26-dev.7 + "@rocket.chat/styled": ~0.31.26-dev.7 invariant: ^2.2.4 react-aria: ~3.23.1 react-keyed-flatten-children: ^1.3.0 @@ -7675,7 +8233,7 @@ __metadata: react: ^17.0.2 react-dom: ^17.0.2 react-virtuoso: 1.2.4 - checksum: 477a54211e5cb4676fdd5783f96a9a91622c8c99a3cb74a8f574d2d4a604a0f8c3fb415ea51ecfbabba17063fbfff077228cfbdacfed6449208ecd5f5312488a + checksum: 5b94df847d0714bf96ac09277d62178345a4ccee2f50e87985bebd9ed366da7950643315870a2c1f92732f0f06728219ebbd4d9ce0fe24434e3bf84da8e7f0f3 languageName: node linkType: hard @@ -7743,16 +8301,12 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/i18n@workspace:^, @rocket.chat/i18n@workspace:packages/i18n": +"@rocket.chat/i18n@workspace:^, @rocket.chat/i18n@workspace:packages/i18n, @rocket.chat/i18n@workspace:~": version: 0.0.0-use.local resolution: "@rocket.chat/i18n@workspace:packages/i18n" dependencies: - "@babel/core": ~7.22.9 - "@babel/preset-env": ~7.22.9 - "@babel/preset-typescript": ~7.22.5 - "@types/babel__core": ~7.20.1 - "@types/babel__preset-env": ~7.9.2 - "@types/jest": ~29.5.3 + "@babel/core": ~7.22.10 + "@babel/preset-env": ~7.22.10 babel-jest: ^29.5.0 eslint: ~8.45.0 jest: ~29.6.1 @@ -7763,9 +8317,9 @@ __metadata: linkType: soft "@rocket.chat/icons@npm:next": - version: 0.32.0-dev.388 - resolution: "@rocket.chat/icons@npm:0.32.0-dev.388" - checksum: 5b82b1f2c9b29b163c92fd5e9391e1c501e2a687aa0b4dc751b573430d2702454497bdc539d60b32c9b8f4403dc2168c78b5ffb5cbb9c18a216f16157e03d68c + version: 0.32.0-dev.394 + resolution: "@rocket.chat/icons@npm:0.32.0-dev.394" + checksum: 12bd6cda25f2dd45b41afd471578dc6f45f62b383bae38623eee0c457d51fd57eab5330ba67e525fc3204e7fd20cabf22ef5fb49c1483a7b5f51b8e00e91cdf3 languageName: node linkType: hard @@ -7783,14 +8337,14 @@ __metadata: linkType: soft "@rocket.chat/layout@npm:next": - version: 0.32.0-dev.289 - resolution: "@rocket.chat/layout@npm:0.32.0-dev.289" + version: 0.32.0-dev.295 + resolution: "@rocket.chat/layout@npm:0.32.0-dev.295" peerDependencies: "@rocket.chat/fuselage": "*" react: 17.0.2 react-dom: 17.0.2 react-i18next: ~11.15.4 - checksum: 369dc1b5052c367f249a0cd142e77329d4a2ebcb26598d8e5fc43f53896f71d6bc2ff9c36c6caa431f5319e3c32304626364832dc853a819202745e77a5e8257 + checksum: 5c6bb793fe92b2b47ebe6ba3e2d5529c38a45b9bc2c4485eb2bf04ab7d88454592d90d7bfb8c55eb18ee442f2d6d1de0d45667824c96eb4a1102f02b5cdd4bc2 languageName: node linkType: hard @@ -7842,7 +8396,7 @@ __metadata: history: ~5.3.0 html-webpack-plugin: ^4.4.1 husky: ^4.3.8 - i18next: ^21.8.10 + i18next: ~23.4.5 if-env: ^1.0.4 image-webpack-loader: ~8.1.0 lorem-ipsum: ^2.0.8 @@ -7863,8 +8417,8 @@ __metadata: preact-router: ^3.2.1 query-string: ^7.1.3 react-dom: ~17.0.2 - react-hook-form: ^7.45.0 - react-i18next: ^11.16.9 + react-hook-form: ~7.45.4 + react-i18next: ~13.2.1 rimraf: ^3.0.2 sass: ~1.62.1 sass-loader: ~10.4.1 @@ -7918,45 +8472,38 @@ __metadata: linkType: soft "@rocket.chat/logo@npm:next": - version: 0.32.0-dev.356 - resolution: "@rocket.chat/logo@npm:0.32.0-dev.356" + version: 0.32.0-dev.362 + resolution: "@rocket.chat/logo@npm:0.32.0-dev.362" dependencies: - "@rocket.chat/fuselage-hooks": ~0.32.0-dev.319 - "@rocket.chat/styled": ~0.31.23-dev.180 + "@rocket.chat/fuselage-hooks": ~0.32.0-dev.325 + "@rocket.chat/styled": ~0.31.26-dev.2 peerDependencies: react: 17.0.2 react-dom: 17.0.2 - checksum: 5d40f3e346e51dcfad348add801b03d64fd3dccad7bbf7ea07995f8b366a09d825e40e902c9525d845fb3604937507f00974ef0c3742a56faaf8f5a7aac1f684 - languageName: node - linkType: hard - -"@rocket.chat/memo@npm:^0.31.24, @rocket.chat/memo@npm:~0.31.23-dev.180": - version: 0.31.24 - resolution: "@rocket.chat/memo@npm:0.31.24" - checksum: f63baeac39f50f67ced26c0770334b7e6fa35c81e227b813b7e49015bcd7f102aafff3b6a1fef3e2720ee483e729882dd5734ea339dcfdc30e6f193681a02487 + checksum: baa199af19493bc13e3e547702ec411f29db23a631ed409319266231b27a76ef81f0b57d89c4a8dcbb2ccd51a40e906c41a06640bf6ebbbe3a7292fb16eb7049 languageName: node linkType: hard "@rocket.chat/memo@npm:next": - version: 0.31.23-dev.180 - resolution: "@rocket.chat/memo@npm:0.31.23-dev.180" - checksum: 5a96849f893833081b3ce4c1c5035b8a9717dc219eb1da072014cb82778654a6eaa0a595f627fdf16882adf0caaab77e881b04329369ca9e7c59970d5e572ec5 + version: 0.31.26-dev.2 + resolution: "@rocket.chat/memo@npm:0.31.26-dev.2" + checksum: 3a8cc7414bb893d225a72968dc4717eec4cf81d8911c00717884ceef8d541146a19ffedb6cf38e9481ab3956c8e6cf8d20820e7bbcc96ad0c7bbcbaf779fc2d9 languageName: node linkType: hard -"@rocket.chat/memo@npm:~0.31.26-dev.16": - version: 0.31.26-dev.16 - resolution: "@rocket.chat/memo@npm:0.31.26-dev.16" - checksum: e50a53c5574e5f133ced89b8d7d85e839c565e6e2ee1e0e4ee6d07d1af51de67f5e02fe10cf8e652a91f10b0e4e06705dd5734aebfde10b7986bcde618779ea5 +"@rocket.chat/memo@npm:~0.31.26-dev.7": + version: 0.31.26-dev.7 + resolution: "@rocket.chat/memo@npm:0.31.26-dev.7" + checksum: 7a73682525be39b058d643b8435b4259d6f1e409df8425bda0830dc0ff7d3e02593d3d80a0fdacbb20d9ce74ab9cd5c442f531bc9694d31aca9b3d0a113a39c5 languageName: node linkType: hard "@rocket.chat/message-parser@npm:next": - version: 0.32.0-dev.354 - resolution: "@rocket.chat/message-parser@npm:0.32.0-dev.354" + version: 0.32.0-dev.360 + resolution: "@rocket.chat/message-parser@npm:0.32.0-dev.360" dependencies: tldts: ~5.7.112 - checksum: 90b19e3d475b2b93d7edb9568fce4662373d15c6b4741a863a8aab901602a42eaa5533e0a1bb2da6880bde0c5853813837a9134c25bf3c2ba278582fea52cdc2 + checksum: 96255da8711890b393ac58520400394a18c48de5760a6b9fb782c17ce7560bd2aa3eaf101077aa5b66052da8134130e08d4a03268ecb499b9cbbece60691e69d languageName: node linkType: hard @@ -8211,7 +8758,7 @@ __metadata: hljs9: "npm:highlight.js@^9.18.5" http-proxy-agent: ^5.0.0 human-interval: ^2.0.1 - i18next: ^20.6.1 + i18next: ~23.4.5 i18next-http-backend: ^1.4.5 i18next-sprintf-postprocessor: ^0.2.2 iconv-lite: ^0.6.3 @@ -8289,8 +8836,8 @@ __metadata: react-docgen-typescript-plugin: ^1.0.5 react-dom: ~17.0.2 react-error-boundary: ^3.1.4 - react-hook-form: ^7.30.0 - react-i18next: ^11.16.7 + react-hook-form: ~7.45.4 + react-i18next: ~13.2.1 react-keyed-flatten-children: ^1.3.0 react-virtuoso: ^1.11.1 redis: ^4.0.6 @@ -8335,16 +8882,20 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/mock-providers@workspace:^, @rocket.chat/mock-providers@workspace:packages/mock-providers": +"@rocket.chat/mock-providers@workspace:^, @rocket.chat/mock-providers@workspace:packages/mock-providers, @rocket.chat/mock-providers@workspace:~": version: 0.0.0-use.local resolution: "@rocket.chat/mock-providers@workspace:packages/mock-providers" dependencies: + "@rocket.chat/i18n": "workspace:~" "@rocket.chat/ui-contexts": "workspace:*" + "@storybook/react": ~6.5.16 "@tanstack/react-query": ^4.16.1 "@types/jest": ~29.5.3 eslint: ~8.45.0 + i18next: ~23.4.5 jest: ~29.6.1 react: ~17.0.2 + react-i18next: ~13.2.1 ts-jest: ~29.0.5 typescript: ~5.2.2 peerDependencies: @@ -8463,8 +9014,8 @@ __metadata: linkType: soft "@rocket.chat/onboarding-ui@npm:next": - version: 0.32.0-dev.406 - resolution: "@rocket.chat/onboarding-ui@npm:0.32.0-dev.406" + version: 0.32.0-dev.412 + resolution: "@rocket.chat/onboarding-ui@npm:0.32.0-dev.412" dependencies: i18next: ~21.6.16 react-hook-form: ~7.27.1 @@ -8479,7 +9030,7 @@ __metadata: react: 17.0.2 react-dom: 17.0.2 react-i18next: ~11.15.4 - checksum: aa573204f13bf501edb9ddbad074837191d8319bb0f916cedcae438098a48605aaa65171e61c27d60e1a9cfad2a452ccb8b0583ca1a33790a65f9d0aa129a66e + checksum: c6e234d7b395c51b9d5efea5aca2a8921004af3a74a863140e414aa0862472559e02fcaab34fae2a463bbd311cf8c4da894c4103e42b009e2a94717ca366b558 languageName: node linkType: hard @@ -8763,58 +9314,38 @@ __metadata: linkType: soft "@rocket.chat/string-helpers@npm:next": - version: 0.31.23-dev.180 - resolution: "@rocket.chat/string-helpers@npm:0.31.23-dev.180" - checksum: 2cd9958e35628e483a76abe3db0e4b490b1cacc0c3d21d1440fa61cf6a1fe76befca493e962a4009988f06faf5131240a322de00b30ec0ccb8ca7efc23223407 + version: 0.31.26-dev.2 + resolution: "@rocket.chat/string-helpers@npm:0.31.26-dev.2" + checksum: a4affc666d14dcb559ba5efee96837a9061e8d935e383f0f97645850765c28f78795a02498ae4d4e76fb26726d051e3058d0a83c320103b9378c39361fd718be languageName: node linkType: hard "@rocket.chat/styled@npm:next": - version: 0.31.23-dev.180 - resolution: "@rocket.chat/styled@npm:0.31.23-dev.180" - dependencies: - "@rocket.chat/css-in-js": ~0.31.23-dev.180 - checksum: 6cc47d1ca1c5dfa5dc9d1a9fba1d04ceb7eb80f78b97f2f35929955e1e4de243ee1cb9d81538e6e58efdc599781c6e95ee492f8dc2b24a59cf084a22f76254eb - languageName: node - linkType: hard - -"@rocket.chat/styled@npm:~0.31.23-dev.180": - version: 0.31.24 - resolution: "@rocket.chat/styled@npm:0.31.24" - dependencies: - "@rocket.chat/css-in-js": ^0.31.24 - checksum: 357f05974d1e33adc9a085ecb16aeba2eeb2d68328cb8e3606e5570fb6979092648164ec3d8dce2d6a34a672afd7163963e5ee155225c7ed9b7872f100232c27 - languageName: node - linkType: hard - -"@rocket.chat/styled@npm:~0.31.26-dev.16": - version: 0.31.26-dev.16 - resolution: "@rocket.chat/styled@npm:0.31.26-dev.16" + version: 0.31.26-dev.2 + resolution: "@rocket.chat/styled@npm:0.31.26-dev.2" dependencies: - "@rocket.chat/css-in-js": ~0.31.26-dev.16 - checksum: 337de6bfc6b1dde0d42e2aa1d9bb089ceaba53119371bc6c5008e8e74a3a84fad2f90d00bdfdcb76360e6530ede75ef2bf1889ee0a9f2eacf1f1b02c337206b1 + "@rocket.chat/css-in-js": ~0.31.26-dev.7 + checksum: 065b92e40b519cafe0f731fd397e6202ad409a9d3947212dc31e8468babf4df59d105d09e867617d51e1914470fd6a4e321c7e00e244d7200497998f200d3cfe languageName: node linkType: hard -"@rocket.chat/stylis-logical-props-middleware@npm:^0.31.24, @rocket.chat/stylis-logical-props-middleware@npm:~0.31.23-dev.180": - version: 0.31.24 - resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.24" +"@rocket.chat/styled@npm:~0.31.26-dev.2, @rocket.chat/styled@npm:~0.31.26-dev.7": + version: 0.31.26-dev.7 + resolution: "@rocket.chat/styled@npm:0.31.26-dev.7" dependencies: - "@rocket.chat/css-supports": ^0.31.24 - peerDependencies: - stylis: 4.0.10 - checksum: 11a6e1395976005e3156b9838ab1ef0d1e8d827bca8804a9befd54c32eccf62415b8940ca99999588f6001c291f560d92e134a0d4e4078fe477389b0f99bb7ff + "@rocket.chat/css-in-js": ~0.31.26-dev.7 + checksum: 750ff71076cc8beb8c8280790303e167dd5d84db79aa6ce1d6a4912891474388d6c88cf35bde4103ec9cd91baa8323c3bd65065b3c800a8f6e29c4c3a18d39ad languageName: node linkType: hard -"@rocket.chat/stylis-logical-props-middleware@npm:~0.31.26-dev.16": - version: 0.31.26-dev.16 - resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.26-dev.16" +"@rocket.chat/stylis-logical-props-middleware@npm:~0.31.26-dev.7": + version: 0.31.26-dev.7 + resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.26-dev.7" dependencies: - "@rocket.chat/css-supports": ~0.31.26-dev.16 + "@rocket.chat/css-supports": ~0.31.26-dev.7 peerDependencies: stylis: 4.0.10 - checksum: 37e47fb2912349edeb8fba9c08614394ce88b9438fff61647f55dbc3d78c8ad88516b49e03e969a096089db0372c23b9c45994d43db7fb76d20bcfbebb73b4b1 + checksum: a60bdeb134db3666887fa858475a07cb6506a4c616e5b30e32e02a5693554e688db4b062b7a8f2fe18eb401fb9047442fce6c35c790f375a0fc73b6fd15b7272 languageName: node linkType: hard @@ -8869,7 +9400,7 @@ __metadata: jest: ~29.6.1 react: ^17.0.2 react-dom: ^17.0.2 - react-hook-form: ^7.30.0 + react-hook-form: ~7.45.4 ts-jest: ~29.0.5 typescript: ~5.2.2 peerDependencies: @@ -8947,11 +9478,11 @@ __metadata: linkType: soft "@rocket.chat/ui-kit@npm:next": - version: 0.32.0-dev.341 - resolution: "@rocket.chat/ui-kit@npm:0.32.0-dev.341" + version: 0.32.0-dev.347 + resolution: "@rocket.chat/ui-kit@npm:0.32.0-dev.347" peerDependencies: "@rocket.chat/icons": "*" - checksum: cdfe3f464472266194aeda6e4f7cf61239ebc46531c00ebcb6b1d9c05ce7ea0206c79d257922b6d8c83a3212457d855fde1f416844c15eb39bebbba814135608 + checksum: 602a4c25b7db388f54ade335f1390c791204bce3837735504816cba0853eb7df48790f8f9c297bb11c600e3e772601ce437d1897425ef03a237112b8f27af9fc languageName: node linkType: hard @@ -9084,15 +9615,33 @@ __metadata: version: 0.0.0-use.local resolution: "@rocket.chat/web-ui-registration@workspace:packages/web-ui-registration" dependencies: + "@babel/core": ~7.22.10 + "@babel/preset-env": ~7.22.10 + "@babel/preset-react": ~7.22.5 + "@babel/preset-typescript": ~7.22.5 + "@rocket.chat/i18n": "workspace:~" "@rocket.chat/layout": next + "@rocket.chat/mock-providers": "workspace:~" "@rocket.chat/ui-client": "workspace:^" "@rocket.chat/ui-contexts": "workspace:^" + "@storybook/addon-actions": ~6.5.16 + "@storybook/addon-docs": ~6.5.16 + "@storybook/addon-essentials": ~6.5.16 + "@storybook/builder-webpack4": ~6.5.16 + "@storybook/manager-webpack4": ~6.5.16 + "@storybook/react": ~6.5.16 + "@storybook/testing-library": ^0.2.0 "@tanstack/react-query": ^4.16.1 "@testing-library/react": ^13.3.0 "@types/jest": ~29.5.3 + "@types/react": ~17.0.62 + babel-loader: ~8.3.0 eslint: ~8.45.0 jest: ~29.6.1 - react-hook-form: ^7.34.2 + react: ~17.0.2 + react-hook-form: ~7.45.4 + react-i18next: ~13.2.1 + storybook-dark-mode: ~3.0.1 ts-jest: ~29.0.5 typescript: ~5.2.2 peerDependencies: @@ -9682,6 +10231,20 @@ __metadata: languageName: node linkType: hard +"@storybook/addons@npm:^7.0.0": + version: 7.3.2 + resolution: "@storybook/addons@npm:7.3.2" + dependencies: + "@storybook/manager-api": 7.3.2 + "@storybook/preview-api": 7.3.2 + "@storybook/types": 7.3.2 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: acde96c9480a25299067229666da596174e4e07827a8ac4aa687b253fc09471eb7123a28cd8e2f3fdb9567596d7ab49482df7ddf5479f435f71b46f1c7a41771 + languageName: node + linkType: hard + "@storybook/api@npm:6.5.16": version: 6.5.16 resolution: "@storybook/api@npm:6.5.16" @@ -9710,6 +10273,24 @@ __metadata: languageName: node linkType: hard +"@storybook/api@npm:^7.0.0": + version: 7.3.2 + resolution: "@storybook/api@npm:7.3.2" + dependencies: + "@storybook/client-logger": 7.3.2 + "@storybook/manager-api": 7.3.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: dfe5f976256fc74c82548ca35f7052b82ca87a21d44e8554c0913ecc8f5d0e0d317a57b0308057473c3b8efa95428590d4350c9c4d1ef7f7c02ee8c7c2d2e8ee + languageName: node + linkType: hard + "@storybook/builder-webpack4@npm:6.5.16, @storybook/builder-webpack4@npm:~6.5.16": version: 6.5.16 resolution: "@storybook/builder-webpack4@npm:6.5.16" @@ -9862,6 +10443,20 @@ __metadata: languageName: node linkType: hard +"@storybook/channels@npm:7.3.2": + version: 7.3.2 + resolution: "@storybook/channels@npm:7.3.2" + dependencies: + "@storybook/client-logger": 7.3.2 + "@storybook/core-events": 7.3.2 + "@storybook/global": ^5.0.0 + qs: ^6.10.0 + telejson: ^7.0.3 + tiny-invariant: ^1.3.1 + checksum: a32a204d36f1b778f9d23329846c48f3f8a77db4afa40cf6829185a2e21a7bf65150c7fe33309febda4f5fbc78f5ed36f751519ccdcd9f0f92a32fdbba03390e + languageName: node + linkType: hard + "@storybook/client-api@npm:6.5.16": version: 6.5.16 resolution: "@storybook/client-api@npm:6.5.16" @@ -9903,6 +10498,15 @@ __metadata: languageName: node linkType: hard +"@storybook/client-logger@npm:7.3.2": + version: 7.3.2 + resolution: "@storybook/client-logger@npm:7.3.2" + dependencies: + "@storybook/global": ^5.0.0 + checksum: bf52aa9567d3b849976553bafc70da9d55fb2abdbea2e51487e8c8d597d12ba84c0fa952b9225d5c9be489b6bed99eb9250d93682fc66547acf2ff28df17b2e7 + languageName: node + linkType: hard + "@storybook/components@npm:6.5.16": version: 6.5.16 resolution: "@storybook/components@npm:6.5.16" @@ -9922,6 +10526,28 @@ __metadata: languageName: node linkType: hard +"@storybook/components@npm:^7.0.0": + version: 7.3.2 + resolution: "@storybook/components@npm:7.3.2" + dependencies: + "@radix-ui/react-select": ^1.2.2 + "@radix-ui/react-toolbar": ^1.0.4 + "@storybook/client-logger": 7.3.2 + "@storybook/csf": ^0.1.0 + "@storybook/global": ^5.0.0 + "@storybook/icons": ^1.1.6 + "@storybook/theming": 7.3.2 + "@storybook/types": 7.3.2 + memoizerific: ^1.11.3 + use-resize-observer: ^9.1.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: cbb501ee896a7bde88e8136589bc38ab2af534a4325ac64db64c5424cc2efc32cfc5e9f5756c17c2ee3a10d49f1b5268dbdca179e503f18d9021f4700e8dcb35 + languageName: node + linkType: hard + "@storybook/core-client@npm:6.5.16": version: 6.5.16 resolution: "@storybook/core-client@npm:6.5.16" @@ -10030,6 +10656,13 @@ __metadata: languageName: node linkType: hard +"@storybook/core-events@npm:7.3.2, @storybook/core-events@npm:^7.0.0": + version: 7.3.2 + resolution: "@storybook/core-events@npm:7.3.2" + checksum: 86c809250fc3ad05e3254fc86d163339108569749ffee47496a2717bf1a9052304975007e8c05075415361cda0e0c530cc1f2ae6d4fa682d9573240ebfd1d170 + languageName: node + linkType: hard + "@storybook/core-server@npm:6.5.16": version: 6.5.16 resolution: "@storybook/core-server@npm:6.5.16" @@ -10159,6 +10792,15 @@ __metadata: languageName: node linkType: hard +"@storybook/csf@npm:^0.1.0": + version: 0.1.1 + resolution: "@storybook/csf@npm:0.1.1" + dependencies: + type-fest: ^2.19.0 + checksum: 1fbb827b50f0c15f21026a95d02cc096be4f9f2705ad8fd29f0a99330233606e69f6af7551d844ace2a4b8f08fcc9f81496d4d69160ba8c458698291efb60954 + languageName: node + linkType: hard + "@storybook/docs-tools@npm:6.5.16": version: 6.5.16 resolution: "@storybook/docs-tools@npm:6.5.16" @@ -10174,6 +10816,23 @@ __metadata: languageName: node linkType: hard +"@storybook/global@npm:^5.0.0": + version: 5.0.0 + resolution: "@storybook/global@npm:5.0.0" + checksum: ede0ad35ec411fe31c61150dbd118fef344d1d0e72bf5d3502368e35cf68126f6b7ae4a0ab5e2ffe2f0baa3b4286f03ad069ba3e098e1725449ef08b7e154ba8 + languageName: node + linkType: hard + +"@storybook/icons@npm:^1.1.6": + version: 1.1.6 + resolution: "@storybook/icons@npm:1.1.6" + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: b5774c9e61622886e006d1a87252352246af5236668d9fb2fad00c56c0bb2e1ddbdbab3535b4c806672e62d4e280d7be438596bc3888f74349490e138d9f3acf + languageName: node + linkType: hard + "@storybook/instrumenter@npm:6.5.16, @storybook/instrumenter@npm:^6.4.0": version: 6.5.16 resolution: "@storybook/instrumenter@npm:6.5.16" @@ -10187,6 +10846,32 @@ __metadata: languageName: node linkType: hard +"@storybook/manager-api@npm:7.3.2": + version: 7.3.2 + resolution: "@storybook/manager-api@npm:7.3.2" + dependencies: + "@storybook/channels": 7.3.2 + "@storybook/client-logger": 7.3.2 + "@storybook/core-events": 7.3.2 + "@storybook/csf": ^0.1.0 + "@storybook/global": ^5.0.0 + "@storybook/router": 7.3.2 + "@storybook/theming": 7.3.2 + "@storybook/types": 7.3.2 + dequal: ^2.0.2 + lodash: ^4.17.21 + memoizerific: ^1.11.3 + semver: ^7.3.7 + store2: ^2.14.2 + telejson: ^7.0.3 + 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 + checksum: 6b733fe83739288ac74d600d45f5e10f36a359f98b9f0a3574753173e1824f7f7e45407e7e73d476bbf66e40a8246e74bb7cf64eb332a85f8b49f2c9b59d8459 + languageName: node + linkType: hard + "@storybook/manager-webpack4@npm:6.5.16, @storybook/manager-webpack4@npm:~6.5.16": version: 6.5.16 resolution: "@storybook/manager-webpack4@npm:6.5.16" @@ -10354,6 +11039,28 @@ __metadata: languageName: node linkType: hard +"@storybook/preview-api@npm:7.3.2": + version: 7.3.2 + resolution: "@storybook/preview-api@npm:7.3.2" + dependencies: + "@storybook/channels": 7.3.2 + "@storybook/client-logger": 7.3.2 + "@storybook/core-events": 7.3.2 + "@storybook/csf": ^0.1.0 + "@storybook/global": ^5.0.0 + "@storybook/types": 7.3.2 + "@types/qs": ^6.9.5 + dequal: ^2.0.2 + lodash: ^4.17.21 + memoizerific: ^1.11.3 + qs: ^6.10.0 + synchronous-promise: ^2.0.15 + ts-dedent: ^2.0.0 + util-deprecate: ^1.0.2 + checksum: 3fbf417685a2eb8e952d24361997c32530a161225f1f7b131c726b7517bd3e57fdfbc117e0b62591674465bb82a66086b0cee0d3acda66f4d2b431f4a4846931 + languageName: node + linkType: hard + "@storybook/preview-web@npm:6.5.16": version: 6.5.16 resolution: "@storybook/preview-web@npm:6.5.16" @@ -10399,6 +11106,24 @@ __metadata: languageName: node linkType: hard +"@storybook/react-docgen-typescript-plugin@patch:@storybook/react-docgen-typescript-plugin@npm%3A1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0#./.yarn/patches/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40.patch::locator=rocket.chat%40workspace%3A.": + version: 1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0 + resolution: "@storybook/react-docgen-typescript-plugin@patch:@storybook/react-docgen-typescript-plugin@npm%3A1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0#./.yarn/patches/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40.patch::version=1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0&hash=c5d5d9&locator=rocket.chat%40workspace%3A." + dependencies: + debug: ^4.1.1 + endent: ^2.0.1 + find-cache-dir: ^3.3.1 + flat-cache: ^3.0.4 + micromatch: ^4.0.2 + react-docgen-typescript: ^2.1.1 + tslib: ^2.0.0 + peerDependencies: + typescript: ">= 3.x" + webpack: ">= 4" + checksum: 1734e438561dd47b44364815e2bf0da07a5ea57505d748f696892582cde5d4d6f31bb4ae6263ee236b4cb081ba2571d575b11aa5dd9ce13f48021cfc63ce52c1 + languageName: node + linkType: hard + "@storybook/react@npm:~6.5.16": version: 6.5.16 resolution: "@storybook/react@npm:6.5.16" @@ -10480,6 +11205,20 @@ __metadata: languageName: node linkType: hard +"@storybook/router@npm:7.3.2": + version: 7.3.2 + resolution: "@storybook/router@npm:7.3.2" + dependencies: + "@storybook/client-logger": 7.3.2 + memoizerific: ^1.11.3 + qs: ^6.10.0 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: 9a67a2f30f47deec1ff4588ce9d3c16cdab4084bdc6523edc54700c89a44023e0c6e17da5e0524f73109f8697cc5e728400b086342c58f14df8e01dfad58f1a2 + languageName: node + linkType: hard + "@storybook/semver@npm:^7.3.2": version: 7.3.2 resolution: "@storybook/semver@npm:7.3.2" @@ -10572,6 +11311,17 @@ __metadata: languageName: node linkType: hard +"@storybook/testing-library@npm:^0.2.0": + version: 0.2.0 + resolution: "@storybook/testing-library@npm:0.2.0" + dependencies: + "@testing-library/dom": ^9.0.0 + "@testing-library/user-event": ^14.0.0 + ts-dedent: ^2.2.0 + checksum: 1c1c16aea6f961de344f5d43bdfd2847bc5f44df1037c2e1383312bb6b842e2c17a805670fc9cfe1a8425f9e48e240fe5d025ab3d4802a198cfe9eb6ed8e7636 + languageName: node + linkType: hard + "@storybook/theming@npm:6.5.16, @storybook/theming@npm:~6.5.16": version: 6.5.16 resolution: "@storybook/theming@npm:6.5.16" @@ -10587,6 +11337,33 @@ __metadata: languageName: node linkType: hard +"@storybook/theming@npm:7.3.2, @storybook/theming@npm:^7.0.0": + version: 7.3.2 + resolution: "@storybook/theming@npm:7.3.2" + dependencies: + "@emotion/use-insertion-effect-with-fallbacks": ^1.0.0 + "@storybook/client-logger": 7.3.2 + "@storybook/global": ^5.0.0 + memoizerific: ^1.11.3 + peerDependencies: + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + react-dom: ^16.8.0 || ^17.0.0 || ^18.0.0 + checksum: aab7d83213ac3df7062fd39e33587311c972bfa3879a32dbc2f4dfa899c7b716ffa6c81496c18032bc8b4f0961cc50de0b0486aacf0e512aaec295cb635d8d4d + languageName: node + linkType: hard + +"@storybook/types@npm:7.3.2": + version: 7.3.2 + resolution: "@storybook/types@npm:7.3.2" + dependencies: + "@storybook/channels": 7.3.2 + "@types/babel__core": ^7.0.0 + "@types/express": ^4.7.0 + file-system-cache: 2.3.0 + checksum: 5986ca2780c6049c08f65cda0dc2b1f063476d0a5ad337a96d641bb91131e7d4a600dcf87b25aedba747f8beb66ac0805562c46e73dc0d20222be4fc4b02309c + languageName: node + linkType: hard + "@storybook/ui@npm:6.5.16": version: 6.5.16 resolution: "@storybook/ui@npm:6.5.16" @@ -10813,6 +11590,22 @@ __metadata: languageName: node linkType: hard +"@testing-library/dom@npm:^9.0.0": + version: 9.3.1 + resolution: "@testing-library/dom@npm:9.3.1" + dependencies: + "@babel/code-frame": ^7.10.4 + "@babel/runtime": ^7.12.5 + "@types/aria-query": ^5.0.1 + aria-query: 5.1.3 + chalk: ^4.1.0 + dom-accessibility-api: ^0.5.9 + lz-string: ^1.5.0 + pretty-format: ^27.0.2 + checksum: 8ee3136451644e39990edea93709c38cf1e8ce5306f3c66273ca00935963faa51ca74e8d92b02eb442ccb842cfa28ca62833e393e075eb269cf9bef6f5600663 + languageName: node + linkType: hard + "@testing-library/jest-dom@npm:^5.16.5, @testing-library/jest-dom@npm:~5.16.5": version: 5.16.5 resolution: "@testing-library/jest-dom@npm:5.16.5" @@ -10891,6 +11684,15 @@ __metadata: languageName: node linkType: hard +"@testing-library/user-event@npm:^14.0.0": + version: 14.4.3 + resolution: "@testing-library/user-event@npm:14.4.3" + peerDependencies: + "@testing-library/dom": ">=7.21.4" + checksum: 852c48ea6db1c9471b18276617c84fec4320771e466cd58339a732ca3fd73ad35e5a43ae14f51af51a8d0a150dcf60fcaab049ef367871207bea8f92c4b8195e + languageName: node + linkType: hard + "@tokenizer/token@npm:^0.3.0": version: 0.3.0 resolution: "@tokenizer/token@npm:0.3.0" @@ -10972,7 +11774,14 @@ __metadata: languageName: node linkType: hard -"@types/babel__core@npm:^7, @types/babel__core@npm:^7.1.14, @types/babel__core@npm:~7.20.1": +"@types/aria-query@npm:^5.0.1": + version: 5.0.1 + resolution: "@types/aria-query@npm:5.0.1" + checksum: 69fd7cceb6113ed370591aef04b3fd0742e9a1b06dd045c43531448847b85de181495e4566f98e776b37c422a12fd71866e0a1dfd904c5ec3f84d271682901de + languageName: node + linkType: hard + +"@types/babel__core@npm:^7, @types/babel__core@npm:^7.0.0, @types/babel__core@npm:^7.1.14, @types/babel__core@npm:~7.20.1": version: 7.20.1 resolution: "@types/babel__core@npm:7.20.1" dependencies: @@ -10994,7 +11803,7 @@ __metadata: languageName: node linkType: hard -"@types/babel__preset-env@npm:^7, @types/babel__preset-env@npm:~7.9.2": +"@types/babel__preset-env@npm:^7": version: 7.9.2 resolution: "@types/babel__preset-env@npm:7.9.2" checksum: a905ed92a3f602384966153e74a94790425e98af54e392a7fcfb5c5ded2f2a58c49a9fa64a0cb506fbffb8169ad25b56ea87983c812a4fb880f0716668c8c085 @@ -11304,7 +12113,7 @@ __metadata: languageName: node linkType: hard -"@types/express@npm:*, @types/express@npm:^4.17.13, @types/express@npm:^4.17.17, @types/express@npm:^4.17.8": +"@types/express@npm:*, @types/express@npm:^4.17.13, @types/express@npm:^4.17.17, @types/express@npm:^4.17.8, @types/express@npm:^4.7.0": version: 4.17.17 resolution: "@types/express@npm:4.17.17" dependencies: @@ -13756,10 +14565,21 @@ __metadata: languageName: node linkType: hard -"aria-query@npm:^5.0.0": - version: 5.0.0 - resolution: "aria-query@npm:5.0.0" - checksum: c41f98866c5a304561ee8cae55856711cddad6f3f85d8cb43cc5f79667078d9b8979ce32d244c1ff364e6463a4d0b6865804a33ccc717fed701b281cf7dc6296 +"aria-hidden@npm:^1.1.1": + version: 1.2.3 + resolution: "aria-hidden@npm:1.2.3" + dependencies: + tslib: ^2.0.0 + checksum: 7d7d211629eef315e94ed3b064c6823d13617e609d3f9afab1c2ed86399bb8e90405f9bdd358a85506802766f3ecb468af985c67c846045a34b973bcc0289db9 + languageName: node + linkType: hard + +"aria-query@npm:5.1.3, aria-query@npm:^5.0.0": + version: 5.1.3 + resolution: "aria-query@npm:5.1.3" + dependencies: + deep-equal: ^2.0.5 + checksum: 929ff95f02857b650fb4cbcd2f41072eee2f46159a6605ea03bf63aa572e35ffdff43d69e815ddc462e16e07de8faba3978afc2813650b4448ee18c9895d982b languageName: node linkType: hard @@ -13784,6 +14604,16 @@ __metadata: languageName: node linkType: hard +"array-buffer-byte-length@npm:^1.0.0": + version: 1.0.0 + resolution: "array-buffer-byte-length@npm:1.0.0" + dependencies: + call-bind: ^1.0.2 + is-array-buffer: ^3.0.1 + checksum: 044e101ce150f4804ad19c51d6c4d4cfa505c5b2577bd179256e4aa3f3f6a0a5e9874c78cd428ee566ac574c8a04d7ce21af9fe52e844abfdccb82b33035a7c3 + languageName: node + linkType: hard + "array-find-index@npm:^1.0.1": version: 1.0.2 resolution: "array-find-index@npm:1.0.2" @@ -14273,7 +15103,7 @@ __metadata: languageName: node linkType: hard -"babel-loader@npm:^8.0.0, babel-loader@npm:^8.3.0": +"babel-loader@npm:^8.0.0, babel-loader@npm:^8.3.0, babel-loader@npm:~8.3.0": version: 8.3.0 resolution: "babel-loader@npm:8.3.0" dependencies: @@ -14381,7 +15211,7 @@ __metadata: languageName: node linkType: hard -"babel-plugin-polyfill-corejs2@npm:^0.4.4": +"babel-plugin-polyfill-corejs2@npm:^0.4.5": version: 0.4.5 resolution: "babel-plugin-polyfill-corejs2@npm:0.4.5" dependencies: @@ -14406,7 +15236,7 @@ __metadata: languageName: node linkType: hard -"babel-plugin-polyfill-corejs3@npm:^0.8.2": +"babel-plugin-polyfill-corejs3@npm:^0.8.3": version: 0.8.3 resolution: "babel-plugin-polyfill-corejs3@npm:0.8.3" dependencies: @@ -14418,7 +15248,7 @@ __metadata: languageName: node linkType: hard -"babel-plugin-polyfill-regenerator@npm:^0.5.1": +"babel-plugin-polyfill-regenerator@npm:^0.5.2": version: 0.5.2 resolution: "babel-plugin-polyfill-regenerator@npm:0.5.2" dependencies: @@ -15807,7 +16637,7 @@ __metadata: languageName: node linkType: hard -"chalk@npm:2.4.2, chalk@npm:^2.0.0, chalk@npm:^2.0.1, chalk@npm:^2.1.0, chalk@npm:^2.4.1, chalk@npm:^2.4.2": +"chalk@npm:2.4.2, chalk@npm:^2.0.1, chalk@npm:^2.1.0, chalk@npm:^2.4.1, chalk@npm:^2.4.2": version: 2.4.2 resolution: "chalk@npm:2.4.2" dependencies: @@ -17990,6 +18820,32 @@ __metadata: languageName: node linkType: hard +"deep-equal@npm:^2.0.5": + version: 2.2.2 + resolution: "deep-equal@npm:2.2.2" + dependencies: + array-buffer-byte-length: ^1.0.0 + call-bind: ^1.0.2 + es-get-iterator: ^1.1.3 + get-intrinsic: ^1.2.1 + is-arguments: ^1.1.1 + is-array-buffer: ^3.0.2 + is-date-object: ^1.0.5 + is-regex: ^1.1.4 + is-shared-array-buffer: ^1.0.2 + isarray: ^2.0.5 + object-is: ^1.1.5 + object-keys: ^1.1.1 + object.assign: ^4.1.4 + regexp.prototype.flags: ^1.5.0 + side-channel: ^1.0.4 + which-boxed-primitive: ^1.0.2 + which-collection: ^1.0.1 + which-typed-array: ^1.1.9 + checksum: eb61c35157b6ecb96a5359b507b083fbff8ddb4c86a78a781ee38485f77a667465e45d63ee2ebd8a00e86d94c80e499906900cd82c2debb400237e1662cd5397 + languageName: node + linkType: hard + "deep-extend@npm:^0.6.0": version: 0.6.0 resolution: "deep-extend@npm:0.6.0" @@ -18058,13 +18914,13 @@ __metadata: languageName: node linkType: hard -"define-properties@npm:^1.1.2, define-properties@npm:^1.1.3, define-properties@npm:^1.1.4": - version: 1.1.4 - resolution: "define-properties@npm:1.1.4" +"define-properties@npm:^1.1.2, define-properties@npm:^1.1.3, define-properties@npm:^1.1.4, define-properties@npm:^1.2.0": + version: 1.2.0 + resolution: "define-properties@npm:1.2.0" dependencies: has-property-descriptors: ^1.0.0 object-keys: ^1.1.1 - checksum: ce0aef3f9eb193562b5cfb79b2d2c86b6a109dfc9fdcb5f45d680631a1a908c06824ddcdb72b7573b54e26ace07f0a23420aaba0d5c627b34d2c1de8ef527e2b + checksum: e60aee6a19b102df4e2b1f301816804e81ab48bb91f00d0d935f269bf4b3f79c88b39e4f89eaa132890d23267335fd1140dfcd8d5ccd61031a0a2c41a54e33a6 languageName: node linkType: hard @@ -18164,6 +19020,13 @@ __metadata: languageName: node linkType: hard +"dequal@npm:^2.0.2": + version: 2.0.3 + resolution: "dequal@npm:2.0.3" + checksum: 8679b850e1a3d0ebbc46ee780d5df7b478c23f335887464023a631d1b9af051ad4a6595a44220f9ff8ff95a8ddccf019b5ad778a976fd7bbf77383d36f412f90 + languageName: node + linkType: hard + "des.js@npm:^1.0.0": version: 1.0.1 resolution: "des.js@npm:1.0.1" @@ -18236,6 +19099,13 @@ __metadata: languageName: node linkType: hard +"detect-node-es@npm:^1.1.0": + version: 1.1.0 + resolution: "detect-node-es@npm:1.1.0" + checksum: e46307d7264644975b71c104b9f028ed1d3d34b83a15b8a22373640ce5ea630e5640b1078b8ea15f202b54641da71e4aa7597093bd4b91f113db520a26a37449 + languageName: node + linkType: hard + "detect-node@npm:^2.0.4": version: 2.1.0 resolution: "detect-node@npm:2.1.0" @@ -19055,7 +19925,7 @@ __metadata: languageName: node linkType: hard -"es-abstract@npm:^1.17.2, es-abstract@npm:^1.18.5, es-abstract@npm:^1.19.0, es-abstract@npm:^1.19.1, es-abstract@npm:^1.19.5, es-abstract@npm:^1.20.4": +"es-abstract@npm:^1.17.2, es-abstract@npm:^1.19.0, es-abstract@npm:^1.19.1, es-abstract@npm:^1.19.5, es-abstract@npm:^1.20.4": version: 1.20.4 resolution: "es-abstract@npm:1.20.4" dependencies: @@ -19094,19 +19964,20 @@ __metadata: languageName: node linkType: hard -"es-get-iterator@npm:^1.0.2": - version: 1.1.2 - resolution: "es-get-iterator@npm:1.1.2" +"es-get-iterator@npm:^1.0.2, es-get-iterator@npm:^1.1.3": + version: 1.1.3 + resolution: "es-get-iterator@npm:1.1.3" dependencies: call-bind: ^1.0.2 - get-intrinsic: ^1.1.0 - has-symbols: ^1.0.1 - is-arguments: ^1.1.0 + get-intrinsic: ^1.1.3 + has-symbols: ^1.0.3 + is-arguments: ^1.1.1 is-map: ^2.0.2 is-set: ^2.0.2 - is-string: ^1.0.5 + is-string: ^1.0.7 isarray: ^2.0.5 - checksum: f75e66acb6a45686fa08b3ade9c9421a70d36a0c43ed4363e67f4d7aab2226cb73dd977cb48abbaf75721b946d3cd810682fcf310c7ad0867802fbf929b17dcf + stop-iteration-iterator: ^1.0.0 + checksum: 8fa118da42667a01a7c7529f8a8cca514feeff243feec1ce0bb73baaa3514560bd09d2b3438873cf8a5aaec5d52da248131de153b28e2638a061b6e4df13267d languageName: node linkType: hard @@ -20444,6 +21315,16 @@ __metadata: languageName: node linkType: hard +"file-system-cache@npm:2.3.0": + version: 2.3.0 + resolution: "file-system-cache@npm:2.3.0" + dependencies: + fs-extra: 11.1.1 + ramda: 0.29.0 + checksum: 74afa2870a062500643d41e02d1fbd47a3f30100f9e153dec5233d59f05545f4c8ada6085629d624e043479ac28c0cafc31824f7b49a3f997efab8cc5d05bfee + languageName: node + linkType: hard + "file-system-cache@npm:^1.0.5": version: 1.0.5 resolution: "file-system-cache@npm:1.0.5" @@ -20814,6 +21695,15 @@ __metadata: languageName: node linkType: hard +"for-each@npm:^0.3.3": + version: 0.3.3 + resolution: "for-each@npm:0.3.3" + dependencies: + is-callable: ^1.1.3 + checksum: 6c48ff2bc63362319c65e2edca4a8e1e3483a2fabc72fbe7feaf8c73db94fc7861bd53bc02c8a66a0c1dd709da6b04eec42e0abdd6b40ce47305ae92a25e5d28 + languageName: node + linkType: hard + "for-in@npm:^1.0.2": version: 1.0.2 resolution: "for-in@npm:1.0.2" @@ -20821,13 +21711,6 @@ __metadata: languageName: node linkType: hard -"foreach@npm:^2.0.5": - version: 2.0.5 - resolution: "foreach@npm:2.0.5" - checksum: dab4fbfef0b40b69ee5eab81bcb9626b8fa8b3469c8cfa26480f3e5e1ee08c40eae07048c9a967c65aeda26e774511ccc70b3f10a604c01753c6ef24361f0fc8 - languageName: node - linkType: hard - "foreground-child@npm:^2.0.0": version: 2.0.0 resolution: "foreground-child@npm:2.0.0" @@ -21001,6 +21884,17 @@ __metadata: languageName: node linkType: hard +"fs-extra@npm:11.1.1": + version: 11.1.1 + resolution: "fs-extra@npm:11.1.1" + dependencies: + graceful-fs: ^4.2.0 + jsonfile: ^6.0.1 + universalify: ^2.0.0 + checksum: fb883c68245b2d777fbc1f2082c9efb084eaa2bbf9fddaa366130d196c03608eebef7fb490541276429ee1ca99f317e2d73e96f5ca0999eefedf5a624ae1edfd + languageName: node + linkType: hard + "fs-extra@npm:^0.30.0": version: 0.30.0 resolution: "fs-extra@npm:0.30.0" @@ -21168,10 +22062,10 @@ __metadata: languageName: node linkType: hard -"functions-have-names@npm:^1.2.2": - version: 1.2.2 - resolution: "functions-have-names@npm:1.2.2" - checksum: 25f44b6d1c41ac86ffdf41f25d1de81c0a5b4a3fcf4307a33cdfb23b9d4bd5d0d8bf312eaef5ad368c6500c8a9e19f692b8ce9f96aaab99db9dd936554165558 +"functions-have-names@npm:^1.2.2, functions-have-names@npm:^1.2.3": + version: 1.2.3 + resolution: "functions-have-names@npm:1.2.3" + checksum: c3f1f5ba20f4e962efb71344ce0a40722163e85bee2101ce25f88214e78182d2d2476aa85ef37950c579eb6cf6ee811c17b3101bb84004bb75655f3e33f3fdb5 languageName: node linkType: hard @@ -21329,14 +22223,22 @@ __metadata: languageName: node linkType: hard -"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.0, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3": - version: 1.1.3 - resolution: "get-intrinsic@npm:1.1.3" +"get-intrinsic@npm:^1.0.2, get-intrinsic@npm:^1.1.1, get-intrinsic@npm:^1.1.3, get-intrinsic@npm:^1.2.0, get-intrinsic@npm:^1.2.1": + version: 1.2.1 + resolution: "get-intrinsic@npm:1.2.1" dependencies: function-bind: ^1.1.1 has: ^1.0.3 + has-proto: ^1.0.1 has-symbols: ^1.0.3 - checksum: 152d79e87251d536cf880ba75cfc3d6c6c50e12b3a64e1ea960e73a3752b47c69f46034456eae1b0894359ce3bc64c55c186f2811f8a788b75b638b06fab228a + checksum: 5b61d88552c24b0cf6fa2d1b3bc5459d7306f699de060d76442cce49a4721f52b8c560a33ab392cf5575b7810277d54ded9d4d39a1ea61855619ebc005aa7e5f + languageName: node + linkType: hard + +"get-nonce@npm:^1.0.0": + version: 1.0.1 + resolution: "get-nonce@npm:1.0.1" + checksum: e2614e43b4694c78277bb61b0f04583d45786881289285c73770b07ded246a98be7e1f78b940c80cbe6f2b07f55f0b724e6db6fd6f1bcbd1e8bdac16521074ed languageName: node linkType: hard @@ -21851,6 +22753,15 @@ __metadata: languageName: node linkType: hard +"gopd@npm:^1.0.1": + version: 1.0.1 + resolution: "gopd@npm:1.0.1" + dependencies: + get-intrinsic: ^1.1.3 + checksum: a5ccfb8806e0917a94e0b3de2af2ea4979c1da920bc381667c260e00e7cafdbe844e2cb9c5bcfef4e5412e8bf73bab837285bc35c7ba73aaaf0134d4583393a6 + languageName: node + linkType: hard + "got@npm:^6.7.1": version: 6.7.1 resolution: "got@npm:6.7.1" @@ -22083,6 +22994,13 @@ __metadata: languageName: node linkType: hard +"has-proto@npm:^1.0.1": + version: 1.0.1 + resolution: "has-proto@npm:1.0.1" + checksum: febc5b5b531de8022806ad7407935e2135f1cc9e64636c3916c6842bd7995994ca3b29871ecd7954bd35f9e2986c17b3b227880484d22259e2f8e6ce63fd383e + languageName: node + linkType: hard + "has-symbol-support-x@npm:^1.4.1": version: 1.4.2 resolution: "has-symbol-support-x@npm:1.4.2" @@ -22904,30 +23822,12 @@ __metadata: languageName: node linkType: hard -"i18next@npm:>=17.0.11": - version: 22.4.15 - resolution: "i18next@npm:22.4.15" - dependencies: - "@babel/runtime": ^7.20.6 - checksum: fced898227983e439c59e7aa6e7b87e53ad1b8a1c85f0613a968881418266e5336e9443831125590559796075d516fe3dbf8118679c894094a0a404be78b02a2 - languageName: node - linkType: hard - -"i18next@npm:^20.6.1": - version: 20.6.1 - resolution: "i18next@npm:20.6.1" +"i18next@npm:>=17.0.11, i18next@npm:~23.4.5": + version: 23.4.5 + resolution: "i18next@npm:23.4.5" dependencies: - "@babel/runtime": ^7.12.0 - checksum: 313cd4b17f9092eaf8ca92a02bb74d099f4a8b26de6e38018f438ce6f706220e5f72d865e1f50d815e13504ec38bc77e0f6341f670ca5162689f8d11a859e564 - languageName: node - linkType: hard - -"i18next@npm:^21.8.10": - version: 21.8.11 - resolution: "i18next@npm:21.8.11" - dependencies: - "@babel/runtime": ^7.17.2 - checksum: 94b9de3811456c2720b96d54febb89fe66cef3146044cdba9cc35543f93bf04843ccffb191ff4dbed614e7d4a64f2e29391dd514e054331738f2411c1936d85f + "@babel/runtime": ^7.22.5 + checksum: b39a1edc19fc6fb34df4fd95581e2b86dd5d8c8345e3409a3366df606a72b62f25ee31a82fb9b0e22161cd856408989c91b74ee737b0cce00d547e6d371a14f5 languageName: node linkType: hard @@ -23385,14 +24285,14 @@ __metadata: languageName: node linkType: hard -"internal-slot@npm:^1.0.3": - version: 1.0.3 - resolution: "internal-slot@npm:1.0.3" +"internal-slot@npm:^1.0.3, internal-slot@npm:^1.0.4": + version: 1.0.5 + resolution: "internal-slot@npm:1.0.5" dependencies: - get-intrinsic: ^1.1.0 + get-intrinsic: ^1.2.0 has: ^1.0.3 side-channel: ^1.0.4 - checksum: 1944f92e981e47aebc98a88ff0db579fd90543d937806104d0b96557b10c1f170c51fb777b97740a8b6ddeec585fca8c39ae99fd08a8e058dfc8ab70937238bf + checksum: 97e84046bf9e7574d0956bd98d7162313ce7057883b6db6c5c7b5e5f05688864b0978ba07610c726d15d66544ffe4b1050107d93f8a39ebc59b15d8b429b497a languageName: node linkType: hard @@ -23554,7 +24454,7 @@ __metadata: languageName: node linkType: hard -"is-arguments@npm:^1.0.4, is-arguments@npm:^1.1.0": +"is-arguments@npm:^1.0.4, is-arguments@npm:^1.1.1": version: 1.1.1 resolution: "is-arguments@npm:1.1.1" dependencies: @@ -23564,6 +24464,17 @@ __metadata: languageName: node linkType: hard +"is-array-buffer@npm:^3.0.1, is-array-buffer@npm:^3.0.2": + version: 3.0.2 + resolution: "is-array-buffer@npm:3.0.2" + dependencies: + call-bind: ^1.0.2 + get-intrinsic: ^1.2.0 + is-typed-array: ^1.1.10 + checksum: dcac9dda66ff17df9cabdc58214172bf41082f956eab30bb0d86bc0fab1e44b690fc8e1f855cf2481245caf4e8a5a006a982a71ddccec84032ed41f9d8da8c14 + languageName: node + linkType: hard + "is-arrayish@npm:^0.2.1": version: 0.2.1 resolution: "is-arrayish@npm:0.2.1" @@ -23629,7 +24540,7 @@ __metadata: languageName: node linkType: hard -"is-callable@npm:^1.1.4, is-callable@npm:^1.2.7": +"is-callable@npm:^1.1.3, is-callable@npm:^1.1.4, is-callable@npm:^1.2.7": version: 1.2.7 resolution: "is-callable@npm:1.2.7" checksum: 61fd57d03b0d984e2ed3720fb1c7a897827ea174bd44402878e059542ea8c4aeedee0ea0985998aa5cc2736b2fa6e271c08587addb5b3959ac52cf665173d1ac @@ -23719,7 +24630,7 @@ __metadata: languageName: node linkType: hard -"is-date-object@npm:^1.0.1": +"is-date-object@npm:^1.0.1, is-date-object@npm:^1.0.5": version: 1.0.5 resolution: "is-date-object@npm:1.0.5" dependencies: @@ -23924,7 +24835,7 @@ __metadata: languageName: node linkType: hard -"is-map@npm:^2.0.2": +"is-map@npm:^2.0.1, is-map@npm:^2.0.2": version: 2.0.2 resolution: "is-map@npm:2.0.2" checksum: ace3d0ecd667bbdefdb1852de601268f67f2db725624b1958f279316e13fecb8fa7df91fd60f690d7417b4ec180712f5a7ee967008e27c65cfd475cc84337728 @@ -24147,7 +25058,7 @@ __metadata: languageName: node linkType: hard -"is-set@npm:^2.0.2": +"is-set@npm:^2.0.1, is-set@npm:^2.0.2": version: 2.0.2 resolution: "is-set@npm:2.0.2" checksum: b64343faf45e9387b97a6fd32be632ee7b269bd8183701f3b3f5b71a7cf00d04450ed8669d0bd08753e08b968beda96fca73a10fd0ff56a32603f64deba55a57 @@ -24213,16 +25124,12 @@ __metadata: languageName: node linkType: hard -"is-typed-array@npm:^1.1.3, is-typed-array@npm:^1.1.7": - version: 1.1.8 - resolution: "is-typed-array@npm:1.1.8" +"is-typed-array@npm:^1.1.10, is-typed-array@npm:^1.1.3": + version: 1.1.12 + resolution: "is-typed-array@npm:1.1.12" dependencies: - available-typed-arrays: ^1.0.5 - call-bind: ^1.0.2 - es-abstract: ^1.18.5 - foreach: ^2.0.5 - has-tostringtag: ^1.0.0 - checksum: aa0f9f0716e19e2fb8aef69e69e4205479d25ace778e2339fc910948115cde4b0d9aff9d5d1e8b80f09a5664998278e05e54ad3dc9cb12cefcf86db71084ed00 + which-typed-array: ^1.1.11 + checksum: 4c89c4a3be07186caddadf92197b17fda663a9d259ea0d44a85f171558270d36059d1c386d34a12cba22dfade5aba497ce22778e866adc9406098c8fc4771796 languageName: node linkType: hard @@ -24261,6 +25168,13 @@ __metadata: languageName: node linkType: hard +"is-weakmap@npm:^2.0.1": + version: 2.0.1 + resolution: "is-weakmap@npm:2.0.1" + checksum: 1222bb7e90c32bdb949226e66d26cb7bce12e1e28e3e1b40bfa6b390ba3e08192a8664a703dff2a00a84825f4e022f9cd58c4599ff9981ab72b1d69479f4f7f6 + languageName: node + linkType: hard + "is-weakref@npm:^1.0.2": version: 1.0.2 resolution: "is-weakref@npm:1.0.2" @@ -24270,6 +25184,16 @@ __metadata: languageName: node linkType: hard +"is-weakset@npm:^2.0.1": + version: 2.0.2 + resolution: "is-weakset@npm:2.0.2" + dependencies: + call-bind: ^1.0.2 + get-intrinsic: ^1.1.1 + checksum: 5d8698d1fa599a0635d7ca85be9c26d547b317ed8fd83fc75f03efbe75d50001b5eececb1e9971de85fcde84f69ae6f8346bc92d20d55d46201d328e4c74a367 + languageName: node + linkType: hard + "is-what@npm:^4.1.8": version: 4.1.8 resolution: "is-what@npm:4.1.8" @@ -24650,7 +25574,7 @@ __metadata: languageName: node linkType: hard -"jest-diff@npm:^29.2.1": +"jest-diff@npm:^29.2.1, jest-diff@npm:^29.6.1": version: 29.6.2 resolution: "jest-diff@npm:29.6.2" dependencies: @@ -24662,18 +25586,6 @@ __metadata: languageName: node linkType: hard -"jest-diff@npm:^29.6.1": - version: 29.6.1 - resolution: "jest-diff@npm:29.6.1" - dependencies: - chalk: ^4.0.0 - diff-sequences: ^29.4.3 - jest-get-type: ^29.4.3 - pretty-format: ^29.6.1 - checksum: c6350178ca27d92c7fd879790fb2525470c1ff1c5d29b1834a240fecd26c6904fb470ebddb98dc96dd85389c56c3b50e6965a1f5203e9236d213886ed9806219 - languageName: node - linkType: hard - "jest-docblock@npm:^29.4.3": version: 29.4.3 resolution: "jest-docblock@npm:29.4.3" @@ -26430,12 +27342,12 @@ __metadata: languageName: node linkType: hard -"lz-string@npm:^1.4.4": - version: 1.4.4 - resolution: "lz-string@npm:1.4.4" +"lz-string@npm:^1.4.4, lz-string@npm:^1.5.0": + version: 1.5.0 + resolution: "lz-string@npm:1.5.0" bin: lz-string: bin/bin.js - checksum: 54e31238a61a84d8f664d9860a9fba7310c5b97a52c444f80543069bc084815eff40b8d4474ae1d93992fdf6c252dca37cf27f6adbeb4dbc3df2f3ac773d0e61 + checksum: 1ee98b4580246fd90dd54da6e346fb1caefcf05f677c686d9af237a157fdea3fd7c83a4bc58f858cd5b10a34d27afe0fdcbd0505a47e0590726a873dc8b8f65d languageName: node linkType: hard @@ -28762,7 +29674,7 @@ __metadata: languageName: node linkType: hard -"object-is@npm:^1.0.1": +"object-is@npm:^1.0.1, object-is@npm:^1.1.5": version: 1.1.5 resolution: "object-is@npm:1.1.5" dependencies: @@ -31122,18 +32034,7 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:^29.0.0, pretty-format@npm:^29.6.1": - version: 29.6.1 - resolution: "pretty-format@npm:29.6.1" - dependencies: - "@jest/schemas": ^29.6.0 - ansi-styles: ^5.0.0 - react-is: ^18.0.0 - checksum: 6f923a2379a37a425241dc223d76f671c73c4f37dba158050575a54095867d565c068b441843afdf3d7c37bed9df4bbadf46297976e60d4149972b779474203a - languageName: node - linkType: hard - -"pretty-format@npm:^29.2.1, pretty-format@npm:^29.6.2": +"pretty-format@npm:^29.0.0, pretty-format@npm:^29.2.1, pretty-format@npm:^29.6.1, pretty-format@npm:^29.6.2": version: 29.6.2 resolution: "pretty-format@npm:29.6.2" dependencies: @@ -31669,6 +32570,13 @@ __metadata: languageName: node linkType: hard +"ramda@npm:0.29.0": + version: 0.29.0 + resolution: "ramda@npm:0.29.0" + checksum: 9ab26c06eb7545cbb7eebcf75526d6ee2fcaae19e338f165b2bf32772121e7b28192d6664d1ba222ff76188ba26ab307342d66e805dbb02c860560adc4d5dd57 + languageName: node + linkType: hard + "ramda@npm:^0.21.0": version: 0.21.0 resolution: "ramda@npm:0.21.0" @@ -32029,24 +32937,6 @@ __metadata: languageName: node linkType: hard -"react-hook-form@npm:^7.30.0, react-hook-form@npm:^7.34.2": - version: 7.34.2 - resolution: "react-hook-form@npm:7.34.2" - peerDependencies: - react: ^16.8.0 || ^17 || ^18 - checksum: 485cde0248e668ad1845b927f9cc05b434c384141bb03bc143a7d7cc937eebf119c935114ccbfa397b463808283dab5b2334022fe5dba975402b201e601d6876 - languageName: node - linkType: hard - -"react-hook-form@npm:^7.45.0": - version: 7.45.0 - resolution: "react-hook-form@npm:7.45.0" - peerDependencies: - react: ^16.8.0 || ^17 || ^18 - checksum: 3e35253f0efb0f77f5036c74f85cbdd425adb2fad20a14fc692d573fe552b3d9b7e7ac22193cd767f265fa292c33383d8721cfbdcc5ae41910a35a1ba3655f66 - languageName: node - linkType: hard - "react-hook-form@npm:~7.27.1": version: 7.27.1 resolution: "react-hook-form@npm:7.27.1" @@ -32056,21 +32946,30 @@ __metadata: languageName: node linkType: hard -"react-i18next@npm:^11.16.7, react-i18next@npm:^11.16.9": - version: 11.18.5 - resolution: "react-i18next@npm:11.18.5" +"react-hook-form@npm:~7.45.4": + version: 7.45.4 + resolution: "react-hook-form@npm:7.45.4" + peerDependencies: + react: ^16.8.0 || ^17 || ^18 + checksum: 1d84c78dadf561bc9e360272c5c856c724426162e13a74929c0517c3eb8004a7f057561fff3bfd4c1121b36d6cf1437399df1dbfd01d0817b9f922503f407d8f + languageName: node + linkType: hard + +"react-i18next@npm:~13.2.1": + version: 13.2.1 + resolution: "react-i18next@npm:13.2.1" dependencies: - "@babel/runtime": ^7.14.5 + "@babel/runtime": ^7.22.5 html-parse-stringify: ^3.0.1 peerDependencies: - i18next: ">= 19.0.0" + i18next: ">= 23.2.3" react: ">= 16.8.0" peerDependenciesMeta: react-dom: optional: true react-native: optional: true - checksum: c5e4b5b8ecc49f799a93110cb4d99d91190a268cf3b14b48e005ac1453eefe75e10758952a7d01fef4cf55afc5a6e7170d23c41d602efaedc06d4d34a85cd725 + checksum: aa3bd7b0f9f3d794e756a7fe087471c20c13dc2fbf5e53400403a356973d87a1b76f0204720081914bd06cb94d92bf987ebbf33c3de3c67a0cc9b32dde8972f1 languageName: node linkType: hard @@ -32168,6 +33067,41 @@ __metadata: languageName: node linkType: hard +"react-remove-scroll-bar@npm:^2.3.3": + version: 2.3.4 + resolution: "react-remove-scroll-bar@npm:2.3.4" + dependencies: + react-style-singleton: ^2.2.1 + tslib: ^2.0.0 + peerDependencies: + "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: b5ce5f2f98d65c97a3e975823ae4043a4ba2a3b63b5ba284b887e7853f051b5cd6afb74abde6d57b421931c52f2e1fdbb625dc858b1cb5a32c27c14ab85649d4 + languageName: node + linkType: hard + +"react-remove-scroll@npm:2.5.5": + version: 2.5.5 + resolution: "react-remove-scroll@npm:2.5.5" + dependencies: + react-remove-scroll-bar: ^2.3.3 + react-style-singleton: ^2.2.1 + tslib: ^2.1.0 + use-callback-ref: ^1.3.0 + use-sidecar: ^1.1.2 + peerDependencies: + "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 2c7fe9cbd766f5e54beb4bec2e2efb2de3583037b23fef8fa511ab426ed7f1ae992382db5acd8ab5bfb030a4b93a06a2ebca41377d6eeaf0e6791bb0a59616a4 + languageName: node + linkType: hard + "react-router-dom@npm:^6.11.2": version: 6.11.2 resolution: "react-router-dom@npm:6.11.2" @@ -32258,6 +33192,23 @@ __metadata: languageName: node linkType: hard +"react-style-singleton@npm:^2.2.1": + version: 2.2.1 + resolution: "react-style-singleton@npm:2.2.1" + dependencies: + get-nonce: ^1.0.0 + invariant: ^2.2.4 + tslib: ^2.0.0 + peerDependencies: + "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 7ee8ef3aab74c7ae1d70ff34a27643d11ba1a8d62d072c767827d9ff9a520905223e567002e0bf6c772929d8ea1c781a3ba0cc4a563e92b1e3dc2eaa817ecbe8 + languageName: node + linkType: hard + "react-virtuoso@npm:^1.11.1": version: 1.11.1 resolution: "react-virtuoso@npm:1.11.1" @@ -32640,19 +33591,26 @@ __metadata: languageName: node linkType: hard -"regenerator-runtime@npm:^0.13.11, regenerator-runtime@npm:^0.13.2, regenerator-runtime@npm:^0.13.7": +"regenerator-runtime@npm:^0.13.2, regenerator-runtime@npm:^0.13.7": version: 0.13.11 resolution: "regenerator-runtime@npm:0.13.11" checksum: 27481628d22a1c4e3ff551096a683b424242a216fee44685467307f14d58020af1e19660bf2e26064de946bad7eff28950eae9f8209d55723e2d9351e632bbb4 languageName: node linkType: hard -"regenerator-transform@npm:^0.15.1": - version: 0.15.1 - resolution: "regenerator-transform@npm:0.15.1" +"regenerator-runtime@npm:^0.14.0": + version: 0.14.0 + resolution: "regenerator-runtime@npm:0.14.0" + checksum: 1c977ad82a82a4412e4f639d65d22be376d3ebdd30da2c003eeafdaaacd03fc00c2320f18120007ee700900979284fc78a9f00da7fb593f6e6eeebc673fba9a3 + languageName: node + linkType: hard + +"regenerator-transform@npm:^0.15.2": + version: 0.15.2 + resolution: "regenerator-transform@npm:0.15.2" dependencies: "@babel/runtime": ^7.8.4 - checksum: 2d15bdeadbbfb1d12c93f5775493d85874dbe1d405bec323da5c61ec6e701bc9eea36167483e1a5e752de9b2df59ab9a2dfff6bf3784f2b28af2279a673d29a4 + checksum: 20b6f9377d65954980fe044cfdd160de98df415b4bff38fbade67b3337efaf078308c4fed943067cd759827cc8cfeca9cb28ccda1f08333b85d6a2acbd022c27 languageName: node linkType: hard @@ -32666,14 +33624,14 @@ __metadata: languageName: node linkType: hard -"regexp.prototype.flags@npm:^1.4.3": - version: 1.4.3 - resolution: "regexp.prototype.flags@npm:1.4.3" +"regexp.prototype.flags@npm:^1.4.3, regexp.prototype.flags@npm:^1.5.0": + version: 1.5.0 + resolution: "regexp.prototype.flags@npm:1.5.0" dependencies: call-bind: ^1.0.2 - define-properties: ^1.1.3 - functions-have-names: ^1.2.2 - checksum: 51228bae732592adb3ededd5e15426be25f289e9c4ef15212f4da73f4ec3919b6140806374b8894036a86020d054a8d2657d3fee6bb9b4d35d8939c20030b7a6 + define-properties: ^1.2.0 + functions-have-names: ^1.2.3 + checksum: c541687cdbdfff1b9a07f6e44879f82c66bbf07665f9a7544c5fd16acdb3ec8d1436caab01662d2fbcad403f3499d49ab0b77fbc7ef29ef961d98cc4bc9755b4 languageName: node linkType: hard @@ -34816,10 +35774,43 @@ __metadata: languageName: node linkType: hard -"store2@npm:^2.12.0": - version: 2.13.2 - resolution: "store2@npm:2.13.2" - checksum: 9e760ea2a7f56eae47d5bafe507511b25ad983bba901e1e0c5f65713e631c15aafb8e031c658047af53c2008a5d21cb6c43f2383673b3493144e8e1ead5c8f91 +"stop-iteration-iterator@npm:^1.0.0": + version: 1.0.0 + resolution: "stop-iteration-iterator@npm:1.0.0" + dependencies: + internal-slot: ^1.0.4 + checksum: d04173690b2efa40e24ab70e5e51a3ff31d56d699550cfad084104ab3381390daccb36652b25755e420245f3b0737de66c1879eaa2a8d4fc0a78f9bf892fcb42 + languageName: node + linkType: hard + +"store2@npm:^2.12.0, store2@npm:^2.14.2": + version: 2.14.2 + resolution: "store2@npm:2.14.2" + checksum: 6f270fc5bab99b63f45fcc7bd8b99c2714b4adf880f557ed7ffb5ed3987131251165bccde425a00928aaf044870aee79ddeef548576d093c68703ed2edec45d7 + languageName: node + linkType: hard + +"storybook-dark-mode@npm:~3.0.1": + version: 3.0.1 + resolution: "storybook-dark-mode@npm:3.0.1" + dependencies: + "@storybook/addons": ^7.0.0 + "@storybook/api": ^7.0.0 + "@storybook/components": ^7.0.0 + "@storybook/core-events": ^7.0.0 + "@storybook/global": ^5.0.0 + "@storybook/theming": ^7.0.0 + fast-deep-equal: ^3.1.3 + memoizerific: ^1.11.3 + 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: d04213c92e8a4af0035e80eb02b75b8da725ba7b1ecbfe050eb04cb4018d91394f08c8fe7c1b106c971b2047ef5a1ba776e78050ae1f6d7563cdfdba5e701a29 languageName: node linkType: hard @@ -35774,6 +36765,15 @@ __metadata: languageName: node linkType: hard +"telejson@npm:^7.0.3": + version: 7.1.0 + resolution: "telejson@npm:7.1.0" + dependencies: + memoizerific: ^1.11.3 + checksum: 8000e43dc862a87ab1ca342a2635641923d55c2585f85ea8c7c60293681d6f920e8b9570cc12d90ecef286f065c176da5f769f42f4828ba18a626627bed1ac07 + languageName: node + linkType: hard + "temp-dir@npm:^1.0.0": version: 1.0.0 resolution: "temp-dir@npm:1.0.0" @@ -35881,20 +36881,7 @@ __metadata: languageName: node linkType: hard -"terser@npm:^4.1.2, terser@npm:^4.6.3": - version: 4.8.0 - resolution: "terser@npm:4.8.0" - dependencies: - commander: ^2.20.0 - source-map: ~0.6.1 - source-map-support: ~0.5.12 - bin: - terser: bin/terser - checksum: f980789097d4f856c1ef4b9a7ada37beb0bb022fb8aa3057968862b5864ad7c244253b3e269c9eb0ab7d0caf97b9521273f2d1cf1e0e942ff0016e0583859c71 - languageName: node - linkType: hard - -"terser@npm:^4.6.13": +"terser@npm:^4.1.2, terser@npm:^4.6.13, terser@npm:^4.6.3": version: 4.8.1 resolution: "terser@npm:4.8.1" dependencies: @@ -36078,7 +37065,7 @@ __metadata: languageName: node linkType: hard -"tiny-invariant@npm:^1.0.6, tiny-invariant@npm:^1.2.0": +"tiny-invariant@npm:^1.0.6, tiny-invariant@npm:^1.2.0, tiny-invariant@npm:^1.3.1": version: 1.3.1 resolution: "tiny-invariant@npm:1.3.1" checksum: 872dbd1ff20a21303a2fd20ce3a15602cfa7fcf9b228bd694a52e2938224313b5385a1078cb667ed7375d1612194feaca81c4ecbe93121ca1baebe344de4f84c @@ -36514,10 +37501,10 @@ __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.4.0, tslib@npm:^2.5.3": - version: 2.5.3 - resolution: "tslib@npm:2.5.3" - checksum: 88902b309afaf83259131c1e13da1dceb0ad1682a213143a1346a649143924d78cf3760c448b84d796938fd76127183894f8d85cbb3bf9c4fddbfcc140c0003c +"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, tslib@npm:^2.4.0, tslib@npm:^2.5.3": + version: 2.6.2 + resolution: "tslib@npm:2.6.2" + checksum: 329ea56123005922f39642318e3d1f0f8265d1e7fcb92c633e0809521da75eeaca28d2cf96d7248229deb40e5c19adf408259f4b9640afd20d13aecc1430f3ad languageName: node linkType: hard @@ -36843,6 +37830,13 @@ __metadata: languageName: node linkType: hard +"type-fest@npm:^2.19.0": + version: 2.19.0 + resolution: "type-fest@npm:2.19.0" + checksum: a4ef07ece297c9fba78fc1bd6d85dff4472fe043ede98bd4710d2615d15776902b595abf62bd78339ed6278f021235fb28a96361f8be86ed754f778973a0d278 + languageName: node + linkType: hard + "type-is@npm:1.6.18, type-is@npm:~1.6.18": version: 1.6.18 resolution: "type-is@npm:1.6.18" @@ -37449,6 +38443,21 @@ __metadata: languageName: node linkType: hard +"use-callback-ref@npm:^1.3.0": + version: 1.3.0 + resolution: "use-callback-ref@npm:1.3.0" + dependencies: + tslib: ^2.0.0 + peerDependencies: + "@types/react": ^16.8.0 || ^17.0.0 || ^18.0.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 7913df383a5a6fcb399212eedefaac2e0c6f843555202d4e3010bac3848afe38ecaa3d0d6500ad1d936fbeffd637e6c517e68edb024af5e6beca7f27f3ce7b21 + languageName: node + linkType: hard + "use-memo-one@npm:^1.1.1": version: 1.1.3 resolution: "use-memo-one@npm:1.1.3" @@ -37458,6 +38467,34 @@ __metadata: languageName: node linkType: hard +"use-resize-observer@npm:^9.1.0": + version: 9.1.0 + resolution: "use-resize-observer@npm:9.1.0" + dependencies: + "@juggle/resize-observer": ^3.3.1 + peerDependencies: + react: 16.8.0 - 18 + react-dom: 16.8.0 - 18 + checksum: 92be0ac34a3b3cf884cd55847c90792b5b44833dc258e96d650152815ad246afe45825aa223332203004d836535a927ab74f18dc0313229e2c7c69510eddf382 + languageName: node + linkType: hard + +"use-sidecar@npm:^1.1.2": + version: 1.1.2 + resolution: "use-sidecar@npm:1.1.2" + dependencies: + detect-node-es: ^1.1.0 + tslib: ^2.0.0 + peerDependencies: + "@types/react": ^16.9.0 || ^17.0.0 || ^18.0.0 + react: ^16.8.0 || ^17.0.0 || ^18.0.0 + peerDependenciesMeta: + "@types/react": + optional: true + checksum: 925d1922f9853e516eaad526b6fed1be38008073067274f0ecc3f56b17bb8ab63480140dd7c271f94150027c996cea4efe83d3e3525e8f3eda22055f6a39220b + languageName: node + linkType: hard + "use-strict@npm:1.0.1": version: 1.0.1 resolution: "use-strict@npm:1.0.1" @@ -38368,44 +39405,7 @@ __metadata: languageName: node linkType: hard -"webpack@npm:>=4.0.0 <6.0.0, webpack@npm:>=4.43.0 <6.0.0, webpack@npm:^5.9.0": - version: 5.88.0 - resolution: "webpack@npm:5.88.0" - dependencies: - "@types/eslint-scope": ^3.7.3 - "@types/estree": ^1.0.0 - "@webassemblyjs/ast": ^1.11.5 - "@webassemblyjs/wasm-edit": ^1.11.5 - "@webassemblyjs/wasm-parser": ^1.11.5 - acorn: ^8.7.1 - acorn-import-assertions: ^1.9.0 - browserslist: ^4.14.5 - chrome-trace-event: ^1.0.2 - enhanced-resolve: ^5.15.0 - es-module-lexer: ^1.2.1 - 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.2.0 - tapable: ^2.1.1 - terser-webpack-plugin: ^5.3.7 - watchpack: ^2.4.0 - webpack-sources: ^3.2.3 - peerDependenciesMeta: - webpack-cli: - optional: true - bin: - webpack: bin/webpack.js - checksum: 9fd1568b34ec2e99ba97c8509a15ab2576ec80c396e7015551ec814b24cfc11de173acba3e114dafe95f1a6d460781b09d6201e6a1fb15110e1d01a09f61a283 - languageName: node - linkType: hard - -"webpack@npm:^5": +"webpack@npm:>=4.0.0 <6.0.0, webpack@npm:>=4.43.0 <6.0.0, webpack@npm:^5, webpack@npm:^5.9.0": version: 5.88.2 resolution: "webpack@npm:5.88.2" dependencies: @@ -38554,6 +39554,18 @@ __metadata: languageName: node linkType: hard +"which-collection@npm:^1.0.1": + version: 1.0.1 + resolution: "which-collection@npm:1.0.1" + dependencies: + is-map: ^2.0.1 + is-set: ^2.0.1 + is-weakmap: ^2.0.1 + is-weakset: ^2.0.1 + checksum: c815bbd163107ef9cb84f135e6f34453eaf4cca994e7ba85ddb0d27cea724c623fae2a473ceccfd5549c53cc65a5d82692de418166df3f858e1e5dc60818581c + languageName: node + linkType: hard + "which-module@npm:^2.0.0": version: 2.0.0 resolution: "which-module@npm:2.0.0" @@ -38578,17 +39590,16 @@ __metadata: languageName: node linkType: hard -"which-typed-array@npm:^1.1.2": - version: 1.1.7 - resolution: "which-typed-array@npm:1.1.7" +"which-typed-array@npm:^1.1.11, which-typed-array@npm:^1.1.2, which-typed-array@npm:^1.1.9": + version: 1.1.11 + resolution: "which-typed-array@npm:1.1.11" dependencies: available-typed-arrays: ^1.0.5 call-bind: ^1.0.2 - es-abstract: ^1.18.5 - foreach: ^2.0.5 + for-each: ^0.3.3 + gopd: ^1.0.1 has-tostringtag: ^1.0.0 - is-typed-array: ^1.1.7 - checksum: 147837cf5866e36b6b2e427731709e02f79f1578477cbde68ed773a5307520a6cb6836c73c79c30690a473266ee59010b83b6d9b25d8d677a40ff77fb37a8a84 + checksum: 711ffc8ef891ca6597b19539075ec3e08bb9b4c2ca1f78887e3c07a977ab91ac1421940505a197758fb5939aa9524976d0a5bbcac34d07ed6faa75cedbb17206 languageName: node linkType: hard @@ -38819,22 +39830,7 @@ __metadata: languageName: node linkType: hard -"ws@npm:^7.0.0, ws@npm:^7.4.6": - version: 7.5.7 - resolution: "ws@npm:7.5.7" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 5c1f669a166fb57560b4e07f201375137fa31d9186afde78b1508926345ce546332f109081574ddc4e38cc474c5406b5fc71c18d71eb75f6e2d2245576976cba - languageName: node - linkType: hard - -"ws@npm:^7.3.1": +"ws@npm:^7.0.0, ws@npm:^7.3.1, ws@npm:^7.4.6": version: 7.5.9 resolution: "ws@npm:7.5.9" peerDependencies: From 459c8574ed6deb4bbf152eed1c3cc2bc2f8d74d0 Mon Sep 17 00:00:00 2001 From: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com> Date: Fri, 1 Sep 2023 11:45:44 -0300 Subject: [PATCH 050/275] fix: Custom OAuth services can't be fully removed (#30212) Co-authored-by: Hugo Costa <20212776+hugocostadev@users.noreply.github.com> --- .changeset/fifty-cars-divide.md | 5 +++++ .../app/lib/server/methods/removeOAuthService.ts | 1 + .../views/admin/settings/groups/OAuthGroupPage.tsx | 12 ++++++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 .changeset/fifty-cars-divide.md diff --git a/.changeset/fifty-cars-divide.md b/.changeset/fifty-cars-divide.md new file mode 100644 index 000000000000..6c09cf6869c8 --- /dev/null +++ b/.changeset/fifty-cars-divide.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed issue with custom OAuth services' settings not being be fully removed diff --git a/apps/meteor/app/lib/server/methods/removeOAuthService.ts b/apps/meteor/app/lib/server/methods/removeOAuthService.ts index 1be3edeb2caa..6d1bb688979d 100644 --- a/apps/meteor/app/lib/server/methods/removeOAuthService.ts +++ b/apps/meteor/app/lib/server/methods/removeOAuthService.ts @@ -61,6 +61,7 @@ Meteor.methods({ Settings.removeById(`Accounts_OAuth_Custom-${name}-channels_admin`), Settings.removeById(`Accounts_OAuth_Custom-${name}-map_channels`), Settings.removeById(`Accounts_OAuth_Custom-${name}-groups_channel_map`), + Settings.removeById(`Accounts_OAuth_Custom-${name}-merge_users_distinct_services`), ]); }, }); diff --git a/apps/meteor/client/views/admin/settings/groups/OAuthGroupPage.tsx b/apps/meteor/client/views/admin/settings/groups/OAuthGroupPage.tsx index edfae92d0270..0bd65a3ad533 100644 --- a/apps/meteor/client/views/admin/settings/groups/OAuthGroupPage.tsx +++ b/apps/meteor/client/views/admin/settings/groups/OAuthGroupPage.tsx @@ -1,8 +1,9 @@ import type { ISetting } from '@rocket.chat/core-typings'; import { Button } from '@rocket.chat/fuselage'; +import { capitalize } from '@rocket.chat/string-helpers'; import { useToastMessageDispatch, useAbsoluteUrl, useMethod, useTranslation, useSetModal } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; -import React, { memo } from 'react'; +import React, { memo, useEffect, useState } from 'react'; import { strRight } from '../../../../../lib/utils/stringUtils'; import GenericModal from '../../../../components/GenericModal'; @@ -18,6 +19,8 @@ function OAuthGroupPage({ _id, ...group }: OAuthGroupPageProps): ReactElement { const solo = sections.length === 1; const t = useTranslation(); + const [settingSections, setSettingSections] = useState(sections); + const sectionIsCustomOAuth = (sectionName: string): string | boolean => sectionName && /^Custom OAuth:\s.+/.test(sectionName); const getAbsoluteUrl = useAbsoluteUrl(); @@ -57,6 +60,10 @@ function OAuthGroupPage({ _id, ...group }: OAuthGroupPageProps): ReactElement { setModal( setModal(null)} />); }; + useEffect(() => { + setSettingSections(sections); + }, [sections]); + const removeCustomOauthFactory = (id: string): (() => void) => (): void => { @@ -64,6 +71,7 @@ function OAuthGroupPage({ _id, ...group }: OAuthGroupPageProps): ReactElement { try { await removeOAuthService(id); dispatchToastMessage({ type: 'success', message: t('Custom_OAuth_has_been_removed') }); + setSettingSections(settingSections.filter((section) => section !== `Custom OAuth: ${capitalize(id)}`)); } catch (error) { dispatchToastMessage({ type: 'error', message: error }); } finally { @@ -94,7 +102,7 @@ function OAuthGroupPage({ _id, ...group }: OAuthGroupPageProps): ReactElement { } > - {sections.map((sectionName) => { + {settingSections.map((sectionName) => { if (sectionIsCustomOAuth(sectionName)) { const id = strRight(sectionName, 'Custom OAuth: ').toLowerCase(); From 203304782f05216373e07b31df0c9153ad67b4bb Mon Sep 17 00:00:00 2001 From: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com> Date: Fri, 1 Sep 2023 12:10:12 -0300 Subject: [PATCH 051/275] fix: new `overrideDestinationChannelEnabled` param in integrations' endpoints is required (#30202) Co-authored-by: Gabriel Casals <83978645+casalsgh@users.noreply.github.com> --- .changeset/chilled-phones-give.md | 7 ++++++ .../incoming/addIncomingIntegration.ts | 3 ++- .../incoming/updateIncomingIntegration.ts | 4 ++- .../api/07-incoming-integrations.js | 25 +++++++++++++++++++ packages/core-typings/src/IIntegration.ts | 2 +- .../integrations/IntegrationsCreateProps.ts | 4 +-- .../integrations/IntegrationsUpdateProps.ts | 12 +++------ 7 files changed, 44 insertions(+), 13 deletions(-) create mode 100644 .changeset/chilled-phones-give.md diff --git a/.changeset/chilled-phones-give.md b/.changeset/chilled-phones-give.md new file mode 100644 index 000000000000..cb0887db0883 --- /dev/null +++ b/.changeset/chilled-phones-give.md @@ -0,0 +1,7 @@ +--- +"@rocket.chat/meteor": patch +"@rocket.chat/core-typings": patch +"@rocket.chat/rest-typings": patch +--- + +Fixed `overrideDestinationChannelEnabled` treated as a required param in `integrations.create` and `integration.update` endpoints diff --git a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts index 307e83f7aef7..bf84957ba8ea 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts @@ -32,7 +32,7 @@ export const addIncomingIntegration = async (userId: string, integration: INewIn alias: Match.Maybe(String), emoji: Match.Maybe(String), scriptEnabled: Boolean, - overrideDestinationChannelEnabled: Boolean, + overrideDestinationChannelEnabled: Match.Maybe(Boolean), script: Match.Maybe(String), avatar: Match.Maybe(String), }), @@ -92,6 +92,7 @@ export const addIncomingIntegration = async (userId: string, integration: INewIn ...integration, type: 'webhook-incoming', channel: channels, + overrideDestinationChannelEnabled: integration.overrideDestinationChannelEnabled ?? false, token: Random.id(48), userId: user._id, _createdAt: new Date(), diff --git a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts index 5e5fe67f3977..b865c72e0cca 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts @@ -171,7 +171,9 @@ Meteor.methods({ script: integration.script, scriptEnabled: integration.scriptEnabled, }), - overrideDestinationChannelEnabled: integration.overrideDestinationChannelEnabled, + ...(typeof integration.overrideDestinationChannelEnabled !== 'undefined' && { + overrideDestinationChannelEnabled: integration.overrideDestinationChannelEnabled, + }), _updatedAt: new Date(), _updatedBy: await Users.findOne({ _id: this.userId }, { projection: { username: 1 } }), }, diff --git a/apps/meteor/tests/end-to-end/api/07-incoming-integrations.js b/apps/meteor/tests/end-to-end/api/07-incoming-integrations.js index 683cdb2e331b..b6eff60393e5 100644 --- a/apps/meteor/tests/end-to-end/api/07-incoming-integrations.js +++ b/apps/meteor/tests/end-to-end/api/07-incoming-integrations.js @@ -144,6 +144,31 @@ describe('[Incoming Integrations]', function () { }); }); + it('should set overrideDestinationChannelEnabled setting to false when it is not provided', async () => { + let integrationId; + await request + .post(api('integrations.create')) + .set(credentials) + .send({ + type: 'webhook-incoming', + name: 'Incoming test', + enabled: true, + alias: 'test', + username: 'rocket.cat', + scriptEnabled: false, + channel: '#general', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('integration').and.to.be.an('object'); + expect(res.body.integration).to.have.property('overrideDestinationChannelEnabled', false); + integrationId = res.body.integration._id; + }); + await removeIntegration(integrationId, 'incoming'); + }); + it('should add the integration successfully when the user ONLY has the permission "manage-own-incoming-integrations" to add an incoming integration', (done) => { updatePermission('manage-incoming-integrations', []).then(() => { updatePermission('manage-own-incoming-integrations', ['admin']).then(() => { diff --git a/packages/core-typings/src/IIntegration.ts b/packages/core-typings/src/IIntegration.ts index 5f31c9f7879a..6b99424264b2 100644 --- a/packages/core-typings/src/IIntegration.ts +++ b/packages/core-typings/src/IIntegration.ts @@ -10,7 +10,6 @@ export interface IIncomingIntegration extends IRocketChatRecord { channel: string[]; token: string; - overrideDestinationChannelEnabled: boolean; scriptEnabled: boolean; script: string; scriptCompiled?: string; @@ -19,6 +18,7 @@ export interface IIncomingIntegration extends IRocketChatRecord { name: string; enabled: boolean; + overrideDestinationChannelEnabled?: boolean; alias?: string; avatar?: string; emoji?: string; diff --git a/packages/rest-typings/src/v1/integrations/IntegrationsCreateProps.ts b/packages/rest-typings/src/v1/integrations/IntegrationsCreateProps.ts index 2817d4beb0cf..e9ef650656cd 100644 --- a/packages/rest-typings/src/v1/integrations/IntegrationsCreateProps.ts +++ b/packages/rest-typings/src/v1/integrations/IntegrationsCreateProps.ts @@ -8,7 +8,7 @@ export type IntegrationsCreateProps = type: 'webhook-incoming'; username: string; channel: string; - overrideDestinationChannelEnabled: boolean; + overrideDestinationChannelEnabled?: boolean; scriptEnabled: boolean; script?: string; name: string; @@ -70,7 +70,7 @@ const integrationsCreateSchema = { }, overrideDestinationChannelEnabled: { type: 'boolean', - nullable: false, + nullable: true, }, script: { type: 'string', diff --git a/packages/rest-typings/src/v1/integrations/IntegrationsUpdateProps.ts b/packages/rest-typings/src/v1/integrations/IntegrationsUpdateProps.ts index 7237b73fdcc3..6b0e7ce046d1 100644 --- a/packages/rest-typings/src/v1/integrations/IntegrationsUpdateProps.ts +++ b/packages/rest-typings/src/v1/integrations/IntegrationsUpdateProps.ts @@ -9,7 +9,7 @@ export type IntegrationsUpdateProps = integrationId: string; channel: string; scriptEnabled: boolean; - overrideDestinationChannelEnabled: boolean; + overrideDestinationChannelEnabled?: boolean; script?: string; name: string; enabled: boolean; @@ -72,7 +72,7 @@ const integrationsUpdateSchema = { }, overrideDestinationChannelEnabled: { type: 'boolean', - nullable: false, + nullable: true, }, script: { type: 'string', @@ -99,7 +99,7 @@ const integrationsUpdateSchema = { nullable: true, }, }, - required: ['integrationId', 'type', 'channel', 'scriptEnabled', 'overrideDestinationChannelEnabled', 'name', 'enabled'], + required: ['integrationId', 'type', 'channel', 'scriptEnabled', 'name', 'enabled'], additionalProperties: true, }, { @@ -162,10 +162,6 @@ const integrationsUpdateSchema = { type: 'boolean', nullable: false, }, - overrideDestinationChannelEnabled: { - type: 'boolean', - nullable: false, - }, script: { type: 'string', nullable: true, @@ -211,7 +207,7 @@ const integrationsUpdateSchema = { nullable: true, }, }, - required: ['type', 'username', 'channel', 'event', 'scriptEnabled', 'overrideDestinationChannelEnabled', 'name', 'enabled'], + required: ['type', 'username', 'channel', 'event', 'scriptEnabled', 'name', 'enabled'], additionalProperties: false, }, ], From ba24f3c21fea75d91e983397e8dbba16f6f79ec8 Mon Sep 17 00:00:00 2001 From: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com> Date: Fri, 1 Sep 2023 12:13:01 -0300 Subject: [PATCH 052/275] fix: `default` field is not returned from the `setDefault` endpoint when setting to false (#30194) --- .changeset/real-pets-visit.md | 6 ++ apps/meteor/server/models/raw/Rooms.ts | 18 ++---- .../tests/end-to-end/api/02-channels.js | 60 +++++++++++++------ packages/core-typings/src/IRoom.ts | 2 +- 4 files changed, 55 insertions(+), 31 deletions(-) create mode 100644 .changeset/real-pets-visit.md diff --git a/.changeset/real-pets-visit.md b/.changeset/real-pets-visit.md new file mode 100644 index 000000000000..d6531285597c --- /dev/null +++ b/.changeset/real-pets-visit.md @@ -0,0 +1,6 @@ +--- +"@rocket.chat/meteor": patch +"@rocket.chat/core-typings": patch +--- + +Fixed `default` field not being returned from the `setDefault` endpoints when setting to false diff --git a/apps/meteor/server/models/raw/Rooms.ts b/apps/meteor/server/models/raw/Rooms.ts index 9dad0fa60da3..673fd83f7800 100644 --- a/apps/meteor/server/models/raw/Rooms.ts +++ b/apps/meteor/server/models/raw/Rooms.ts @@ -1349,7 +1349,7 @@ export class RoomsRaw extends BaseRaw implements IRoomsModel { t: { $in: types, }, - ...(defaultValue ? { default: true } : { default: { $exists: false } }), + ...(defaultValue ? { default: true } : { default: { $ne: true } }), }; return this.find(query, options); @@ -1763,17 +1763,11 @@ export class RoomsRaw extends BaseRaw implements IRoomsModel { saveDefaultById(_id: IRoom['_id'], defaultValue: boolean): Promise { const query: Filter = { _id }; - const update: UpdateFilter = defaultValue - ? { - $set: { - default: true, - }, - } - : { - $unset: { - default: 1, - }, - }; + const update: UpdateFilter = { + $set: { + default: defaultValue, + }, + }; return this.updateOne(query, update); } 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 e1615dc34997..7cb2e2234e4e 100644 --- a/apps/meteor/tests/end-to-end/api/02-channels.js +++ b/apps/meteor/tests/end-to-end/api/02-channels.js @@ -1573,25 +1573,49 @@ describe('[Channels]', function () { }); }); - it('/channels.setDefault', async () => { - const roomInfo = await getRoomInfo(channel._id); + describe('/channels.setDefault', () => { + it('should set channel as default', 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); - }); + 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); + expect(res.body).to.have.nested.property('channel.default', true); + }); + }); + it('should unset channel as default', async () => { + const roomInfo = await getRoomInfo(channel._id); + + return request + .post(api('channels.setDefault')) + .set(credentials) + .send({ + roomId: channel._id, + default: false, + }) + .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); + expect(res.body).to.have.nested.property('channel.default', false); + }); + }); }); it('/channels.leave', async () => { diff --git a/packages/core-typings/src/IRoom.ts b/packages/core-typings/src/IRoom.ts index 618c24a4fd3a..4ce8b84abb0e 100644 --- a/packages/core-typings/src/IRoom.ts +++ b/packages/core-typings/src/IRoom.ts @@ -23,7 +23,7 @@ export interface IRoom extends IRocketChatRecord { name?: string; fname?: string; msgs: number; - default?: true; + default?: boolean; broadcast?: true; featured?: true; announcement?: string; From b440346565e259986cc35195ca2839e8f643c400 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Fri, 1 Sep 2023 12:13:22 -0300 Subject: [PATCH 053/275] regression: Crash in livechat with manual routing (#30244) Co-authored-by: Guilherme Gazzo --- packages/livechat/src/routes/Chat/container.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livechat/src/routes/Chat/container.js b/packages/livechat/src/routes/Chat/container.js index d3fab0102855..2d23645fb49e 100644 --- a/packages/livechat/src/routes/Chat/container.js +++ b/packages/livechat/src/routes/Chat/container.js @@ -40,7 +40,7 @@ class ChatContainer extends Component { this.state.queueSpot = newQueueSpot; this.state.estimatedWaitTime = newEstimatedWaitTime; await this.handleQueueMessage(connecting, queueInfo); - await this.handleConnectingAgentAlert(newConnecting, normalizeQueueAlert(queueInfo)); + await this.handleConnectingAgentAlert(newConnecting, await normalizeQueueAlert(queueInfo)); } }; From 5c80ce9ffd17d65ac94cd0be687649573dd1a84a Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Fri, 1 Sep 2023 12:46:17 -0300 Subject: [PATCH 054/275] chore: Add missing loading state on `AdminInviteUsers` (#30248) --- .../views/admin/users/AdminInviteUsers.tsx | 30 ++++++++++++------- .../views/admin/users/AdminUserForm.tsx | 5 ++-- .../views/admin/users/hooks/useSmtpConfig.ts | 14 --------- .../views/admin/users/hooks/useSmtpQuery.ts | 7 +++++ 4 files changed, 29 insertions(+), 27 deletions(-) delete mode 100644 apps/meteor/client/views/admin/users/hooks/useSmtpConfig.ts create mode 100644 apps/meteor/client/views/admin/users/hooks/useSmtpQuery.ts diff --git a/apps/meteor/client/views/admin/users/AdminInviteUsers.tsx b/apps/meteor/client/views/admin/users/AdminInviteUsers.tsx index 9d549ef19c0b..8976864f3430 100644 --- a/apps/meteor/client/views/admin/users/AdminInviteUsers.tsx +++ b/apps/meteor/client/views/admin/users/AdminInviteUsers.tsx @@ -10,31 +10,39 @@ import { TextAreaInput, } from '@rocket.chat/fuselage'; import { useTranslation, useRoute } from '@rocket.chat/ui-contexts'; -import type { ReactElement, ChangeEvent, ComponentProps } from 'react'; +import type { ChangeEvent } from 'react'; import React, { useCallback, useState } from 'react'; import { validateEmail } from '../../../../lib/emailValidator'; -import { ContextualbarScrollableContent, ContextualbarFooter } from '../../../components/Contextualbar'; +import { ContextualbarScrollableContent, ContextualbarFooter, ContextualbarContent } from '../../../components/Contextualbar'; +import { FormSkeleton } from '../../../components/Skeleton'; import { useSendInvitationEmailMutation } from './hooks/useSendInvitationEmailMutation'; -import { useSmtpConfig } from './hooks/useSmtpConfig'; +import { useSmtpQuery } from './hooks/useSmtpQuery'; -type InviteUsersProps = ComponentProps; - -const InviteUsers = (props: InviteUsersProps): ReactElement => { +// TODO: Replace using RHF +const AdminInviteUsers = () => { const t = useTranslation(); const [text, setText] = useState(''); const getEmails = useCallback((text) => text.split(/[\ ,;]+/i).filter((val: string) => validateEmail(val)), []); const adminRouter = useRoute('admin-settings'); const sendInvitationMutation = useSendInvitationEmailMutation(); - const isSmtpEnabled = useSmtpConfig(); + const { data, isLoading } = useSmtpQuery(); const handleClick = () => { sendInvitationMutation.mutate({ emails: getEmails(text) }); }; - if (!isSmtpEnabled) { + if (isLoading) { + return ( + + + + ); + } + + if (!data?.isSMTPConfigured) { return ( - + {t('SMTP_Server_Not_Setup_Title')} {t('SMTP_Server_Not_Setup_Description')} @@ -50,7 +58,7 @@ const InviteUsers = (props: InviteUsersProps): ReactElement => { return ( <> - + {t('Send_invitation_email')} @@ -70,4 +78,4 @@ const InviteUsers = (props: InviteUsersProps): ReactElement => { ); }; -export default InviteUsers; +export default AdminInviteUsers; diff --git a/apps/meteor/client/views/admin/users/AdminUserForm.tsx b/apps/meteor/client/views/admin/users/AdminUserForm.tsx index 4f8550a9410f..4d8f2a48395c 100644 --- a/apps/meteor/client/views/admin/users/AdminUserForm.tsx +++ b/apps/meteor/client/views/admin/users/AdminUserForm.tsx @@ -36,7 +36,7 @@ import UserAvatarEditor from '../../../components/avatar/UserAvatarEditor'; import { useEndpointAction } from '../../../hooks/useEndpointAction'; import { useUpdateAvatar } from '../../../hooks/useUpdateAvatar'; import { USER_STATUS_TEXT_MAX_LENGTH, BIO_TEXT_MAX_LENGTH } from '../../../lib/constants'; -import { useSmtpConfig } from './hooks/useSmtpConfig'; +import { useSmtpQuery } from './hooks/useSmtpQuery'; type AdminUserFormProps = { userData?: Serialized; @@ -72,7 +72,8 @@ const UserForm = ({ userData, onReload, ...props }: AdminUserFormProps) => { const defaultRoles = useSetting('Accounts_Registration_Users_Default_Roles') || ''; const defaultUserRoles = parseCSV(defaultRoles); - const isSmtpEnabled = useSmtpConfig(); + const { data } = useSmtpQuery(); + const isSmtpEnabled = data?.isSMTPConfigured; const eventStats = useEndpointAction('POST', '/v1/statistics.telemetry'); const updateUserAction = useEndpoint('POST', '/v1/users.update'); diff --git a/apps/meteor/client/views/admin/users/hooks/useSmtpConfig.ts b/apps/meteor/client/views/admin/users/hooks/useSmtpConfig.ts deleted file mode 100644 index fbf670e25ff0..000000000000 --- a/apps/meteor/client/views/admin/users/hooks/useSmtpConfig.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { useEndpoint } from '@rocket.chat/ui-contexts'; -import { useQuery } from '@tanstack/react-query'; - -export const useSmtpConfig = () => { - const getSmtpConfig = useEndpoint('GET', '/v1/smtp.check'); - - const { data } = useQuery(['smtp.check'], async () => { - const smtpConfig = await getSmtpConfig(); - - return smtpConfig.isSMTPConfigured; - }); - - return data; -}; diff --git a/apps/meteor/client/views/admin/users/hooks/useSmtpQuery.ts b/apps/meteor/client/views/admin/users/hooks/useSmtpQuery.ts new file mode 100644 index 000000000000..471f28727af4 --- /dev/null +++ b/apps/meteor/client/views/admin/users/hooks/useSmtpQuery.ts @@ -0,0 +1,7 @@ +import { useEndpoint } from '@rocket.chat/ui-contexts'; +import { useQuery } from '@tanstack/react-query'; + +export const useSmtpQuery = () => { + const getSmtpConfig = useEndpoint('GET', '/v1/smtp.check'); + return useQuery(['smtp.check'], async () => getSmtpConfig()); +}; From 6098941931755cfea535399ad2ff736f35922f04 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Fri, 1 Sep 2023 13:32:35 -0300 Subject: [PATCH 055/275] regression: add deps props for useDebouncedCallback for app stream (#30251) --- apps/meteor/client/hooks/useAppActionButtons.ts | 10 +++++++--- apps/meteor/client/hooks/useAppSlashCommands.ts | 10 +++++++--- apps/meteor/client/hooks/useAppTranslations.ts | 10 +++++++--- apps/meteor/client/providers/AppsProvider.tsx | 12 ++++++++---- 4 files changed, 29 insertions(+), 13 deletions(-) diff --git a/apps/meteor/client/hooks/useAppActionButtons.ts b/apps/meteor/client/hooks/useAppActionButtons.ts index 402c0f3c9775..8895535f9c26 100644 --- a/apps/meteor/client/hooks/useAppActionButtons.ts +++ b/apps/meteor/client/hooks/useAppActionButtons.ts @@ -29,9 +29,13 @@ export const useAppActionButtons = (context?: `${UIActionButtonContext}`) => { staleTime: Infinity, }); - const invalidate = useDebouncedCallback(() => { - queryClient.invalidateQueries(['apps', 'actionButtons']); - }, 100); + const invalidate = useDebouncedCallback( + () => { + queryClient.invalidateQueries(['apps', 'actionButtons']); + }, + 100, + [], + ); useEffect(() => { if (!uid) { diff --git a/apps/meteor/client/hooks/useAppSlashCommands.ts b/apps/meteor/client/hooks/useAppSlashCommands.ts index 3cb6ff2ce090..665e76b0ef9e 100644 --- a/apps/meteor/client/hooks/useAppSlashCommands.ts +++ b/apps/meteor/client/hooks/useAppSlashCommands.ts @@ -11,9 +11,13 @@ export const useAppSlashCommands = () => { const apps = useSingleStream('apps'); const uid = useUserId(); - const invalidate = useDebouncedCallback(() => { - queryClient.invalidateQueries(['apps', 'slashCommands']); - }, 100); + const invalidate = useDebouncedCallback( + () => { + queryClient.invalidateQueries(['apps', 'slashCommands']); + }, + 100, + [], + ); useEffect(() => { if (!uid) { diff --git a/apps/meteor/client/hooks/useAppTranslations.ts b/apps/meteor/client/hooks/useAppTranslations.ts index eba0686aab55..ad8ca5966c2b 100644 --- a/apps/meteor/client/hooks/useAppTranslations.ts +++ b/apps/meteor/client/hooks/useAppTranslations.ts @@ -26,9 +26,13 @@ export const useAppTranslations = () => { } }, [result.data]); - const invalidate = useDebouncedCallback(() => { - queryClient.invalidateQueries(['apps', 'translations']); - }, 100); + const invalidate = useDebouncedCallback( + () => { + queryClient.invalidateQueries(['apps', 'translations']); + }, + 100, + [], + ); useEffect(() => { if (!uid) { diff --git a/apps/meteor/client/providers/AppsProvider.tsx b/apps/meteor/client/providers/AppsProvider.tsx index 6b9de2344fa7..042ce8365474 100644 --- a/apps/meteor/client/providers/AppsProvider.tsx +++ b/apps/meteor/client/providers/AppsProvider.tsx @@ -22,10 +22,14 @@ const AppsProvider: FC = ({ children }) => { const stream = useSingleStream('apps'); - const invalidate = useDebouncedCallback(() => { - queryClient.invalidateQueries(['marketplace', 'apps-instance']); - invalidateAppsCountQuery(); - }, 100); + const invalidate = useDebouncedCallback( + () => { + queryClient.invalidateQueries(['marketplace', 'apps-instance']); + invalidateAppsCountQuery(); + }, + 100, + [], + ); useEffect(() => { return stream('apps', ([key]) => { From 4bf6d3ea00ce9c709e93b86dbbef74bb70ab6558 Mon Sep 17 00:00:00 2001 From: Douglas Gubert Date: Fri, 1 Sep 2023 14:22:12 -0300 Subject: [PATCH 056/275] chore: Fix envvar name in patch notes (#30235) --- .changeset/hip-hounds-ring.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/hip-hounds-ring.md b/.changeset/hip-hounds-ring.md index be1ebb295afd..79dfba6dd031 100644 --- a/.changeset/hip-hounds-ring.md +++ b/.changeset/hip-hounds-ring.md @@ -2,4 +2,4 @@ '@rocket.chat/meteor': patch --- -Added ability to disable private app installation via envvar (DISABLED_PRIVATE_APP_INSTALLATION) +Added ability to disable private app installation via envvar (DISABLE_PRIVATE_APP_INSTALLATION) From 2615de9cc48d498fd74f06cba2f86d9b5464898f Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Fri, 1 Sep 2023 15:43:35 -0300 Subject: [PATCH 057/275] chore: Reports dashboard E2E tests (#30223) --- apps/meteor/client/lib/queryClient.ts | 1 + .../components/dashboards/PeriodSelector.tsx | 5 +- .../reports/components/BarChart.tsx | 1 + .../reports/components/ReportCard.tsx | 8 +- .../reports/hooks/useAgentsSection.tsx | 1 + .../reports/hooks/useChannelsSection.tsx | 1 + .../reports/hooks/useDepartmentsSection.tsx | 5 +- .../reports/hooks/useStatusSection.tsx | 1 + .../reports/hooks/useTagsSection.tsx | 1 + .../omnichannel/omnichannel-reports.spec.ts | 365 ++++++++++++++++++ .../e2e/page-objects/omnichannel-reports.ts | 89 +++++ 11 files changed, 473 insertions(+), 5 deletions(-) create mode 100644 apps/meteor/tests/e2e/omnichannel/omnichannel-reports.spec.ts create mode 100644 apps/meteor/tests/e2e/page-objects/omnichannel-reports.ts diff --git a/apps/meteor/client/lib/queryClient.ts b/apps/meteor/client/lib/queryClient.ts index ec4a10d3f76b..2bb38d001242 100644 --- a/apps/meteor/client/lib/queryClient.ts +++ b/apps/meteor/client/lib/queryClient.ts @@ -5,6 +5,7 @@ export const queryClient = new QueryClient({ queries: { onError: console.warn, refetchOnWindowFocus: false, + retry: process.env.TEST_MODE === 'true', }, mutations: { onError: console.warn, diff --git a/apps/meteor/ee/client/components/dashboards/PeriodSelector.tsx b/apps/meteor/ee/client/components/dashboards/PeriodSelector.tsx index a14ee3075778..7d84a4df62d2 100644 --- a/apps/meteor/ee/client/components/dashboards/PeriodSelector.tsx +++ b/apps/meteor/ee/client/components/dashboards/PeriodSelector.tsx @@ -9,15 +9,16 @@ import { getPeriod } from './periods'; type PeriodSelectorProps = { periods: TPeriod[]; value: TPeriod; + name?: string; onChange: (value: TPeriod) => void; }; -const PeriodSelector = ({ periods, value, onChange }: PeriodSelectorProps): ReactElement => { +const PeriodSelector = ({ periods, value, name, onChange }: PeriodSelectorProps): ReactElement => { const t = useTranslation(); const options = useMemo<[string, string][]>(() => periods.map((period) => [period, t(...getPeriod(period).label)]), [periods, t]); - return onChange(value as TPeriod)} />; }; export default PeriodSelector; diff --git a/apps/meteor/ee/client/omnichannel/reports/components/BarChart.tsx b/apps/meteor/ee/client/omnichannel/reports/components/BarChart.tsx index eb58b54d06bc..440459e2910e 100644 --- a/apps/meteor/ee/client/omnichannel/reports/components/BarChart.tsx +++ b/apps/meteor/ee/client/omnichannel/reports/components/BarChart.tsx @@ -142,6 +142,7 @@ export const BarChart = ({ labelSkipHeight={direction === 'vertical' ? 16 : undefined} valueScale={{ type: 'linear' }} tooltip={({ data }) => {`${data.label}: ${data.value}`}} + barAriaLabel={({ data }) => data.label} /> diff --git a/apps/meteor/ee/client/omnichannel/reports/components/ReportCard.tsx b/apps/meteor/ee/client/omnichannel/reports/components/ReportCard.tsx index b1bd9d8df90b..92a4d8d44199 100644 --- a/apps/meteor/ee/client/omnichannel/reports/components/ReportCard.tsx +++ b/apps/meteor/ee/client/omnichannel/reports/components/ReportCard.tsx @@ -11,6 +11,7 @@ import { useIsResizing } from '../hooks/useIsResizing'; import { CardErrorState } from './CardErrorState'; type ReportCardProps = { + id: string; title: string; children: ReactNode; periodSelectorProps: ComponentProps; @@ -27,6 +28,7 @@ type ReportCardProps = { }; export const ReportCard = ({ + id, title, children, periodSelectorProps, @@ -56,6 +58,8 @@ export const ReportCard = ({ flexShrink={0} flexBasis='auto' margin={8} + data-qa={id} + aria-busy={isLoading} > @@ -63,12 +67,12 @@ export const ReportCard = ({ {title} - + {subtitle} - + diff --git a/apps/meteor/ee/client/omnichannel/reports/hooks/useAgentsSection.tsx b/apps/meteor/ee/client/omnichannel/reports/hooks/useAgentsSection.tsx index b80b4cf2d20f..a6da966b3606 100644 --- a/apps/meteor/ee/client/omnichannel/reports/hooks/useAgentsSection.tsx +++ b/apps/meteor/ee/client/omnichannel/reports/hooks/useAgentsSection.tsx @@ -58,6 +58,7 @@ export const useAgentsSection = () => { return useMemo( () => ({ + id: 'conversations-by-agent', title, subtitle, emptyStateSubtitle, diff --git a/apps/meteor/ee/client/omnichannel/reports/hooks/useChannelsSection.tsx b/apps/meteor/ee/client/omnichannel/reports/hooks/useChannelsSection.tsx index c17e36fee53c..ce13de2f546e 100644 --- a/apps/meteor/ee/client/omnichannel/reports/hooks/useChannelsSection.tsx +++ b/apps/meteor/ee/client/omnichannel/reports/hooks/useChannelsSection.tsx @@ -72,6 +72,7 @@ export const useChannelsSection = () => { return useMemo( () => ({ + id: 'conversations-by-channel', title, subtitle, emptyStateSubtitle, diff --git a/apps/meteor/ee/client/omnichannel/reports/hooks/useDepartmentsSection.tsx b/apps/meteor/ee/client/omnichannel/reports/hooks/useDepartmentsSection.tsx index b9075d3721af..0e207c3d113a 100644 --- a/apps/meteor/ee/client/omnichannel/reports/hooks/useDepartmentsSection.tsx +++ b/apps/meteor/ee/client/omnichannel/reports/hooks/useDepartmentsSection.tsx @@ -24,6 +24,7 @@ export const useDepartmentsSection = () => { isLoading, isError, isSuccess, + refetch, } = useQuery( ['omnichannel-reports', 'conversations-by-department', period], async () => { @@ -50,6 +51,7 @@ export const useDepartmentsSection = () => { return useMemo( () => ({ + id: 'conversations-by-department', title, subtitle, emptyStateSubtitle, @@ -61,7 +63,8 @@ export const useDepartmentsSection = () => { periodSelectorProps, period, downloadProps, + onRetry: refetch, }), - [title, subtitle, emptyStateSubtitle, data, total, isLoading, isError, isSuccess, periodSelectorProps, period, downloadProps], + [title, subtitle, emptyStateSubtitle, data, total, isLoading, isError, isSuccess, periodSelectorProps, period, downloadProps, refetch], ); }; diff --git a/apps/meteor/ee/client/omnichannel/reports/hooks/useStatusSection.tsx b/apps/meteor/ee/client/omnichannel/reports/hooks/useStatusSection.tsx index ba1c8a1a6d54..3c725f9bc85b 100644 --- a/apps/meteor/ee/client/omnichannel/reports/hooks/useStatusSection.tsx +++ b/apps/meteor/ee/client/omnichannel/reports/hooks/useStatusSection.tsx @@ -67,6 +67,7 @@ export const useStatusSection = () => { return useMemo( () => ({ + id: 'conversations-by-status', title, subtitle, emptyStateSubtitle, diff --git a/apps/meteor/ee/client/omnichannel/reports/hooks/useTagsSection.tsx b/apps/meteor/ee/client/omnichannel/reports/hooks/useTagsSection.tsx index a1a4dd8ed7b2..5688fc24c6b5 100644 --- a/apps/meteor/ee/client/omnichannel/reports/hooks/useTagsSection.tsx +++ b/apps/meteor/ee/client/omnichannel/reports/hooks/useTagsSection.tsx @@ -59,6 +59,7 @@ export const useTagsSection = () => { return useMemo( () => ({ + id: 'conversations-by-tags', title, subtitle, emptyStateSubtitle, diff --git a/apps/meteor/tests/e2e/omnichannel/omnichannel-reports.spec.ts b/apps/meteor/tests/e2e/omnichannel/omnichannel-reports.spec.ts new file mode 100644 index 000000000000..10e4db2cfd0b --- /dev/null +++ b/apps/meteor/tests/e2e/omnichannel/omnichannel-reports.spec.ts @@ -0,0 +1,365 @@ +import { Route } from '@playwright/test'; + +import { IS_EE } from '../config/constants'; +import { Users } from '../fixtures/userStates'; +import { OmnichannelReports } from '../page-objects/omnichannel-reports'; +import { test, expect } from '../utils/test'; + +const ENDPOINTS = { + BY_STATUS: /\/v1\/livechat\/analytics\/dashboards\/conversations-by-status/, + BY_SOURCE: /\/v1\/livechat\/analytics\/dashboards\/conversations-by-source/, + BY_DEPARTMENT: /\/v1\/livechat\/analytics\/dashboards\/conversations-by-department/, + BY_TAGS: /\/v1\/livechat\/analytics\/dashboards\/conversations-by-tags/, + BY_AGENT: /\/v1\/livechat\/analytics\/dashboards\/conversations-by-agent/, +}; + +test.skip(!IS_EE, 'Omnichannel Reports > Enterprise Only'); + +test.use({ storageState: Users.user1.state }); + +test.describe.serial('Omnichannel Reports', () => { + let poReports: OmnichannelReports; + + test.beforeAll(async ({ api }) => { + const requests = await Promise.all([ + api.post('/livechat/users/agent', { username: 'user1' }), + api.post('/livechat/users/manager', { username: 'user1' }), + ]); + await expect(requests.every((request) => request.status() === 200)).toBe(true); + }); + + test.beforeEach(async ({ page }) => { + poReports = new OmnichannelReports(page); + }); + + test.beforeEach(async ({ page }) => { + await page.goto('/omnichannel/reports'); + await page.locator('.main-content').waitFor(); + }); + + test.afterAll(async ({ api }) => { + await Promise.all([api.delete('/livechat/users/agent/user1'), api.delete('/livechat/users/manager/user1')]); + }); + + test('Status Section', async ({ page }) => { + await test.step('Empty state', async () => { + await page.route(ENDPOINTS.BY_STATUS, async (route: Route) => { + await route.fulfill({ json: { data: [], total: 0 } }); + }); + + await poReports.statusSection.selectPeriod('this week'); + await expect(poReports.statusSection.txtStateTitle).toHaveText('No data available for the selected period'); + await expect(poReports.statusSection.txtStateSubtitle).toHaveText('This chart will update as soon as conversations start.'); + await expect(poReports.statusSection.txtSummary).toHaveText('0 conversations, this week'); + }); + + await test.step('Error state', async () => { + await page.route(ENDPOINTS.BY_STATUS, async (route: Route) => { + await route.abort(); + }); + + await poReports.statusSection.selectPeriod('this month'); + await expect(poReports.statusSection.element).toHaveAttribute('aria-busy', 'false'); + await expect(poReports.statusSection.btnRetry).toBeVisible(); + await expect(poReports.statusSection.txtStateTitle).toHaveText('Something went wrong'); + + await test.step('Retry', async () => { + await page.route(ENDPOINTS.BY_STATUS, async (route: Route) => { + await route.fulfill({ json: { data: [], total: 0 } }); + }); + + const responsePromise = page.waitForResponse(ENDPOINTS.BY_STATUS); + await poReports.statusSection.btnRetry.click(); + await responsePromise; + }); + }); + + await test.step('Render data', async () => { + const mock = { + data: [ + { label: 'Open', value: 25 }, + { label: 'Queued', value: 25 }, + { label: 'Closed', value: 25 }, + { label: 'On_Hold', value: 25 }, + ], + total: 100, + }; + + await page.route(ENDPOINTS.BY_STATUS, async (route: Route) => { + const response = await route.fetch(); + await route.fulfill({ response, json: mock }); + }); + + await poReports.statusSection.selectPeriod('last year'); + await expect(poReports.statusSection.legendItem(`Closed 25 (25%)`)).toBeVisible(); + await expect(poReports.statusSection.legendItem(`Open 25 (25%)`)).toBeVisible(); + await expect(poReports.statusSection.legendItem(`Queued 25 (25%)`)).toBeVisible(); + await expect(poReports.statusSection.legendItem(`On hold 25 (25%)`)).toBeVisible(); + await expect(poReports.statusSection.txtSummary).toHaveText('100 conversations, last year'); + }); + }); + + test('Channels Section', async ({ page }) => { + await test.step('Empty state', async () => { + await page.route(ENDPOINTS.BY_SOURCE, async (route: Route) => { + await route.fulfill({ json: { data: [], total: 0 } }); + }); + + await poReports.channelsSection.selectPeriod('this week'); + await expect(poReports.channelsSection.txtStateTitle).toHaveText('No data available for the selected period'); + await expect(poReports.channelsSection.txtStateSubtitle).toHaveText('This chart shows the most used channels.'); + await expect(poReports.channelsSection.txtSummary).toHaveText('0 conversations, this week'); + }); + + await test.step('Error state', async () => { + await page.route(ENDPOINTS.BY_SOURCE, async (route: Route) => { + await route.abort(); + }); + + await poReports.channelsSection.selectPeriod('last 15 days'); + await expect(poReports.channelsSection.element).toHaveAttribute('aria-busy', 'false'); + await expect(poReports.channelsSection.btnRetry).toBeVisible(); + await expect(poReports.channelsSection.txtStateTitle).toHaveText('Something went wrong'); + + await test.step('Retry', async () => { + await page.route(ENDPOINTS.BY_SOURCE, async (route: Route) => { + await route.fulfill({ json: { data: [], total: 0 } }); + }); + + const responsePromise = page.waitForResponse(ENDPOINTS.BY_SOURCE); + await poReports.channelsSection.btnRetry.click(); + await responsePromise; + }); + }); + + await test.step('Render data', async () => { + const mock = { + data: [ + { label: 'Channel 1', value: 50 }, + { label: 'Channel 2', value: 50 }, + ], + total: 100, + }; + await page.route(ENDPOINTS.BY_SOURCE, async (route: Route) => { + const response = await route.fetch(); + await route.fulfill({ response, json: mock }); + }); + + await poReports.channelsSection.selectPeriod('last year'); + await expect(poReports.channelsSection.legendItem(`Channel 1 50 (50%)`)).toBeVisible(); + await expect(poReports.channelsSection.legendItem(`Channel 2 50 (50%)`)).toBeVisible(); + await expect(poReports.channelsSection.txtSummary).toHaveText('100 conversations, last year'); + }); + + await test.step('More than 5 channels', async () => { + const mock = { + data: [ + { label: 'Channel 1', value: 15 }, + { label: 'Channel 2', value: 15 }, + { label: 'Channel 3', value: 15 }, + { label: 'Channel 4', value: 15 }, + { label: 'Channel 5', value: 15 }, + { label: 'Channel 6', value: 15 }, + { label: 'Channel 7', value: 15 }, + { label: 'Channel 8', value: 15 }, + ], + total: 120, + }; + await page.route(ENDPOINTS.BY_SOURCE, async (route: Route) => { + const response = await route.fetch(); + await route.fulfill({ response, json: mock }); + }); + + await poReports.channelsSection.selectPeriod('last 6 months'); + await expect(poReports.channelsSection.legendItem(`Others 45 (37.5%)`)).toBeVisible(); + await expect(poReports.channelsSection.txtSummary).toHaveText('120 conversations, last 6 months'); + }); + }); + + test('Departments Section', async ({ page }) => { + await test.step('Empty state', async () => { + await page.route(ENDPOINTS.BY_DEPARTMENT, async (route: Route) => { + await route.fulfill({ json: { data: [], total: 0 } }); + }); + + await poReports.departmentsSection.selectPeriod('this week'); + await expect(poReports.departmentsSection.txtStateTitle).toHaveText('No data available for the selected period'); + await expect(poReports.departmentsSection.txtStateSubtitle).toHaveText( + 'This chart displays the departments that receive the most conversations.', + ); + await expect(poReports.departmentsSection.txtSummary).toHaveText('0 departments and 0 conversations, this week'); + }); + + await test.step('Error state', async () => { + await page.route(ENDPOINTS.BY_DEPARTMENT, async (route: Route) => { + await route.abort(); + }); + + await poReports.departmentsSection.selectPeriod('this month'); + await expect(poReports.departmentsSection.element).toHaveAttribute('aria-busy', 'false'); + await expect(poReports.departmentsSection.btnRetry).toBeVisible(); + await expect(poReports.departmentsSection.txtStateTitle).toHaveText('Something went wrong'); + + await test.step('Retry', async () => { + await page.route(ENDPOINTS.BY_DEPARTMENT, async (route: Route) => { + await route.fulfill({ json: { data: [], total: 0 } }); + }); + + const responsePromise = page.waitForResponse(ENDPOINTS.BY_DEPARTMENT); + await poReports.departmentsSection.btnRetry.click(); + await responsePromise; + }); + }); + + await test.step('Render data', async () => { + const mock = { + data: [ + { label: 'Department 1', value: 10 }, + { label: 'Department 2', value: 20 }, + { label: 'Department 3', value: 30 }, + { label: 'Department 4', value: 40 }, + ], + total: 100, + unspecified: 42, + }; + await page.route(ENDPOINTS.BY_DEPARTMENT, async (route: Route) => { + const response = await route.fetch(); + await route.fulfill({ response, json: mock }); + }); + + await poReports.departmentsSection.selectPeriod('last 6 months'); + await expect(poReports.departmentsSection.chartItem('Department 1', 10)).toBeVisible(); + await expect(poReports.departmentsSection.chartItem('Department 2', 20)).toBeVisible(); + await expect(poReports.departmentsSection.chartItem('Department 3', 30)).toBeVisible(); + await expect(poReports.departmentsSection.chartItem('Department 4', 40)).toBeVisible(); + await expect(poReports.departmentsSection.txtSummary).toHaveText( + '4 departments and 100 conversations, last 6 months (42 without department)', + ); + }); + }); + + test('Tags Section', async ({ page }) => { + await test.step('Empty state', async () => { + await page.route(ENDPOINTS.BY_TAGS, async (route: Route) => { + await route.fulfill({ json: { data: [], total: 0 } }); + }); + + await poReports.tagsSection.selectPeriod('this week'); + await expect(poReports.tagsSection.txtStateTitle).toHaveText('No data available for the selected period'); + await expect(poReports.tagsSection.txtStateSubtitle).toHaveText('This chart shows the most frequently used tags.'); + await expect(poReports.tagsSection.txtSummary).toHaveText('0 tags and 0 conversations, this week'); + }); + + await test.step('Error state', async () => { + await page.route(ENDPOINTS.BY_TAGS, async (route: Route) => { + await route.abort(); + }); + + await poReports.tagsSection.selectPeriod('this month'); + await expect(poReports.tagsSection.element).toHaveAttribute('aria-busy', 'false'); + await expect(poReports.tagsSection.btnRetry).toBeVisible(); + await expect(poReports.tagsSection.txtStateTitle).toHaveText('Something went wrong'); + + await test.step('Retry', async () => { + await page.route(ENDPOINTS.BY_TAGS, async (route: Route) => { + await route.fulfill({ json: { data: [], total: 0 } }); + }); + + const responsePromise = page.waitForResponse(ENDPOINTS.BY_TAGS); + await poReports.tagsSection.btnRetry.click(); + await responsePromise; + }); + }); + + await test.step('Render data', async () => { + const mock = { + data: [ + { label: 'Tag 1', value: 10 }, + { label: 'Tag 2', value: 20 }, + { label: 'Tag 3', value: 30 }, + { label: 'Tag 4', value: 40 }, + ], + total: 100, + unspecified: 42, + }; + await page.route(ENDPOINTS.BY_TAGS, async (route: Route) => { + const response = await route.fetch(); + await route.fulfill({ response, json: mock }); + }); + + await poReports.tagsSection.selectPeriod('last 6 months'); + await expect(poReports.tagsSection.chartItem('Tag 1', 10)).toBeVisible(); + await expect(poReports.tagsSection.chartItem('Tag 2', 20)).toBeVisible(); + await expect(poReports.tagsSection.chartItem('Tag 3', 30)).toBeVisible(); + await expect(poReports.tagsSection.chartItem('Tag 4', 40)).toBeVisible(); + await expect(poReports.tagsSection.txtSummary).toHaveText('4 tags and 100 conversations, last 6 months (42 without tags)'); + }); + }); + + test('Agents Section', async ({ page }) => { + await test.step('Empty state', async () => { + await page.route(ENDPOINTS.BY_AGENT, async (route: Route) => { + await route.fulfill({ json: { data: [], total: 0 } }); + }); + + await poReports.agentsSection.selectPeriod('this week'); + await expect(poReports.agentsSection.txtStateTitle).toHaveText('No data available for the selected period'); + await expect(poReports.agentsSection.txtStateSubtitle).toHaveText( + 'This chart displays which agents receive the highest volume of conversations.', + ); + await expect(poReports.agentsSection.txtSummary).toHaveText('0 agents and 0 conversations, this week'); + }); + + await test.step('Error state', async () => { + await page.route(ENDPOINTS.BY_AGENT, async (route: Route) => { + await route.abort(); + }); + + await poReports.agentsSection.selectPeriod('this month'); + await expect(poReports.agentsSection.element).toHaveAttribute('aria-busy', 'false'); + await expect(poReports.agentsSection.btnRetry).toBeVisible(); + await expect(poReports.agentsSection.txtStateTitle).toHaveText('Something went wrong'); + + await test.step('Retry', async () => { + await page.route(ENDPOINTS.BY_AGENT, async (route: Route) => { + await route.fulfill({ json: { data: [], total: 0 } }); + }); + + const responsePromise = page.waitForResponse(ENDPOINTS.BY_AGENT); + await poReports.agentsSection.btnRetry.click(); + await responsePromise; + }); + }); + + await test.step('Render data', async () => { + const mock = { + data: [ + { label: 'Agent 1', value: 10 }, + { label: 'Agent 2', value: 20 }, + { label: 'Agent 3', value: 30 }, + { label: 'Agent 4', value: 40 }, + ], + total: 100, + unspecified: 42, + }; + await page.route(ENDPOINTS.BY_AGENT, async (route: Route) => { + const response = await route.fetch(); + await route.fulfill({ response, json: mock }); + }); + + await poReports.agentsSection.selectPeriod('last 6 months'); + + await expect(poReports.agentsSection.txtSummary).toHaveText('4 agents and 100 conversations, last 6 months (42 without assignee)'); + + await expect(poReports.agentsSection.chartItem('Agent 1', 10)).toBeVisible(); + await expect(poReports.agentsSection.chartItem('Agent 2', 20)).toBeVisible(); + await expect(poReports.agentsSection.chartItem('Agent 3', 30)).toBeVisible(); + await expect(poReports.agentsSection.chartItem('Agent 4', 40)).toBeVisible(); + + await expect(poReports.agentsSection.findRowByName('Agent 1')).toBeVisible(); + await expect(poReports.agentsSection.findRowByName('Agent 2')).toBeVisible(); + await expect(poReports.agentsSection.findRowByName('Agent 3')).toBeVisible(); + await expect(poReports.agentsSection.findRowByName('Agent 4')).toBeVisible(); + }); + }); +}); diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-reports.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-reports.ts new file mode 100644 index 000000000000..9a0db1c283e6 --- /dev/null +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-reports.ts @@ -0,0 +1,89 @@ +import type { Locator, Page } from '@playwright/test'; + +class OmnichannelReportsSection { + private readonly page: Page; + + private readonly section: Locator; + + constructor(page: Page, sectionId: string) { + this.page = page; + this.section = page.locator(`[data-qa=${sectionId}]`); + } + + get element() { + return this.section; + } + + get inputPeriodSelector() { + return this.section.locator('button', { has: this.page.locator('select[name="periodSelector"]') }); + } + + get txtTitle() { + return this.section.locator(''); + } + + get txtDescription() { + return this.section.locator(''); + } + + get chart() { + return this.section.locator(''); + } + + get txtStateTitle() { + return this.section.locator('.rcx-states__title'); + } + + get txtStateSubtitle() { + return this.section.locator('.rcx-states__subtitle'); + } + + get btnRetry() { + return this.section.locator('role=button[name="Retry"]'); + } + + get txtSummary() { + return this.section.locator('[data-qa="report-summary"]'); + } + + get loadingSkeleton() { + return this.section.locator('.rcx-skeleton'); + } + + findRowByName(name: string) { + return this.section.locator('tr', { has: this.page.locator(`td >> text="${name}"`) }); + } + + chartItem(label: string, value: number) { + return this.section.locator(`rect[aria-label="${label}"] + text >> text=${value}`); + } + + legendItem(text: string) { + return this.section.locator(`text='${text}'`); + } + + async selectPeriod(period: string) { + await this.inputPeriodSelector.click({ force: true }); + await this.page.locator(`li.rcx-option[data-key="${period}"]`).click(); + } +} + +export class OmnichannelReports { + readonly statusSection: OmnichannelReportsSection; + + readonly channelsSection: OmnichannelReportsSection; + + readonly departmentsSection: OmnichannelReportsSection; + + readonly tagsSection: OmnichannelReportsSection; + + readonly agentsSection: OmnichannelReportsSection; + + constructor(page: Page) { + this.statusSection = new OmnichannelReportsSection(page, 'conversations-by-status'); + this.channelsSection = new OmnichannelReportsSection(page, 'conversations-by-channel'); + this.departmentsSection = new OmnichannelReportsSection(page, 'conversations-by-department'); + this.tagsSection = new OmnichannelReportsSection(page, 'conversations-by-tags'); + this.agentsSection = new OmnichannelReportsSection(page, 'conversations-by-agent'); + } +} From db26f8a8ee87c843d19651db4383a81dbec8bc42 Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Fri, 1 Sep 2023 15:53:56 -0300 Subject: [PATCH 058/275] fix: Message Menu is cut vertically if screen is too small (#30197) Co-authored-by: Guilherme Jun Grillo <48109548+guijun13@users.noreply.github.com> --- .changeset/serious-shrimps-try.md | 5 ++ .../message/MessageToolboxHolder.tsx | 12 ++- .../toolbox/DesktopToolboxDropdown.tsx | 47 ++-------- .../message/toolbox/MessageActionMenu.tsx | 27 ++++-- .../message/toolbox/MessageToolbox.tsx | 10 ++- .../message/toolbox/ToolboxDropdown.tsx | 11 ++- yarn.lock | 89 ++++++++++++++----- 7 files changed, 127 insertions(+), 74 deletions(-) create mode 100644 .changeset/serious-shrimps-try.md diff --git a/.changeset/serious-shrimps-try.md b/.changeset/serious-shrimps-try.md new file mode 100644 index 000000000000..114293aa104e --- /dev/null +++ b/.changeset/serious-shrimps-try.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fixed an issue with the positioning of the message menu diff --git a/apps/meteor/client/components/message/MessageToolboxHolder.tsx b/apps/meteor/client/components/message/MessageToolboxHolder.tsx index 54f4ebab823d..06a9fbf42b77 100644 --- a/apps/meteor/client/components/message/MessageToolboxHolder.tsx +++ b/apps/meteor/client/components/message/MessageToolboxHolder.tsx @@ -2,7 +2,7 @@ import type { IMessage } from '@rocket.chat/core-typings'; import { MessageToolboxWrapper } from '@rocket.chat/fuselage'; import { useQuery } from '@tanstack/react-query'; import type { ReactElement } from 'react'; -import React, { Suspense, lazy, memo, useRef } from 'react'; +import React, { Suspense, lazy, memo, useRef, useState } from 'react'; import type { MessageActionContext } from '../../../app/ui-utils/client/lib/MessageAction'; import { useChat } from '../../views/room/contexts/ChatContext'; @@ -18,7 +18,10 @@ const MessageToolbox = lazy(() => import('./toolbox/MessageToolbox')); const MessageToolboxHolder = ({ message, context }: MessageToolboxHolderProps): ReactElement => { const ref = useRef(null); - const [visible] = useIsVisible(ref); + const [isVisible] = useIsVisible(ref); + const [kebabOpen, setKebabOpen] = useState(false); + + const showToolbox = isVisible || kebabOpen; const chat = useChat(); @@ -32,10 +35,11 @@ const MessageToolboxHolder = ({ message, context }: MessageToolboxHolderProps): }); return ( - - {visible && depsQueryResult.isSuccess && depsQueryResult.data.room && ( + + {showToolbox && depsQueryResult.isSuccess && depsQueryResult.data.room && ( { - for (let element = descendant ?? document.body; element !== document.body; element = element.parentElement ?? document.body) { - if ( - getComputedStyle(element).transform !== 'none' || - getComputedStyle(element).position === 'fixed' || - getComputedStyle(element).willChange === 'transform' - ) { - return element; - } - } - - return document.body; -}; - -const useDropdownPosition = (reference: RefObject, target: RefObject) => { - const innerContainer = getDropdownContainer(reference.current); - const boundingRect = innerContainer.getBoundingClientRect(); - - const { style } = usePosition(reference, target, { - placement: 'bottom-end', - container: innerContainer, - }); - - const left = `${parseFloat(String(style?.left ?? '0')) - boundingRect.left}px`; - const top = `${parseFloat(String(style?.top ?? '0')) - boundingRect.top}px`; - - return useMemo(() => ({ ...style, left, top }), [style, left, top]); -}; +import React, { forwardRef } from 'react'; type DesktopToolboxDropdownProps = { children: ReactNode; @@ -41,15 +11,12 @@ const DesktopToolboxDropdown = forwardRef(function ToolboxDropdownDesktop( { reference, children }: DesktopToolboxDropdownProps, ref: Ref, ) { - const targetRef = useRef(null); - const mergedRef = useMergedRefs(ref, targetRef); - - const style = useDropdownPosition(reference, targetRef); - return ( - - {children} - + + + {children} + + ); }); diff --git a/apps/meteor/client/components/message/toolbox/MessageActionMenu.tsx b/apps/meteor/client/components/message/toolbox/MessageActionMenu.tsx index 3d1796083112..4c5d442652f2 100644 --- a/apps/meteor/client/components/message/toolbox/MessageActionMenu.tsx +++ b/apps/meteor/client/components/message/toolbox/MessageActionMenu.tsx @@ -1,7 +1,7 @@ -import { Box, MessageToolboxItem, Option, OptionDivider, OptionTitle } from '@rocket.chat/fuselage'; +import { MessageToolboxItem, Option, OptionDivider, OptionTitle } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ComponentProps, MouseEvent, MouseEventHandler, ReactElement } from 'react'; -import React, { Fragment, useRef, useState } from 'react'; +import React, { Fragment, useCallback, useRef, useState } from 'react'; import type { MessageActionConfig } from '../../../../app/ui-utils/client/lib/MessageAction'; import { useEmbeddedLayout } from '../../../hooks/useEmbeddedLayout'; @@ -12,6 +12,7 @@ type MessageActionConfigOption = Omit void; options: MessageActionConfigOption[]; }; @@ -32,12 +33,20 @@ const getSectionOrder = (section: string): number => { } }; -const MessageActionMenu = ({ options, ...props }: MessageActionMenuProps): ReactElement => { - const ref = useRef(null); +const MessageActionMenu = ({ options, onChangeMenuVisibility, ...props }: MessageActionMenuProps): ReactElement => { + const buttonRef = useRef(null); const t = useTranslation(); const [visible, setVisible] = useState(false); const isLayoutEmbedded = useEmbeddedLayout(); + const handleChangeMenuVisibility = useCallback( + (visible: boolean): void => { + setVisible(visible); + onChangeMenuVisibility(visible); + }, + [onChangeMenuVisibility], + ); + const groupOptions = options.reduce((acc, option) => { const { type = '' } = option; @@ -62,20 +71,22 @@ const MessageActionMenu = ({ options, ...props }: MessageActionMenuProps): React return acc; }, [] as unknown as [section: string, options: Array][]); + const handleClose = useCallback(() => { + handleChangeMenuVisibility(false); + }, [handleChangeMenuVisibility]); return ( <> setVisible(!visible)} + onClick={(): void => handleChangeMenuVisibility(!visible)} data-qa-id='menu' data-qa-type='message-action-menu' title={t('More')} /> {visible && ( <> - setVisible(!visible)} /> - + {groupOptions.map(([section, options], index, arr) => ( {section === 'apps' && Apps} diff --git a/apps/meteor/client/components/message/toolbox/MessageToolbox.tsx b/apps/meteor/client/components/message/toolbox/MessageToolbox.tsx index 82775fe0cc53..3b9cdd84c25d 100644 --- a/apps/meteor/client/components/message/toolbox/MessageToolbox.tsx +++ b/apps/meteor/client/components/message/toolbox/MessageToolbox.tsx @@ -43,9 +43,16 @@ type MessageToolboxProps = { messageContext?: MessageActionContext; room: IRoom; subscription?: ISubscription; + onChangeMenuVisibility: (visible: boolean) => void; }; -const MessageToolbox = ({ message, messageContext, room, subscription }: MessageToolboxProps): ReactElement | null => { +const MessageToolbox = ({ + message, + messageContext, + room, + subscription, + onChangeMenuVisibility, +}: MessageToolboxProps): ReactElement | null => { const t = useTranslation(); const user = useUser() ?? undefined; const settings = useSettings(); @@ -109,6 +116,7 @@ const MessageToolbox = ({ message, messageContext, room, subscription }: Message ))} {actionsQueryResult.isSuccess && actionsQueryResult.data.menu.length > 0 && ( ({ ...action, action: (e): void => action.action(e, { message, tabbar: toolbox, room, chat, autoTranslateOptions }), diff --git a/apps/meteor/client/components/message/toolbox/ToolboxDropdown.tsx b/apps/meteor/client/components/message/toolbox/ToolboxDropdown.tsx index 7347245f3efb..eee619454f77 100644 --- a/apps/meteor/client/components/message/toolbox/ToolboxDropdown.tsx +++ b/apps/meteor/client/components/message/toolbox/ToolboxDropdown.tsx @@ -1,3 +1,5 @@ +import { Box } from '@rocket.chat/fuselage'; +import { useOutsideClick } from '@rocket.chat/fuselage-hooks'; import { useLayout } from '@rocket.chat/ui-contexts'; import type { ReactNode, ReactElement } from 'react'; import React, { useRef } from 'react'; @@ -8,20 +10,27 @@ import MobileToolboxDropdown from './MobileToolboxDropdown'; type ToolboxDropdownProps = { children: ReactNode; reference: React.RefObject; + handleClose: () => void; }; const ToolboxDropdown = ({ children, + handleClose, reference, }: ToolboxDropdownProps): ReactElement => { const { isMobile } = useLayout(); const target = useRef(null); + const boxRef = useRef(null); const Dropdown = isMobile ? MobileToolboxDropdown : DesktopToolboxDropdown; + useOutsideClick([boxRef], handleClose); + return ( - {children} + + {children} + ); }; diff --git a/yarn.lock b/yarn.lock index 5e42faea4480..092691ec4014 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7917,6 +7917,19 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/css-in-js@npm:~0.31.26-dev.18": + version: 0.31.26-dev.18 + resolution: "@rocket.chat/css-in-js@npm:0.31.26-dev.18" + dependencies: + "@emotion/hash": ^0.9.0 + "@rocket.chat/css-supports": ~0.31.26-dev.18 + "@rocket.chat/memo": ~0.31.26-dev.18 + "@rocket.chat/stylis-logical-props-middleware": ~0.31.26-dev.18 + stylis: ~4.1.3 + checksum: 1b4190a2463a0fb9e60c588383951d10aa0d7b501855dd6340ffcc6f1af116c93b3370e9acf03724151a59a53c6f5a111678a3454b23e8fed04a1843ebb31331 + languageName: node + linkType: hard + "@rocket.chat/css-in-js@npm:~0.31.26-dev.7": version: 0.31.26-dev.7 resolution: "@rocket.chat/css-in-js@npm:0.31.26-dev.7" @@ -7930,6 +7943,15 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/css-supports@npm:~0.31.26-dev.18": + version: 0.31.26-dev.18 + resolution: "@rocket.chat/css-supports@npm:0.31.26-dev.18" + dependencies: + "@rocket.chat/memo": ~0.31.26-dev.18 + checksum: 08fe45007b8edaa7a0baedfec0434dab51aa240e20c01f6762906b0841d7871aa5b9a1d91abb0dd0fcf7779b93067d6e6a67f31a59759bf178067c1d660670a2 + languageName: node + linkType: hard + "@rocket.chat/css-supports@npm:~0.31.26-dev.7": version: 0.31.26-dev.7 resolution: "@rocket.chat/css-supports@npm:0.31.26-dev.7" @@ -8151,10 +8173,10 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/fuselage-tokens@npm:~0.32.0-dev.367": - version: 0.32.0-dev.367 - resolution: "@rocket.chat/fuselage-tokens@npm:0.32.0-dev.367" - checksum: ae3781d7220a45ba813f78ba7d08dec9e333204808f6c93d41d7197e44f031496706dec78249001021ff1af300169e5440924b3dba419fae45bccbbc683fec02 +"@rocket.chat/fuselage-tokens@npm:~0.32.0-dev.378": + version: 0.32.0-dev.378 + resolution: "@rocket.chat/fuselage-tokens@npm:0.32.0-dev.378" + checksum: 2db23b7c013c3a1c290f0a663305dd9d3db4a8bd49b22fde8d17abf411c673f22147599d427595731380021649e125d410dc15e9b6e384530238688240630a64 languageName: node linkType: hard @@ -8204,9 +8226,9 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.2 + "@rocket.chat/ui-contexts": 1.0.3 "@rocket.chat/ui-kit": "*" - "@rocket.chat/ui-video-conf": 1.0.2 + "@rocket.chat/ui-video-conf": 1.0.3 "@tanstack/react-query": "*" react: "*" react-dom: "*" @@ -8214,14 +8236,14 @@ __metadata: linkType: soft "@rocket.chat/fuselage@npm:next": - version: 0.32.0-dev.417 - resolution: "@rocket.chat/fuselage@npm:0.32.0-dev.417" - dependencies: - "@rocket.chat/css-in-js": ~0.31.26-dev.7 - "@rocket.chat/css-supports": ~0.31.26-dev.7 - "@rocket.chat/fuselage-tokens": ~0.32.0-dev.367 - "@rocket.chat/memo": ~0.31.26-dev.7 - "@rocket.chat/styled": ~0.31.26-dev.7 + version: 0.32.0-dev.428 + resolution: "@rocket.chat/fuselage@npm:0.32.0-dev.428" + dependencies: + "@rocket.chat/css-in-js": ~0.31.26-dev.18 + "@rocket.chat/css-supports": ~0.31.26-dev.18 + "@rocket.chat/fuselage-tokens": ~0.32.0-dev.378 + "@rocket.chat/memo": ~0.31.26-dev.18 + "@rocket.chat/styled": ~0.31.26-dev.18 invariant: ^2.2.4 react-aria: ~3.23.1 react-keyed-flatten-children: ^1.3.0 @@ -8233,7 +8255,7 @@ __metadata: react: ^17.0.2 react-dom: ^17.0.2 react-virtuoso: 1.2.4 - checksum: 5b94df847d0714bf96ac09277d62178345a4ccee2f50e87985bebd9ed366da7950643315870a2c1f92732f0f06728219ebbd4d9ce0fe24434e3bf84da8e7f0f3 + checksum: 7f39b64138d77fb9956f821f0a3c638fee38d1f66f1cf243983eed7683ca442096b76ec09bf282fe6f9caf4c6fbab0b38b3fe6310f0fcbc9afd1f09d39f95cf3 languageName: node linkType: hard @@ -8288,7 +8310,7 @@ __metadata: ts-jest: ~29.0.5 typescript: ~5.2.2 peerDependencies: - "@rocket.chat/core-typings": 6.3.2 + "@rocket.chat/core-typings": 6.3.3 "@rocket.chat/css-in-js": "*" "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-tokens": "*" @@ -8491,6 +8513,13 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/memo@npm:~0.31.26-dev.18": + version: 0.31.26-dev.18 + resolution: "@rocket.chat/memo@npm:0.31.26-dev.18" + checksum: c3006dc08e1f3e5e1ac95cc23f52a4d5445971c5dbb985023128a7e4f8e929913a5103d4c4b7fdbd2848b1982a32440dc64f3894caaa293c774232160fbe4b71 + languageName: node + linkType: hard + "@rocket.chat/memo@npm:~0.31.26-dev.7": version: 0.31.26-dev.7 resolution: "@rocket.chat/memo@npm:0.31.26-dev.7" @@ -9329,7 +9358,16 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/styled@npm:~0.31.26-dev.2, @rocket.chat/styled@npm:~0.31.26-dev.7": +"@rocket.chat/styled@npm:~0.31.26-dev.18": + version: 0.31.26-dev.18 + resolution: "@rocket.chat/styled@npm:0.31.26-dev.18" + dependencies: + "@rocket.chat/css-in-js": ~0.31.26-dev.18 + checksum: 54ede68d3ab24aa0a685bc55148e52a7e17e394d5f16f7114df64633733ca3c9fd39ba30036065ca16636cff6ef9c045a2a82024c0597d9864e77d49e1e56636 + languageName: node + linkType: hard + +"@rocket.chat/styled@npm:~0.31.26-dev.2": version: 0.31.26-dev.7 resolution: "@rocket.chat/styled@npm:0.31.26-dev.7" dependencies: @@ -9338,6 +9376,17 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/stylis-logical-props-middleware@npm:~0.31.26-dev.18": + version: 0.31.26-dev.18 + resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.26-dev.18" + dependencies: + "@rocket.chat/css-supports": ~0.31.26-dev.18 + peerDependencies: + stylis: 4.0.10 + checksum: 5dd4b4d242d568549c6f2dfd8c0ef85d605176b05214d85f3bbd48f648836a287a404d8e44647e383400232f599e80ba34da377af9d960f452f8716489f862f6 + languageName: node + linkType: hard + "@rocket.chat/stylis-logical-props-middleware@npm:~0.31.26-dev.7": version: 0.31.26-dev.7 resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.26-dev.7" @@ -9408,7 +9457,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 1.0.2 + "@rocket.chat/ui-contexts": 1.0.3 react: ~17.0.2 languageName: unknown linkType: soft @@ -9562,7 +9611,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.2 + "@rocket.chat/ui-contexts": 1.0.3 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -9646,7 +9695,7 @@ __metadata: typescript: ~5.2.2 peerDependencies: "@rocket.chat/layout": "*" - "@rocket.chat/ui-contexts": 1.0.2 + "@rocket.chat/ui-contexts": 1.0.3 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From a09a125af82a96db2cc92b8a8e1ea3f94c4668ef Mon Sep 17 00:00:00 2001 From: Tiago Evangelista Pinto Date: Fri, 1 Sep 2023 17:09:55 -0300 Subject: [PATCH 059/275] fix (#30253) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- packages/fuselage-ui-kit/src/blocks/CalloutBlock.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/fuselage-ui-kit/src/blocks/CalloutBlock.tsx b/packages/fuselage-ui-kit/src/blocks/CalloutBlock.tsx index 89ffd0d9269a..91ef7f32da43 100644 --- a/packages/fuselage-ui-kit/src/blocks/CalloutBlock.tsx +++ b/packages/fuselage-ui-kit/src/blocks/CalloutBlock.tsx @@ -11,7 +11,7 @@ const CalloutBlock = ({ surfaceRenderer, }: CalloutBlockProps): ReactElement => { return ( - + {surfaceRenderer.renderTextObject(block.text, 0, UiKit.BlockContext.NONE)} ); From 51b988b3df346a9a02058cefa6f5d235bcb680c2 Mon Sep 17 00:00:00 2001 From: Rafael Tapia Date: Fri, 1 Sep 2023 18:39:55 -0300 Subject: [PATCH 060/275] fix: importer filter not working (#30232) --- .changeset/red-zebras-clap.md | 5 +++++ .../app/importer/server/classes/ImportDataConverter.ts | 2 -- apps/meteor/app/importer/server/classes/ImporterBase.js | 7 +++++-- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .changeset/red-zebras-clap.md diff --git a/.changeset/red-zebras-clap.md b/.changeset/red-zebras-clap.md new file mode 100644 index 000000000000..cd8f832b1835 --- /dev/null +++ b/.changeset/red-zebras-clap.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fix importer filters not working diff --git a/apps/meteor/app/importer/server/classes/ImportDataConverter.ts b/apps/meteor/app/importer/server/classes/ImportDataConverter.ts index dea6bbb845d1..f241879cdc67 100644 --- a/apps/meteor/app/importer/server/classes/ImportDataConverter.ts +++ b/apps/meteor/app/importer/server/classes/ImportDataConverter.ts @@ -445,8 +445,6 @@ export class ImportDataConverter { public async convertUsers({ beforeImportFn, afterImportFn, onErrorFn, afterBatchFn }: IConversionCallbacks = {}): Promise { const users = (await this.getUsersToImport()) as IImportUserRecord[]; - await callbacks.run('beforeUserImport', { userCount: users.length }); - const insertedIds = new Set(); const updatedIds = new Set(); let skippedCount = 0; diff --git a/apps/meteor/app/importer/server/classes/ImporterBase.js b/apps/meteor/app/importer/server/classes/ImporterBase.js index 47b5c91cd3dc..061644130a66 100644 --- a/apps/meteor/app/importer/server/classes/ImporterBase.js +++ b/apps/meteor/app/importer/server/classes/ImporterBase.js @@ -3,6 +3,7 @@ import { Settings, ImportData, Imports } from '@rocket.chat/models'; import AdmZip from 'adm-zip'; import { Selection, SelectionChannel, SelectionUser } from '..'; +import { callbacks } from '../../../../lib/callbacks'; import { t } from '../../../utils/lib/i18n'; import { ImporterInfo } from '../../lib/ImporterInfo'; import { ProgressStep, ImportPreparingStartedStates } from '../../lib/ImporterProgressStep'; @@ -96,7 +97,7 @@ export class Base { this.reloadCount(); const started = Date.now(); - const beforeImportFn = async (data, type) => { + const beforeImportFn = async ({ data, dataType: type }) => { if (this.importRecord.valid === false) { this.converter.aborted = true; throw new Error('The import operation is no longer valid.'); @@ -130,7 +131,7 @@ export class Base { } } - return true; + return false; }; const afterImportFn = async () => { @@ -167,6 +168,8 @@ export class Base { await this.applySettingValues({}); await this.updateProgress(ProgressStep.IMPORTING_USERS); + const usersToImport = importSelection.users.filter((user) => user.do_import); + await callbacks.run('beforeUserImport', { userCount: usersToImport.length }); await this.converter.convertUsers({ beforeImportFn, afterImportFn, onErrorFn, afterBatchFn }); await this.updateProgress(ProgressStep.IMPORTING_CHANNELS); From a3e6e7ab19c39d6b85e7d4e089a93b4e9814a611 Mon Sep 17 00:00:00 2001 From: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com> Date: Fri, 1 Sep 2023 19:22:52 -0300 Subject: [PATCH 061/275] test: Avoid flakiness in failed login attempts end-to-end tests (#30233) --- .../meteor/tests/end-to-end/api/31-failed-login-attempts.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/meteor/tests/end-to-end/api/31-failed-login-attempts.ts b/apps/meteor/tests/end-to-end/api/31-failed-login-attempts.ts index 3e6c664c8d8f..92ea1ac56ed3 100644 --- a/apps/meteor/tests/end-to-end/api/31-failed-login-attempts.ts +++ b/apps/meteor/tests/end-to-end/api/31-failed-login-attempts.ts @@ -10,8 +10,8 @@ import { createUser, deleteUser } from '../../data/users.helper'; describe('[Failed Login Attempts]', function () { this.retries(0); - const maxAttemptsByUser = 3; - const maxAttemptsByIp = 6; + const maxAttemptsByUser = 2; + const maxAttemptsByIp = 4; const userBlockSeconds = 3; const ipBlockSeconds = 8; @@ -115,7 +115,7 @@ describe('[Failed Login Attempts]', function () { await deleteUser(user); }); - it('should block by IP when the limit amount of failed attempts is reached', async () => { + it('should block by User when the limit amount of failed attempts is reached', async () => { await failMaxAttempts(user.username, `${password}-incorrect`); await shouldBlockLogin(user.username, password, 'user'); From e23ff448857ad1dc9a354b529dcbaa7e9c9b74ca Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Sat, 2 Sep 2023 00:55:52 -0300 Subject: [PATCH 062/275] chore: removed force click to prevent flaky test (#30257) --- apps/meteor/tests/e2e/page-objects/omnichannel-reports.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-reports.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-reports.ts index 9a0db1c283e6..b4a9b81d35b5 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-reports.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-reports.ts @@ -63,7 +63,7 @@ class OmnichannelReportsSection { } async selectPeriod(period: string) { - await this.inputPeriodSelector.click({ force: true }); + await this.inputPeriodSelector.click(); await this.page.locator(`li.rcx-option[data-key="${period}"]`).click(); } } From 9cd1649aa7f08f47293f3acc00b531af250e43ed Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Sat, 2 Sep 2023 00:56:24 -0300 Subject: [PATCH 063/275] chore: Improve form fields on `CreateChannelModal` (#30203) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../UserAutoCompleteMultipleFederated.tsx | 9 +- .../CreateChannel/CreateChannelModal.tsx | 136 ++++++++++++------ .../tests/e2e/channel-management.spec.ts | 2 +- apps/meteor/tests/e2e/create-channel.spec.ts | 2 +- .../page-objects/fragments/home-sidenav.ts | 2 +- 5 files changed, 98 insertions(+), 53 deletions(-) diff --git a/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultipleFederated.tsx b/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultipleFederated.tsx index 7ee1078c859d..457593e2c5db 100644 --- a/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultipleFederated.tsx +++ b/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultipleFederated.tsx @@ -2,7 +2,7 @@ import { MultiSelectFiltered, Icon, Box, Chip } from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; import { useEndpoint } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; -import type { ReactElement } from 'react'; +import type { ReactElement, AllHTMLAttributes } from 'react'; import React, { memo, useState, useCallback, useMemo } from 'react'; import UserAvatar from '../avatar/UserAvatar'; @@ -12,7 +12,7 @@ type UserAutoCompleteMultipleFederatedProps = { onChange: (value: Array) => void; value: Array; placeholder?: string; -}; +} & Omit, 'is' | 'onChange'>; type UserAutoCompleteOptionType = { name: string; @@ -93,17 +93,18 @@ const UserAutoCompleteMultipleFederated = ({ return ( void }): ReactElement => { + renderSelected={({ value, onMouseDown }: { value: string; onMouseDown: () => void }) => { const currentCachedOption = selectedCache[value] || {}; return ( - + {currentCachedOption._federated ? : } {currentCachedOption.name || currentCachedOption.username || value} diff --git a/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx b/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx index 18023df3e39f..57ebffdbcf39 100644 --- a/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx +++ b/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx @@ -1,4 +1,5 @@ import { Box, Modal, Button, TextInput, Icon, Field, ToggleSwitch, FieldGroup } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useSetting, @@ -48,18 +49,20 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): const e2eEnabled = useSetting('E2E_Enable'); const namesValidation = useSetting('UTF8_Channel_Names_Validation'); const allowSpecialNames = useSetting('UI_Allow_room_names_with_special_chars'); - const federationEnabled = useSetting('Federation_Matrix_enabled'); - const channelNameExists = useEndpoint('GET', '/v1/rooms.nameExists'); + const federationEnabled = useSetting('Federation_Matrix_enabled') || false; + const e2eEnabledForPrivateByDefault = useSetting('E2E_Enabled_Default_PrivateRooms'); + + const canCreateChannel = usePermission('create-c'); + const canCreatePrivateChannel = usePermission('create-p'); const channelNameRegex = useMemo(() => new RegExp(`^${namesValidation}$`), [namesValidation]); const federatedModule = useHasLicenseModule('federation'); const canUseFederation = federatedModule !== 'loading' && federatedModule && federationEnabled; + const channelNameExists = useEndpoint('GET', '/v1/rooms.nameExists'); const createChannel = useEndpoint('POST', '/v1/channels.create'); const createPrivateChannel = useEndpoint('POST', '/v1/groups.create'); - const canCreateChannel = usePermission('create-c'); - const canCreatePrivateChannel = usePermission('create-p'); - const e2eEnabledForPrivateByDefault = useSetting('E2E_Enabled_Default_PrivateRooms'); + const dispatchToastMessage = useToastMessageDispatch(); const canOnlyCreateOneType = useMemo(() => { @@ -74,12 +77,13 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): const { register, - formState: { isDirty, errors }, + formState: { errors }, handleSubmit, control, setValue, watch, } = useForm({ + mode: 'onBlur', defaultValues: { members: [], name: '', @@ -165,22 +169,37 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): [e2eEnabled, e2eEnabledForPrivateByDefault, broadcast, isPrivate], ); + const createChannelFormId = useUniqueId(); + const nameId = useUniqueId(); + const topicId = useUniqueId(); + const privateId = useUniqueId(); + const federatedId = useUniqueId(); + const readOnlyId = useUniqueId(); + const encryptedId = useUniqueId(); + const broadcastId = useUniqueId(); + const addMembersId = useUniqueId(); + return ( ) => } + aria-labelledby={`${createChannelFormId}-title`} + wrapperFunction={(props: ComponentProps) => ( + + )} > - {t('Create_channel')} - + {t('Create_channel')} + - {t('Name')} + + {t('Channel_name')} + } - placeholder={t('Channel_name')} + aria-invalid={errors.name ? 'true' : 'false'} + aria-describedby={`${nameId}-error`} + aria-required='true' /> - {errors.name && {errors.name.message}} + {errors.name && ( + + {errors.name.message} + + )} - - {t('Topic')}{' '} - - ({t('optional')}) - - + {t('Topic')} - + + {t('Channel_what_is_this_channel_about')} - {t('Private')} - + {t('Private')} + {isPrivate ? t('Only_invited_users_can_acess_this_channel') : t('Everyone_can_access_this_channel')} - + ( - + )} /> @@ -224,14 +252,21 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): - {t('Federation_Matrix_Federated')} - {t(getFederationHintKey(federatedModule, Boolean(federationEnabled)))} + {t('Federation_Matrix_Federated')} + {t(getFederationHintKey(federatedModule, federationEnabled))} ( - + )} /> @@ -239,16 +274,23 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): - {t('Read_only')} - + {t('Read_only')} + {readOnly ? t('Only_authorized_users_can_write_new_messages') : t('All_users_in_the_channel_can_write_new_messages')} - + ( - + )} /> @@ -256,8 +298,8 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): - {t('Encrypted')} - + {t('Encrypted')} + {isPrivate ? t('Encrypted_channel_Description') : t('Encrypted_not_available')} @@ -266,11 +308,12 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): name='encrypted' render={({ field: { onChange, value, ref } }): ReactElement => ( )} @@ -280,40 +323,41 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): - {t('Broadcast')} - {t('Broadcast_channel_Description')} + {t('Broadcast')} + {t('Broadcast_channel_Description')} ( - + )} /> - - {t('Add_members')}{' '} - - ({t('optional')}) - - + {t('Add_members')} ( - + )} /> - - diff --git a/apps/meteor/tests/e2e/channel-management.spec.ts b/apps/meteor/tests/e2e/channel-management.spec.ts index 8e92fba9ea49..7c1533282519 100644 --- a/apps/meteor/tests/e2e/channel-management.spec.ts +++ b/apps/meteor/tests/e2e/channel-management.spec.ts @@ -123,7 +123,7 @@ test.describe.serial('channel-management', () => { await poHomeChannel.sidenav.btnCreate.click(); await regularUserPage.goto(`/channel/${channelName}`); - await expect(regularUserPage.locator('button', { hasText: 'Join' })).toBeVisible(); + await expect(regularUserPage.locator('button >> text="Join"')).toBeVisible(); }); test.skip('expect all notification preferences of "targetChannel" to be "Mentions"', async () => { diff --git a/apps/meteor/tests/e2e/create-channel.spec.ts b/apps/meteor/tests/e2e/create-channel.spec.ts index 8a66ff6b9935..1feb819f8440 100644 --- a/apps/meteor/tests/e2e/create-channel.spec.ts +++ b/apps/meteor/tests/e2e/create-channel.spec.ts @@ -19,8 +19,8 @@ test.describe.serial('channel-management', () => { const channelName = faker.string.uuid(); await poHomeChannel.sidenav.openNewByLabel('Channel'); - await poHomeChannel.sidenav.checkboxPrivateChannel.click(); await poHomeChannel.sidenav.inputChannelName.type(channelName); + await poHomeChannel.sidenav.checkboxPrivateChannel.click(); await poHomeChannel.sidenav.btnCreate.click(); await expect(page).toHaveURL(`/channel/${channelName}`); diff --git a/apps/meteor/tests/e2e/page-objects/fragments/home-sidenav.ts b/apps/meteor/tests/e2e/page-objects/fragments/home-sidenav.ts index 314f4baadb55..5e5e3f93bfb6 100644 --- a/apps/meteor/tests/e2e/page-objects/fragments/home-sidenav.ts +++ b/apps/meteor/tests/e2e/page-objects/fragments/home-sidenav.ts @@ -14,7 +14,7 @@ export class HomeSidenav { } get checkboxEncryption(): Locator { - return this.page.locator('role=dialog[name="Create Channel"] >> role=checkbox[name="Encrypted"]').locator('..'); + return this.page.locator('role=dialog[name="Create Channel"] >> label >> text="Encrypted"'); } get checkboxReadOnly(): Locator { From 7dffec2e2fe536bb04f8c58bcab789d0b58e32cb Mon Sep 17 00:00:00 2001 From: csuadev <72958726+csuadev@users.noreply.github.com> Date: Mon, 4 Sep 2023 14:13:33 -0500 Subject: [PATCH 064/275] chore: Add danger variant to apps action button menus (#30214) --- .changeset/honest-glasses-roll.md | 5 +++++ apps/meteor/client/hooks/useAppActionButtons.ts | 1 + .../client/views/room/contexts/RoomToolboxContext.ts | 1 + .../views/room/providers/hooks/useAppsRoomActions.ts | 1 + apps/meteor/package.json | 2 +- yarn.lock | 10 +++++----- 6 files changed, 14 insertions(+), 6 deletions(-) create mode 100644 .changeset/honest-glasses-roll.md diff --git a/.changeset/honest-glasses-roll.md b/.changeset/honest-glasses-roll.md new file mode 100644 index 000000000000..679f46fb8420 --- /dev/null +++ b/.changeset/honest-glasses-roll.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +chore: Add danger variant to apps action button menus diff --git a/apps/meteor/client/hooks/useAppActionButtons.ts b/apps/meteor/client/hooks/useAppActionButtons.ts index 8895535f9c26..28d62ef1b75a 100644 --- a/apps/meteor/client/hooks/useAppActionButtons.ts +++ b/apps/meteor/client/hooks/useAppActionButtons.ts @@ -146,6 +146,7 @@ export const useMessageActionAppsActionButtons = (context?: MessageActionContext label: Utilities.getI18nKeyForApp(action.labelI18n, action.appId), order: 7, type: 'apps', + variant: action.variant, action: (_, params) => { void actionManager.triggerActionButtonAction({ rid: params.message.rid, diff --git a/apps/meteor/client/views/room/contexts/RoomToolboxContext.ts b/apps/meteor/client/views/room/contexts/RoomToolboxContext.ts index fbf4fe5e7764..7f58eec3aa4c 100644 --- a/apps/meteor/client/views/room/contexts/RoomToolboxContext.ts +++ b/apps/meteor/client/views/room/contexts/RoomToolboxContext.ts @@ -28,6 +28,7 @@ export type RoomToolboxActionConfig = { onClickBack?: () => void; }>; type?: 'organization' | 'communication' | 'customization' | 'apps'; + variant?: 'danger'; }; export type RoomToolboxContextValue = { diff --git a/apps/meteor/client/views/room/providers/hooks/useAppsRoomActions.ts b/apps/meteor/client/views/room/providers/hooks/useAppsRoomActions.ts index e20f1465e2dc..935da2a23c46 100644 --- a/apps/meteor/client/views/room/providers/hooks/useAppsRoomActions.ts +++ b/apps/meteor/client/views/room/providers/hooks/useAppsRoomActions.ts @@ -19,6 +19,7 @@ export const useAppsRoomActions = () => { (action): RoomToolboxActionConfig => ({ id: action.actionId, icon: undefined, + variant: action.variant, order: 300, title: Utilities.getI18nKeyForApp(action.labelI18n, action.appId), groups: ['group', 'channel', 'live', 'team', 'direct', 'direct_multiple'], diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 17ca54920e7b..427ad86ddca3 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -225,7 +225,7 @@ "@rocket.chat/account-utils": "workspace:^", "@rocket.chat/agenda": "workspace:^", "@rocket.chat/api-client": "workspace:^", - "@rocket.chat/apps-engine": "1.41.0-alpha.305", + "@rocket.chat/apps-engine": "1.41.0-alpha.312", "@rocket.chat/base64": "workspace:^", "@rocket.chat/cas-validate": "workspace:^", "@rocket.chat/core-services": "workspace:^", diff --git a/yarn.lock b/yarn.lock index 092691ec4014..d14adeed87af 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7763,9 +7763,9 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/apps-engine@npm:1.41.0-alpha.305": - version: 1.41.0-alpha.305 - resolution: "@rocket.chat/apps-engine@npm:1.41.0-alpha.305" +"@rocket.chat/apps-engine@npm:1.41.0-alpha.312": + version: 1.41.0-alpha.312 + resolution: "@rocket.chat/apps-engine@npm:1.41.0-alpha.312" dependencies: adm-zip: ^0.5.9 cryptiles: ^4.1.3 @@ -7777,7 +7777,7 @@ __metadata: vm2: ^3.9.19 peerDependencies: "@rocket.chat/ui-kit": "*" - checksum: 83ec73dac6e1f25722080cf32143ada914c4adb9aef8ebf770af13a5456cef1c81d1a9eedc4063549b8105277f2254d6c307c3c0c5f6ed7f99233a2d464bf6da + checksum: 003853d3c4d4374ab984474026e4ae657daf4591fe4c375b914aa57c27f576af0fcba66e70c539e056b5d80a1ef655775f6f3a07bf81a36ab6fd438ce464e70f languageName: node linkType: hard @@ -8564,7 +8564,7 @@ __metadata: "@rocket.chat/account-utils": "workspace:^" "@rocket.chat/agenda": "workspace:^" "@rocket.chat/api-client": "workspace:^" - "@rocket.chat/apps-engine": 1.41.0-alpha.305 + "@rocket.chat/apps-engine": 1.41.0-alpha.312 "@rocket.chat/base64": "workspace:^" "@rocket.chat/cas-validate": "workspace:^" "@rocket.chat/core-services": "workspace:^" From 42644a6e4451728226b11e376898cf1e922d4b92 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Mon, 4 Sep 2023 13:33:57 -0600 Subject: [PATCH 065/275] fix: Prevent `RoomProvider.useEffect` from subscribing multiple times (#30273) --- .changeset/forty-hotels-pretend.md | 5 +++++ .../views/room/providers/RoomProvider.tsx | 22 ++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 .changeset/forty-hotels-pretend.md diff --git a/.changeset/forty-hotels-pretend.md b/.changeset/forty-hotels-pretend.md new file mode 100644 index 000000000000..b23825d5a02a --- /dev/null +++ b/.changeset/forty-hotels-pretend.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fix: Prevent `RoomProvider.useEffect` from subscribing to room-data stream multiple times diff --git a/apps/meteor/client/views/room/providers/RoomProvider.tsx b/apps/meteor/client/views/room/providers/RoomProvider.tsx index a0be7bf64f39..e19fa8136f59 100644 --- a/apps/meteor/client/views/room/providers/RoomProvider.tsx +++ b/apps/meteor/client/views/room/providers/RoomProvider.tsx @@ -1,5 +1,4 @@ import type { IRoom } from '@rocket.chat/core-typings'; -import { isOmnichannelRoom } from '@rocket.chat/core-typings'; import { usePermission, useStream, useUserId, useRouter } from '@rocket.chat/ui-contexts'; import { useQueryClient } from '@tanstack/react-query'; import type { ReactNode, ContextType, ReactElement } from 'react'; @@ -35,17 +34,18 @@ const RoomProvider = ({ rid, children }: RoomProviderProps): ReactElement => { const queryClient = useQueryClient(); const userId = useUserId(); const isLivechatAdmin = usePermission('view-livechat-rooms'); + const { t: roomType } = room ?? {}; // TODO: move this to omnichannel context only useEffect(() => { - if (!room || !isOmnichannelRoom(room)) { + if (roomType !== 'l') { return; } return subscribeToRoom(rid, (room) => { queryClient.setQueryData(['rooms', rid], room); }); - }, [subscribeToRoom, rid, queryClient, room]); + }, [subscribeToRoom, rid, queryClient, roomType]); // TODO: the following effect is a workaround while we don't have a general and definitive solution for it const router = useRouter(); @@ -55,19 +55,21 @@ const RoomProvider = ({ rid, children }: RoomProviderProps): ReactElement => { } }, [isSuccess, room, router]); + const { _id: servedById } = room?.servedBy ?? {}; + // TODO: Review the necessity of this effect when we move away from cached collections useEffect(() => { - if (!room || !isOmnichannelRoom(room) || !room.servedBy) { + if (roomType !== 'l' || !servedById) { return; } - if (!isLivechatAdmin && room.servedBy._id !== userId) { - ChatRoom.remove(room._id); - queryClient.removeQueries(['rooms', room._id]); - queryClient.removeQueries(['rooms', { reference: room._id, type: 'l' }]); - queryClient.removeQueries(['/v1/rooms.info', room._id]); + if (!isLivechatAdmin && servedById !== userId) { + ChatRoom.remove(rid); + queryClient.removeQueries(['rooms', rid]); + queryClient.removeQueries(['rooms', { reference: rid, type: 'l' }]); + queryClient.removeQueries(['/v1/rooms.info', rid]); } - }, [isLivechatAdmin, queryClient, userId, room]); + }, [isLivechatAdmin, queryClient, userId, rid, roomType, servedById]); const subscriptionQuery = useReactiveQuery(['subscriptions', { rid }], () => ChatSubscription.findOne({ rid }) ?? null); From 778fc6168e57a862bd596384bf10572b6a292c53 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Mon, 4 Sep 2023 19:25:09 -0300 Subject: [PATCH 066/275] fix: Remove options on `Chat Now` page (#30196) --- packages/livechat/src/routes/Chat/component.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livechat/src/routes/Chat/component.js b/packages/livechat/src/routes/Chat/component.js index 6ba1788b4bcb..98991ab72b53 100644 --- a/packages/livechat/src/routes/Chat/component.js +++ b/packages/livechat/src/routes/Chat/component.js @@ -186,7 +186,7 @@ class Chat extends Component { {onChangeDepartment && ( From e077fd1cb6f5a1811be0e557b916b0b39f8c9fdc Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Mon, 4 Sep 2023 20:08:31 -0300 Subject: [PATCH 067/275] chore: add missing voip setting translation on pt-BR (#30210) --- apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json index bf2f838d442a..931bb7bda467 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json @@ -4717,6 +4717,8 @@ "VoIP_Management_Server_Name": "Nome do servidor", "VoIP_Management_Server_Username": "Nome de usuário", "VoIP_Management_Server_Password": "Senha", + "VoIP_Retry_Count": "Número de tentativas", + "VoIP_Retry_Count_Description": "Define quantas vezes o cliente tentará se reconectar ao servidor VoIP caso a conexão seja perdida.", "Voip_call_started": "Chamada iniciada às", "Voip_call_duration": "Chamada com duração de {{duration}}", "Voip_call_declined": "Chamada finalizada pelo agente", From 8e95d589aa758a0554dc06b24406a10142f939f0 Mon Sep 17 00:00:00 2001 From: Hugo Costa Date: Tue, 5 Sep 2023 08:46:00 -0300 Subject: [PATCH 068/275] regression: Webhook / bot message without link previews (#30271) --- apps/meteor/app/oembed/server/server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/meteor/app/oembed/server/server.ts b/apps/meteor/app/oembed/server/server.ts index 3bf1ae3245be..256722cdd3d4 100644 --- a/apps/meteor/app/oembed/server/server.ts +++ b/apps/meteor/app/oembed/server/server.ts @@ -290,7 +290,7 @@ const rocketUrlParser = async function (message: IMessage): Promise { log.debug('URLs found', message.urls.length); if ( - message.attachments || + (message.attachments && message.attachments.length > 0) || message.urls.filter((item) => !item.url.includes(settings.get('Site_Url'))).length > MAX_EXTERNAL_URL_PREVIEWS ) { log.debug('All URL ignored'); @@ -330,7 +330,7 @@ const rocketUrlParser = async function (message: IMessage): Promise { changed = true; } } - if (attachments.length) { + if (attachments.length > 0) { await Messages.setMessageAttachments(message._id, attachments); } if (changed === true) { From 019e13c0073945e88763891c352dcb0192dc84f6 Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Tue, 5 Sep 2023 10:59:16 -0300 Subject: [PATCH 069/275] test: flaky homepage tests (#30200) --- apps/meteor/tests/e2e/homepage.spec.ts | 205 ++++++++++++------------- 1 file changed, 98 insertions(+), 107 deletions(-) diff --git a/apps/meteor/tests/e2e/homepage.spec.ts b/apps/meteor/tests/e2e/homepage.spec.ts index d9999e6fb502..465ecea03cbf 100644 --- a/apps/meteor/tests/e2e/homepage.spec.ts +++ b/apps/meteor/tests/e2e/homepage.spec.ts @@ -19,44 +19,46 @@ test.describe.serial('homepage', () => { let regularUserPage: Page; let adminPage: Page; - test.describe('layout for admins', () => { + test.describe('for admins', () => { test.beforeAll(async ({ browser }) => { adminPage = await browser.newPage({ storageState: Users.admin.state }); await adminPage.goto('/home'); await adminPage.waitForSelector('[data-qa-id="home-header"]'); }); - test('expect show customize button', async () => { - await expect(adminPage.locator('role=button[name="Customize"]')).toBeVisible(); - }); - test.describe('cards', () => { - for (const id of Object.values(CardIds)) { - // eslint-disable-next-line no-loop-func - test(`expect ${id} card to be visible`, async () => { - await expect(adminPage.locator(`[data-qa-id="${id}"]`)).toBeVisible(); - }); - } - }); + test('layout', async () => { + await test.step('expect show customize button', async () => { + await expect(adminPage.locator('role=button[name="Customize"]')).toBeVisible(); + }); + + await test.step('expect all cards to be visible', async () => { + await Promise.all(Object.values(CardIds).map((id) => expect(adminPage.locator(`[data-qa-id="${id}"]`)).toBeVisible())); + }); + }) + - test.describe('custom body with empty custom content', () => { + test.describe('custom body with empty custom content', async () => { test.beforeAll(async ({ api }) => { await expect((await api.post('/settings/Layout_Home_Body', { value: '' })).status()).toBe(200); }); - test('expect default value in custom body', async () => { - await expect( - adminPage.locator('role=status[name="Admins may insert content html to be rendered in this white space."]'), - ).toBeVisible(); - }); - - test('expect both change visibility and show only custom content buttons to be disabled', async () => { - await expect(adminPage.locator('role=button[name="Show to workspace"]')).toBeDisabled(); - await expect(adminPage.locator('role=button[name="Show only this content"]')).toBeDisabled(); - }); + test('layout', async () => { + await test.step('expect default value in custom body', async () => { + await expect( + adminPage.locator('role=status[name="Admins may insert content html to be rendered in this white space."]'), + ).toBeVisible(); + }); + + await test.step('expect both change visibility and show only custom content buttons to be disabled', async () => { + await expect(adminPage.locator('role=button[name="Show to workspace"]')).toBeDisabled(); + await expect(adminPage.locator('role=button[name="Show only this content"]')).toBeDisabled(); + }); + + await test.step('expect visibility tag to show "not visible"', async () => { + await expect(adminPage.locator('role=status[name="Not visible to workspace"]')).toBeVisible(); + }); + }) - test('expect visibility tag to show "not visible"', async () => { - await expect(adminPage.locator('role=status[name="Not visible to workspace"]')).toBeVisible(); - }); }); test.describe('custom body with custom content', () => { @@ -64,35 +66,38 @@ test.describe.serial('homepage', () => { await expect((await api.post('/settings/Layout_Home_Body', { value: 'Hello admin' })).status()).toBe(200); }); - test('expect custom body to be visible', async () => { - await expect(adminPage.locator('role=status[name="Hello admin"]')).toBeVisible(); - }); + test('layout', async() => { + await test.step('expect custom body to be visible', async () => { + await expect(adminPage.locator('role=status[name="Hello admin"]')).toBeVisible(); + }); + + await test.step('expect correct state for card buttons', async () => { + await expect(adminPage.locator('role=button[name="Show to workspace"]')).not.toBeDisabled(); + await expect(adminPage.locator('role=button[name="Show only this content"]')).toBeDisabled(); + }); + }) - test('expect correct state for card buttons', async () => { - await expect(adminPage.locator('role=button[name="Show to workspace"]')).not.toBeDisabled(); - await expect(adminPage.locator('role=button[name="Show only this content"]')).toBeDisabled(); - }); test.describe('enterprise edition', () => { test.skip(!IS_EE, 'Enterprise Only'); - test.describe('display custom content only', () => { - test.beforeAll(async ({ api }) => { - await expect((await api.post('/settings/Layout_Home_Body', { value: 'Hello admin' })).status()).toBe(200); - await expect((await api.post('/settings/Layout_Home_Custom_Block_Visible', { value: true })).status()).toBe(200); - await expect((await api.post('/settings/Layout_Custom_Body_Only', { value: true })).status()).toBe(200); - }); + test.beforeAll(async ({ api }) => { + await expect((await api.post('/settings/Layout_Home_Body', { value: 'Hello admin' })).status()).toBe(200); + await expect((await api.post('/settings/Layout_Home_Custom_Block_Visible', { value: true })).status()).toBe(200); + await expect((await api.post('/settings/Layout_Custom_Body_Only', { value: true })).status()).toBe(200); + }); - test('expect default layout to not be visible (show only custom content card)', async () => { + test('display custom content only', async () => { + await test.step('expect default layout to not be visible (show only custom content card)', async () => { await expect(adminPage.locator('role=heading[name="Welcome to Rocket.Chat"]')).not.toBeVisible(); }); - test('expect correct state for card buttons', async () => { + await test.step('expect correct state for card buttons', async () => { await expect(adminPage.locator('role=button[name="Hide on workspace"]')).toBeDisabled(); await expect(adminPage.locator('role=button[name="Show default content"]')).not.toBeDisabled(); }); - test('expect visibility tag to show "visible to workspace"', async () => { + await test.step('expect visibility tag to show "visible to workspace"', async () => { await expect(adminPage.locator('role=status[name="Visible to workspace"]')).toBeVisible(); }); }); @@ -100,97 +105,80 @@ test.describe.serial('homepage', () => { }); test.afterAll(async ({ api }) => { - await expect((await api.post('/settings/Layout_Home_Custom_Block_Visible', { value: false })).status()).toBe(200); - await expect((await api.post('/settings/Layout_Custom_Body_Only', { value: false })).status()).toBe(200); + expect((await api.post('/settings/Layout_Home_Custom_Block_Visible', { value: false })).status()).toBe(200); + expect((await api.post('/settings/Layout_Custom_Body_Only', { value: false })).status()).toBe(200); await adminPage.close(); }); }); - test.describe('layout for regular users', () => { - test.beforeAll(async ({ api }) => { - await expect((await api.post('/settings/Layout_Home_Body', { value: '' })).status()).toBe(200); - }); + test.describe('for regular users', () => { + const notVisibleCards = [CardIds.Users, CardIds.Custom]; - test.beforeAll(async ({ browser }) => { + test.beforeAll(async ({ api, browser }) => { + expect((await api.post('/settings/Layout_Home_Body', { value: '' })).status()).toBe(200); regularUserPage = await browser.newPage({ storageState: Users.user2.state }); await regularUserPage.goto('/home'); await regularUserPage.waitForSelector('[data-qa-id="home-header"]'); }); - test('expect to not show customize button', async () => { - await expect(regularUserPage.locator('role=button[name="Customize"]')).not.toBeVisible(); - }); - - test.describe('cards', () => { - for (const id of Object.values(CardIds)) { - if (id === CardIds.Users || id === CardIds.Custom) { - // eslint-disable-next-line no-loop-func - test(`expect ${id} card to not be visible`, async () => { - await expect(regularUserPage.locator(`[data-qa-id="${id}"]`)).not.toBeVisible(); - }); - } else { - // eslint-disable-next-line no-loop-func - test(`expect ${id} card to be visible`, async () => { - await expect(regularUserPage.locator(`[data-qa-id="${id}"]`)).toBeVisible(); - }); - } - } - }); - - test.describe('default values', () => { - test('expect welcome text to use Site_Name default setting', async () => { + test('layout', async () => { + await test.step('expect to not show customize button', async () => { + await expect(regularUserPage.locator('role=button[name="Customize"]')).not.toBeVisible(); + }); + + await test.step(`expect ${notVisibleCards.join(' and ')} cards to not be visible`, async () => { + await Promise.all(notVisibleCards.map((id) => expect(regularUserPage.locator(`[data-qa-id="${id}"]`)).not.toBeVisible())); + }); + + await test.step('expect all other cards to be visible', async () => { + await Promise.all(Object.values(CardIds).filter((id) => !notVisibleCards.includes(id)).map((id) => expect(regularUserPage.locator(`[data-qa-id="${id}"]`)).toBeVisible())); + }); + + await test.step('expect welcome text to use Site_Name default setting', async () => { await expect(regularUserPage.locator('role=heading[name="Welcome to Rocket.Chat"]')).toBeVisible(); }); - - test('expect header text to use Layout_Home_Title default setting', async () => { + + await test.step('expect header text to use Layout_Home_Title default setting', async () => { await expect(regularUserPage.locator('[data-qa-type="PageHeader-title"]')).toContainText('Home'); }); }); test.describe('custom values', () => { test.beforeAll(async ({ api }) => { - await expect((await api.post('/settings/Site_Name', { value: 'NewSiteName' })).status()).toBe(200); - await expect((await api.post('/settings/Layout_Home_Title', { value: 'NewTitle' })).status()).toBe(200); - }); + expect((await api.post('/settings/Site_Name', { value: 'NewSiteName' })).status()).toBe(200); + expect((await api.post('/settings/Layout_Home_Title', { value: 'NewTitle' })).status()).toBe(200); - test.beforeAll(async ({ browser }) => { - regularUserPage = await browser.newPage({ storageState: Users.user2.state }); await regularUserPage.goto('/home'); await regularUserPage.waitForSelector('[data-qa-id="home-header"]'); }); - test('expect welcome text to be NewSiteName', async () => { - await expect(regularUserPage.locator('role=heading[name="Welcome to NewSiteName"]')).toBeVisible(); - }); + test('layout', async () => { + await test.step('expect welcome text to be NewSiteName', async () => { + await expect(regularUserPage.locator('role=heading[name="Welcome to NewSiteName"]')).toBeVisible(); + }); + + await test.step('expect header text to be Layout_Home_Title setting', async () => { + await expect(regularUserPage.locator('[data-qa-type="PageHeader-title"]')).toContainText('NewTitle'); + }); + }) - test('expect header text to be Layout_Home_Title setting', async () => { - await expect(regularUserPage.locator('[data-qa-type="PageHeader-title"]')).toContainText('NewTitle'); - }); test.afterAll(async ({ api }) => { - await expect((await api.post('/settings/Site_Name', { value: 'Rocket.Chat' })).status()).toBe(200); - await expect((await api.post('/settings/Layout_Home_Title', { value: 'Home' })).status()).toBe(200); - }); - }); - - test.describe('custom body with empty content', () => { - test('expect to not show custom content card', async () => { - await expect(regularUserPage.locator('role=status')).not.toBeVisible(); + expect((await api.post('/settings/Site_Name', { value: 'Rocket.Chat' })).status()).toBe(200); + expect((await api.post('/settings/Layout_Home_Title', { value: 'Home' })).status()).toBe(200); }); }); test.describe('custom body with content', () => { test.beforeAll(async ({ api }) => { - await expect((await api.post('/settings/Layout_Home_Body', { value: 'Hello' })).status()).toBe(200); - await expect((await api.post('/settings/Layout_Home_Custom_Block_Visible', { value: true })).status()).toBe(200); - }); + expect((await api.post('/settings/Layout_Home_Body', { value: 'Hello' })).status()).toBe(200); + expect((await api.post('/settings/Layout_Home_Custom_Block_Visible', { value: true })).status()).toBe(200); - test.beforeAll(async ({ browser }) => { - regularUserPage = await browser.newPage({ storageState: Users.user2.state }); await regularUserPage.goto('/home'); await regularUserPage.waitForSelector('[data-qa-id="home-header"]'); }); + test('expect custom body to be visible', async () => { await expect(regularUserPage.locator('role=status[name="Hello"]')).toBeVisible(); }); @@ -199,25 +187,28 @@ test.describe.serial('homepage', () => { test.skip(!IS_EE, 'Enterprise Only'); test.beforeAll(async ({ api }) => { - await expect((await api.post('/settings/Layout_Custom_Body_Only', { value: true })).status()).toBe(200); + expect((await api.post('/settings/Layout_Custom_Body_Only', { value: true })).status()).toBe(200); }); - test('expect default layout to not be visible', async () => { - await expect(regularUserPage.locator('[data-qa-id="homepage-welcome-text"]')).not.toBeVisible(); - }); + test('layout', async () => { + await test.step('expect default layout to not be visible', async () => { + await expect(regularUserPage.locator('[data-qa-id="homepage-welcome-text"]')).not.toBeVisible(); + }); + + await test.step('expect custom body to be visible', async () => { + await expect(regularUserPage.locator('role=status[name="Hello"]')).toBeVisible(); + }); + }) - test('expect custom body to be visible', async () => { - await expect(regularUserPage.locator('role=status[name="Hello"]')).toBeVisible(); - }); test.afterAll(async ({ api }) => { - await expect((await api.post('/settings/Layout_Custom_Body_Only', { value: false })).status()).toBe(200); + expect((await api.post('/settings/Layout_Custom_Body_Only', { value: false })).status()).toBe(200); }); }); test.afterAll(async ({ api }) => { - await expect((await api.post('/settings/Layout_Home_Body', { value: '' })).status()).toBe(200); - await expect((await api.post('/settings/Layout_Home_Custom_Block_Visible', { value: false })).status()).toBe(200); + expect((await api.post('/settings/Layout_Home_Body', { value: '' })).status()).toBe(200); + expect((await api.post('/settings/Layout_Home_Custom_Block_Visible', { value: false })).status()).toBe(200); }); }); }); From a08898232c724de5918b589ae482db437eec533b Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Tue, 5 Sep 2023 11:23:37 -0300 Subject: [PATCH 070/275] chore: AppsList semantics improvements (#30256) --- .../views/admin/users/AdminUsersPage.tsx | 2 +- .../client/views/marketplace/AppMenu.js | 2 +- .../views/marketplace/AppsList/AppRow.tsx | 81 +++++++++---------- .../views/marketplace/AppsList/AppsList.tsx | 31 ++++--- .../marketplace/AppsPage/AppsPageContent.tsx | 5 -- .../AppsPage/AppsPageContentBody.tsx | 6 +- .../AppsPage/FeaturedAppsSections.tsx | 6 +- .../fragments/admin-flextab-users.ts | 8 ++ .../meteor/tests/e2e/user-invitations.spec.ts | 10 ++- 9 files changed, 83 insertions(+), 68 deletions(-) diff --git a/apps/meteor/client/views/admin/users/AdminUsersPage.tsx b/apps/meteor/client/views/admin/users/AdminUsersPage.tsx index 24622a44bcc6..aae06b177cce 100644 --- a/apps/meteor/client/views/admin/users/AdminUsersPage.tsx +++ b/apps/meteor/client/views/admin/users/AdminUsersPage.tsx @@ -66,7 +66,7 @@ const UsersPage = (): ReactElement => { {context && ( - + {context === 'info' && t('User_Info')} diff --git a/apps/meteor/client/views/marketplace/AppMenu.js b/apps/meteor/client/views/marketplace/AppMenu.js index ba843321395c..f50651ac4f53 100644 --- a/apps/meteor/client/views/marketplace/AppMenu.js +++ b/apps/meteor/client/views/marketplace/AppMenu.js @@ -425,7 +425,7 @@ function AppMenu({ app, isAppDetailsPage, ...props }) { return null; } - return ; + return ; } export default AppMenu; diff --git a/apps/meteor/client/views/marketplace/AppsList/AppRow.tsx b/apps/meteor/client/views/marketplace/AppsList/AppRow.tsx index a8a664fb148a..3005b706326b 100644 --- a/apps/meteor/client/views/marketplace/AppsList/AppRow.tsx +++ b/apps/meteor/client/views/marketplace/AppsList/AppRow.tsx @@ -62,55 +62,54 @@ const AppRow = (props: App): ReactElement => { const canUpdate = installed && version && marketplaceVersion && semver.lt(version, marketplaceVersion); return ( - - - - - +
+ + + + {name} + + {bundledIn && Boolean(bundledIn.length) && ( + + + + )} + {shortDescription && !isMobile && ( + + {shortDescription} + + )} + - - {bundledIn && Boolean(bundledIn.length) && ( - - - - )} - {shortDescription && !isMobile && ( - - {shortDescription} + + {canUpdate && ( + + )} - - - - {canUpdate && ( - - - - )} - - + - +
); }; diff --git a/apps/meteor/client/views/marketplace/AppsList/AppsList.tsx b/apps/meteor/client/views/marketplace/AppsList/AppsList.tsx index 7855bbdc8f94..27d25a566f80 100644 --- a/apps/meteor/client/views/marketplace/AppsList/AppsList.tsx +++ b/apps/meteor/client/views/marketplace/AppsList/AppsList.tsx @@ -7,20 +7,25 @@ import AppRow from './AppRow'; type AppsListProps = { apps: App[]; - title: string; + title?: string; + appsListId: string; }; -const AppsList = ({ apps, title }: AppsListProps): ReactElement => ( - <> - - {title} - - - {apps.map((app) => ( - - ))} - - -); +const AppsList = ({ apps, title, appsListId }: AppsListProps): ReactElement => { + return ( + <> + {title && ( + + {title} + + )} + + {apps.map((app) => ( + + ))} + + + ); +}; export default AppsList; diff --git a/apps/meteor/client/views/marketplace/AppsPage/AppsPageContent.tsx b/apps/meteor/client/views/marketplace/AppsPage/AppsPageContent.tsx index b652aba5ca27..40d90b56e046 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/AppsPageContent.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/AppsPageContent.tsx @@ -184,9 +184,7 @@ const AppsPageContent = (): ReactElement => { statusFilterOnSelected={statusFilterOnSelected} context={context || 'explore'} /> - {appsResult.phase === AsyncStatePhase.LOADING && } - {appsResult.phase === AsyncStatePhase.RESOLVED && noErrorsOcurred && ( { noErrorsOcurred={noErrorsOcurred} /> )} - {noAppRequests && } - {noMarketplaceOrInstalledAppMatches && ( )} - {noInstalledAppMatches && ( { const t = useTranslation(); const scrollableRef = useRef(null); + const appsListId = useUniqueId(); return ( <> {noErrorsOcurred && ( - {isMarketplace && !isFiltered && } - + {isMarketplace && !isFiltered && } + )} diff --git a/apps/meteor/client/views/marketplace/AppsPage/FeaturedAppsSections.tsx b/apps/meteor/client/views/marketplace/AppsPage/FeaturedAppsSections.tsx index ee6904499af9..71d9ac62fcc0 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/FeaturedAppsSections.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/FeaturedAppsSections.tsx @@ -9,17 +9,19 @@ import { useFeaturedApps } from '../hooks/useFeaturedApps'; type FeaturedSectionsProps = { appsResult: App[]; + appsListId: string; }; -const FeaturedAppsSections = ({ appsResult }: FeaturedSectionsProps): ReactElement | null => { +const FeaturedAppsSections = ({ appsResult, appsListId }: FeaturedSectionsProps): ReactElement | null => { const t = useTranslation(); const featuredApps = useFeaturedApps(); if (featuredApps.isSuccess) { return ( <> - {featuredApps.data.sections.map((section) => ( + {featuredApps.data.sections.map((section, index) => ( > text="Invite Members"'); + } + + get setupSmtpLink(): Locator { + return this.page.locator('role=link[name="Set up SMTP"]') + } } diff --git a/apps/meteor/tests/e2e/user-invitations.spec.ts b/apps/meteor/tests/e2e/user-invitations.spec.ts index f5eaac3c688f..4bcdf82d6f43 100644 --- a/apps/meteor/tests/e2e/user-invitations.spec.ts +++ b/apps/meteor/tests/e2e/user-invitations.spec.ts @@ -1,19 +1,23 @@ import { Users } from './fixtures/userStates'; +import { Admin } from './page-objects'; import { test, expect } from './utils/test'; test.use({ storageState: Users.admin.state }); test.describe.serial('user-invites', () => { + let poAdmin: Admin; + test.beforeEach(async ({ page }) => { + poAdmin = new Admin(page); await page.goto('/admin/users/invite'); - await expect(page.locator('//div[contains(text(), "Invite Members")]')).toBeVisible(); + await expect(poAdmin.tabs.users.inviteUsersTitle).toBeVisible(); }); test('expect SMTP setup warning and routing to email settings', async ({ page }) => { - await expect(page.locator('role=link[name="Set up SMTP"]')).toBeVisible(); + await expect(poAdmin.tabs.users.setupSmtpLink).toBeVisible(); - await page.locator('role=link[name="Set up SMTP"]').click(); + await poAdmin.tabs.users.setupSmtpLink.click(); await expect(page).toHaveURL('/admin/settings/Email'); }); From 97c8040b446c0610055431043e41d00733d64b7d Mon Sep 17 00:00:00 2001 From: "lingohub[bot]" <69908207+lingohub[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 15:58:40 +0000 Subject: [PATCH 071/275] =?UTF-8?q?i18n:=20Language=20update=20from=20Ling?= =?UTF-8?q?oHub=20=F0=9F=A4=96=20on=202023-08-31Z=20(#30243)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com> --- .../rocketchat-i18n/i18n/af.i18n.json | 2 ++ .../rocketchat-i18n/i18n/ar.i18n.json | 3 ++- .../rocketchat-i18n/i18n/az.i18n.json | 2 ++ .../rocketchat-i18n/i18n/be-BY.i18n.json | 2 ++ .../rocketchat-i18n/i18n/bg.i18n.json | 2 ++ .../rocketchat-i18n/i18n/bs.i18n.json | 2 ++ .../rocketchat-i18n/i18n/ca.i18n.json | 3 ++- .../rocketchat-i18n/i18n/cs.i18n.json | 3 ++- .../rocketchat-i18n/i18n/cy.i18n.json | 2 ++ .../rocketchat-i18n/i18n/da.i18n.json | 3 ++- .../rocketchat-i18n/i18n/de-AT.i18n.json | 2 ++ .../rocketchat-i18n/i18n/de.i18n.json | 6 ++---- .../rocketchat-i18n/i18n/el.i18n.json | 2 ++ .../rocketchat-i18n/i18n/en.i18n.json | 3 +-- .../rocketchat-i18n/i18n/eo.i18n.json | 2 ++ .../rocketchat-i18n/i18n/es.i18n.json | 3 ++- .../rocketchat-i18n/i18n/fa.i18n.json | 2 ++ .../rocketchat-i18n/i18n/fi.i18n.json | 7 ++----- .../rocketchat-i18n/i18n/fr.i18n.json | 3 ++- .../rocketchat-i18n/i18n/gl.i18n.json | 1 + .../rocketchat-i18n/i18n/he.i18n.json | 2 ++ .../rocketchat-i18n/i18n/hr.i18n.json | 2 ++ .../rocketchat-i18n/i18n/hu.i18n.json | 4 ++-- .../rocketchat-i18n/i18n/id.i18n.json | 2 ++ .../rocketchat-i18n/i18n/it.i18n.json | 3 ++- .../rocketchat-i18n/i18n/ja.i18n.json | 3 ++- .../rocketchat-i18n/i18n/ka-GE.i18n.json | 3 ++- .../rocketchat-i18n/i18n/km.i18n.json | 2 ++ .../rocketchat-i18n/i18n/ko.i18n.json | 3 ++- .../rocketchat-i18n/i18n/ku.i18n.json | 2 ++ .../rocketchat-i18n/i18n/lo.i18n.json | 2 ++ .../rocketchat-i18n/i18n/lt.i18n.json | 2 ++ .../rocketchat-i18n/i18n/lv.i18n.json | 2 ++ .../rocketchat-i18n/i18n/mn.i18n.json | 2 ++ .../rocketchat-i18n/i18n/ms-MY.i18n.json | 2 ++ .../rocketchat-i18n/i18n/nl.i18n.json | 3 ++- .../rocketchat-i18n/i18n/no.i18n.json | 2 ++ .../rocketchat-i18n/i18n/pl.i18n.json | 4 ++-- .../rocketchat-i18n/i18n/pt-BR.i18n.json | 19 +++++++++---------- .../rocketchat-i18n/i18n/pt.i18n.json | 3 ++- .../rocketchat-i18n/i18n/ro.i18n.json | 2 ++ .../rocketchat-i18n/i18n/ru.i18n.json | 3 ++- .../rocketchat-i18n/i18n/sk-SK.i18n.json | 2 ++ .../rocketchat-i18n/i18n/sl-SI.i18n.json | 2 ++ .../rocketchat-i18n/i18n/sq.i18n.json | 2 ++ .../rocketchat-i18n/i18n/sr.i18n.json | 2 ++ .../rocketchat-i18n/i18n/sv.i18n.json | 7 ++----- .../rocketchat-i18n/i18n/ta-IN.i18n.json | 2 ++ .../rocketchat-i18n/i18n/th-TH.i18n.json | 2 ++ .../rocketchat-i18n/i18n/tr.i18n.json | 3 ++- .../rocketchat-i18n/i18n/ug.i18n.json | 2 ++ .../rocketchat-i18n/i18n/uk.i18n.json | 3 ++- .../rocketchat-i18n/i18n/vi-VN.i18n.json | 2 ++ .../rocketchat-i18n/i18n/zh-HK.i18n.json | 2 ++ .../rocketchat-i18n/i18n/zh-TW.i18n.json | 3 ++- .../rocketchat-i18n/i18n/zh.i18n.json | 3 ++- 56 files changed, 117 insertions(+), 47 deletions(-) diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/af.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/af.i18n.json index 1f8dc09c9585..c1322ebab0af 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/af.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/af.i18n.json @@ -1831,6 +1831,8 @@ "Offline_success_message": "Vanlyn Sukses Boodskap", "Offline_unavailable": "Vanlyn is nie beskikbaar nie", "Older_than": "Ouer as", + "Omnichannel_Reports_Status_Open": "oop", + "Omnichannel_Reports_Status_Closed": "gesluit", "On": "op", "online": "aanlyn", "Online": "Online", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ar.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ar.i18n.json index 3b61c7d46ef5..d6b7e5a0739b 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ar.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ar.i18n.json @@ -2019,7 +2019,6 @@ "Generate_new_key": "إنشاء مفتاح جديد", "Generate_New_Link": "إنشاء رابط جديد", "Generating_key": "يتم إنشاء مفتاح", - "Get_link": "الحصول على رابط", "get-password-policy-forbidRepeatingCharacters": "يجب ألا تحتوي كلمة المرور على رموز متكررة", "get-password-policy-forbidRepeatingCharactersCount": "يجب ألا تحتوي كلمة المرور على أكثر من {{forbidRepeatingCharactersCount}} من الرموز المتكررة", "get-password-policy-maxLength": "يجب أن يزيد طول كلمة المرور على {{maxLength}} من الرموز", @@ -3181,6 +3180,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "مفتاح التشفير (JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "إذا تم توفيره، فسيقوم بتشفير الرمز المميز للمستخدم مع المفتاح المقدم وسيحتاج النظام الخارجي إلى فك تشفير البيانات للوصول إلى الرمز المميز", "Omnichannel_External_Frame_URL": "عنوان URL للإطار الخارجي", + "Omnichannel_Reports_Status_Open": "فتح", + "Omnichannel_Reports_Status_Closed": "تم الإغلاق", "On": "مُفعّل", "On_Hold": "قيد الانتظار", "On_Hold_Chats": "قيد الانتظار", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/az.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/az.i18n.json index 6eb91c5e0f93..d63adf27a952 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/az.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/az.i18n.json @@ -1831,6 +1831,8 @@ "Offline_success_message": "Offline Uğur Mesajı", "Offline_unavailable": "Offline mövcud deyil", "Older_than": "Daha yaşlı", + "Omnichannel_Reports_Status_Open": "Açıq", + "Omnichannel_Reports_Status_Closed": "Bağlı", "On": "On", "online": "onlayn", "Online": "Onlayn", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/be-BY.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/be-BY.i18n.json index 195ae7976527..f46d3ea22b1d 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/be-BY.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/be-BY.i18n.json @@ -1847,6 +1847,8 @@ "Offline_success_message": "Offline Поспех паведамлення", "Offline_unavailable": "Offline недаступны", "Older_than": "Старэй", + "Omnichannel_Reports_Status_Open": "адкрыты", + "Omnichannel_Reports_Status_Closed": "закрыта", "On": "на", "online": "онлайн", "Online": "інтэрнэт", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/bg.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/bg.i18n.json index 344c2a75a499..b4bd9d07a849 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/bg.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/bg.i18n.json @@ -1828,6 +1828,8 @@ "Offline_success_message": "Съобщение за успешно офлайн", "Offline_unavailable": "Офлайн не е налице", "Older_than": "По-стари от", + "Omnichannel_Reports_Status_Open": "Отвори", + "Omnichannel_Reports_Status_Closed": "Затворен", "On": "На", "online": "на линия", "Online": "На линия", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/bs.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/bs.i18n.json index c58116b0c42e..81135ed5fa0d 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/bs.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/bs.i18n.json @@ -1824,6 +1824,8 @@ "Offline_success_message": "Izvanmrežna poruka uspjeha", "Offline_unavailable": "Nedostupnost izvanmrežnosti", "Older_than": "Stariji od", + "Omnichannel_Reports_Status_Open": "Otvori", + "Omnichannel_Reports_Status_Closed": "Zatvoreno", "On": "Uključeno", "online": "na liniji", "Online": "Online", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ca.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ca.i18n.json index c243fc4a5585..b6e15bbf6f66 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ca.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ca.i18n.json @@ -1997,7 +1997,6 @@ "Generate_new_key": "Generar una nova clau", "Generate_New_Link": "Generar un nou enllaç", "Generating_key": "Generant clau", - "Get_link": "Obtenir l'enllaç", "get-password-policy-forbidRepeatingCharacters": "La contrasenya no ha de contenir caràcters repetits", "get-password-policy-forbidRepeatingCharactersCount": "La contrasenya no ha de contenir més que {{forbidRepeatingCharactersCount}} caràcters repetits", "get-password-policy-maxLength": "La contrasenya ha de tenir un màxim de {{maxLength}} caràcters", @@ -3146,6 +3145,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "Clau de xifrat (JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "Si es proporciona, xifrarà el token de l'usuari amb la clau proporcionada i el sistema extern haurà de desxifrar les dades per accedir a el token.", "Omnichannel_External_Frame_URL": "URL de marc extern", + "Omnichannel_Reports_Status_Open": "Obre", + "Omnichannel_Reports_Status_Closed": "Tancat", "On": "Activa", "On_Hold_Chats": "En espera", "On_Hold_conversations": "Converses en espera", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/cs.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/cs.i18n.json index cac3e0a65941..ff081e3a5eeb 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/cs.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/cs.i18n.json @@ -1705,7 +1705,6 @@ "Generate_new_key": "Vygenerovat nový klíč", "Generate_New_Link": "Vytvořit nový odkaz", "Generating_key": "Generování klíče", - "Get_link": "Získat odkaz", "get-password-policy-forbidRepeatingCharacters": "Heslo nesmí obsahovat opakující se znaky", "get-password-policy-forbidRepeatingCharactersCount": "Heslo nesmí obsahovat více než {{forbidRepeatingCharactersCount}} opakujících se znaků", "get-password-policy-maxLength": "Heslo nesmí být delší než {{maxLength}} znaků", @@ -2662,6 +2661,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "JWK klíč šifrování", "Omnichannel_External_Frame_Encryption_JWK_Description": "Pokud je povoleno zašifruje uživatelský data poskytnutým klíčem a externí systém je musí rozšifrovat.", "Omnichannel_External_Frame_URL": "URL externího rámce", + "Omnichannel_Reports_Status_Open": "Otevřít", + "Omnichannel_Reports_Status_Closed": "Zavřeno", "On": "Zapnuto", "online": "online", "Online": "Online", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/cy.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/cy.i18n.json index 793b1691b7e9..0f939e6b345e 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/cy.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/cy.i18n.json @@ -1826,6 +1826,8 @@ "Offline_success_message": "Neges Llwyddiant All-lein", "Offline_unavailable": "All-lein ddim ar gael", "Older_than": "Yn hŷn na", + "Omnichannel_Reports_Status_Open": "Agor", + "Omnichannel_Reports_Status_Closed": "Ar gau", "On": "Ar", "online": "ar-lein", "Online": "Ar-lein", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/da.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/da.i18n.json index ea4c9264efe9..317faac59164 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/da.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/da.i18n.json @@ -1716,7 +1716,6 @@ "Generate_new_key": "Generér en ny nøgle", "Generate_New_Link": "Generér nyt link", "Generating_key": "Genererer nøgle", - "Get_link": "Få link", "get-password-policy-forbidRepeatingCharacters": "Adgangskoden bør ikke indeholde gentagne tegn", "get-password-policy-forbidRepeatingCharactersCount": "Adgangskoden bør ikke indeholde mere end {{forbidRepeatingCharactersCount}} gentagne tegn", "get-password-policy-maxLength": "Adgangskoden skal maksimalt være {{maxLength}} tegn lang", @@ -2675,6 +2674,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "Krypteringsnøgle (JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "Hvis en nøgle forefindes, vil brugerens token krypteres og eksterne systemer skal dekryptere data'en for at tilgå token", "Omnichannel_External_Frame_URL": "Ekstern frame-URL", + "Omnichannel_Reports_Status_Open": "Åbent", + "Omnichannel_Reports_Status_Closed": "Lukket", "On": "På", "online": "online", "Online": "Online", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/de-AT.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/de-AT.i18n.json index 78e458b50bbb..68b45bb97714 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/de-AT.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/de-AT.i18n.json @@ -1834,6 +1834,8 @@ "Offline_success_message": "Nachricht, dass Offline Nachricht erfolgreich", "Offline_unavailable": "offline - nicht verfügbar", "Older_than": "Älter als", + "Omnichannel_Reports_Status_Open": "Öffnen", + "Omnichannel_Reports_Status_Closed": "Geschlossen", "On": "Ein", "online": "online", "Online": "Online", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/de.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/de.i18n.json index e5d66cd9accc..47649dd17b2d 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/de.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/de.i18n.json @@ -2257,7 +2257,6 @@ "Generate_new_key": "Neuen Schlüssel erzeugen", "Generate_New_Link": "Neuen Link erstellen", "Generating_key": "Schlüssel generieren", - "Get_link": "Link abrufen", "get-password-policy-forbidRepeatingCharacters": "Das Passwort sollte keine sich wiederholenden Zeichen enthalten", "get-password-policy-forbidRepeatingCharactersCount": "Das Passwort darf nicht mehr als {{forbidRepeatingCharactersCount}} Zeichen enthalten, die sich wiederholen", "get-password-policy-maxLength": "Das Passwort sollte maximal {{maxLength}} Zeichen lang sein", @@ -2538,7 +2537,6 @@ "Invalid_setting_s": "Ungültige Einstellung: %s", "Invalid_two_factor_code": "Fehlerhafter Zwei-Faktor-Code", "Invalid_username": "Der eingegebene Benutzername ist ungültig", - "Invalid_JSON": "Ungültiges JSON", "invisible": "unsichtbar", "Invisible": "Unsichtbar", "Invitation": "Einladung", @@ -3216,7 +3214,6 @@ "Message_has_been_edited_by": "Die Nachricht wurde editiert von {{username}}", "Message_has_been_edited_by_at": "Die Nachricht wurde bearbeitet von __Benutzername__ am __datum__", "Message_has_been_pinned": "Nachricht wurde angeheftet", - "Message_has_been_shared": "Nachricht wurde geteilt", "Message_has_been_starred": "Nachricht wurde als Favorit gekennzeichnet", "Message_has_been_unpinned": "Nachricht wurde entpinnt", "Message_has_been_unstarred": "Nachricht nicht mehr favorisiert", @@ -3572,6 +3569,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "Verschlüsselungsschlüssel (JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "Wenn angegeben, wird das Token des Benutzers mit dem angegebenen Schlüssel verschlüsselt und das externe System muss die Daten entschlüsseln, um auf das Token zuzugreifen", "Omnichannel_External_Frame_URL": "URL des externen Frames", + "Omnichannel_Reports_Status_Open": "Öffnen", + "Omnichannel_Reports_Status_Closed": "Geschlossen", "On": "Ein", "On_Hold": "In der Warteschleife", "On_Hold_Chats": "Angehalten", @@ -4254,7 +4253,6 @@ "Select_an_option": "Eine Option auswählen", "Select_at_least_one_user": "Mindestens einen Benutzer auswählen", "Select_at_least_two_users": "Mindestens zwei Benutzer auswählen", - "Share_Message": "Nachricht teilen", "Select_department": "Eine Abteilung auswählen", "Select_file": "Datei auswählen", "Select_role": "Eine Rolle auswählen", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/el.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/el.i18n.json index d36aee78cff4..b51fa54a97af 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/el.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/el.i18n.json @@ -1839,6 +1839,8 @@ "Offline_success_message": "Offline μήνυμα επιτυχίας", "Offline_unavailable": "offline διαθέσιμη", "Older_than": "Μεγαλύτερος από", + "Omnichannel_Reports_Status_Open": "Ανοιχτό", + "Omnichannel_Reports_Status_Closed": "Έκλεισε", "On": "Επί", "online": "σε απευθείας σύνδεση", "Online": "Συνδεδεμένος", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 4dfd49cabd30..3522dc59e8cb 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -639,7 +639,6 @@ "Apps_Manual_Update_Modal_Title": "This app is already installed", "Apps_Manual_Update_Modal_Body": "Do you want to update it?", "Apps_User_Already_Exists": "The username \"{{username}}\" is already being used. Rename or remove the user using it to install this App", - "AutoLinker": "AutoLinker", "Apps_WhatIsIt": "Apps: What Are They?", "Apps_WhatIsIt_paragraph1": "A new icon in the administration area! What does this mean and what are Apps?", @@ -6034,4 +6033,4 @@ "Filter_by_room": "Filter by room type", "Filter_by_visibility": "Filter by visibility", "Theme_Appearence": "Theme Appearence" -} +} \ No newline at end of file diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/eo.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/eo.i18n.json index 8066b28297fa..9c9501c8a174 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/eo.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/eo.i18n.json @@ -1831,6 +1831,8 @@ "Offline_success_message": "Senkonekta Sukcesa Mesaĝo", "Offline_unavailable": "Senkonekta ne disponebla", "Older_than": "Pli maljuna ol", + "Omnichannel_Reports_Status_Open": "Malfermita", + "Omnichannel_Reports_Status_Closed": "Fermita", "On": "Sur", "online": "enreta", "Online": "Enreta", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/es.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/es.i18n.json index cb9e83821017..50a7b8d63873 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/es.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/es.i18n.json @@ -1995,7 +1995,6 @@ "Generate_new_key": "Generar una nueva clave", "Generate_New_Link": "Generar un nuevo enlace", "Generating_key": "Generando clave", - "Get_link": "Obtener enlace", "get-password-policy-forbidRepeatingCharacters": "La contraseña no debe contener caracteres repetidos", "get-password-policy-forbidRepeatingCharactersCount": "La contraseña solo puede contener {{forbidRepeatingCharactersCount}} caracteres repetidos", "get-password-policy-maxLength": "La contraseña debe tener un máximo de {{maxLength}} caracteres", @@ -3156,6 +3155,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "Clave de cifrado (JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "Si se proporciona, cifrará el token del usuario con la clave proporcionada y el sistema externo deberá descifrar los datos para acceder al token.", "Omnichannel_External_Frame_URL": "URL de marco externo", + "Omnichannel_Reports_Status_Open": "Abiertas", + "Omnichannel_Reports_Status_Closed": "Cerrado", "On": "Activar", "On_Hold": "En espera", "On_Hold_Chats": "En espera", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/fa.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/fa.i18n.json index ea451b6ad4d5..dba68fa6b255 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/fa.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/fa.i18n.json @@ -2132,6 +2132,8 @@ "Omnichannel_Directory": "راهنمای ارتباط کانال همه‌کاره", "Omnichannel_appearance": "ظاهر کانال همه‌کاره", "Omnichannel_Contact_Center": "مرکز مخاطبان کانال همه‌کاره", + "Omnichannel_Reports_Status_Open": "باز کن", + "Omnichannel_Reports_Status_Closed": "بسته", "On": "روشن", "online": "برخط", "Online": "برخط", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json index 0fc914f509f0..ccdec04a7bec 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json @@ -2290,7 +2290,6 @@ "Generate_new_key": "Luo uusi avain", "Generate_New_Link": "Luo uusi linkki", "Generating_key": "Luodaan avainta", - "Get_link": "Hae linkki", "get-password-policy-forbidRepeatingCharacters": "Salasana ei saa sisältää toistuvia merkkejä", "get-password-policy-forbidRepeatingCharactersCount": "Salasana ei saa sisältää yli {{forbidRepeatingCharactersCount}} toistuvaa merkkiä", "get-password-policy-maxLength": "Salasanan on oltava enintään {{maxLength}} merkkiä pitkä", @@ -2575,7 +2574,6 @@ "Invalid_setting_s": "Virheellinen asetus: %s", "Invalid_two_factor_code": "Virheellinen kaksivaiheisen tunnistautumisen koodi", "Invalid_username": "Annettu käyttäjätunnus on virheellinen", - "Invalid_JSON": "Virheellinen JSON", "invisible": "näkymätön", "Invisible": "Näkymätön", "Invitation": "Kutsu", @@ -3265,7 +3263,6 @@ "Message_has_been_edited_by": "Viestiä on muokannut {{username}}", "Message_has_been_edited_by_at": "Viestiä on muokannut {{username}} at {{date}}", "Message_has_been_pinned": "Viesti on kiinnitetty", - "Message_has_been_shared": "Viesti on jaettu", "Message_has_been_starred": "Viesti on merkitty tähdellä", "Message_has_been_unpinned": "Viestin kiinnitys poistettu", "Message_has_been_unstarred": "Viestin tähtimerkintä poistettu", @@ -3620,6 +3617,8 @@ "omnichannel_sla_change_history": "Palvelutasosopimusta vaihdettu: {{user}} vaihtoi palvelutasosopimuksen käytännöksi {{sla}}", "Omnichannel_enable_department_removal": "Ota käyttöön osaston poistaminen", "Omnichannel_enable_department_removal_alert": "Poistettuja osastoja ei voi palauttaa, suosittelemme sen sijaan osaston arkistointia.", + "Omnichannel_Reports_Status_Open": "Avaa", + "Omnichannel_Reports_Status_Closed": "Suljettu", "On": "Käytössä", "on-hold-livechat-room": "Omnichannelin pidon huone Room", "on-hold-livechat-room_description": "Lupa asettaa Omnichannel-huone pitoon", @@ -4330,7 +4329,6 @@ "Select_an_option": "Valitse vaihtoehto", "Select_at_least_one_user": "Valitse vähintään yksi käyttäjä", "Select_at_least_two_users": "Valitse vähintään kaksi käyttäjää", - "Share_Message": "Jaa viesti", "Select_department": "Valitse osasto", "Select_file": "Valitse tiedosto", "Select_role": "Valitse rooli", @@ -4338,7 +4336,6 @@ "Select_tag": "Valitse tunniste", "Select_the_channels_you_want_the_user_to_be_removed_from": "Valitse kanavat, joista käyttäjä halutaan poistaa", "Select_the_teams_channels_you_would_like_to_delete": "Valitse Tiimin kanavat Channel jotka haluat poistaa, ne, joita et valitse, siirretään työtilaan.", - "Select_atleast_one_channel_to_share_the_messsage": "Valitse vähintään yksi kanava viestin jakamista varten", "Select_user": "Valitse käyttäjä", "Select_users": "Valitse käyttäjät", "Selected_agents": "Valitut agentit", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/fr.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/fr.i18n.json index 96a4880a3044..08641b831f94 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/fr.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/fr.i18n.json @@ -2010,7 +2010,6 @@ "Generate_new_key": "Générer une nouvelle clé", "Generate_New_Link": "Générer un nouveau lien", "Generating_key": "Génération de la clé", - "Get_link": "Obtenir le lien", "get-password-policy-forbidRepeatingCharacters": "Le mot de passe ne doit pas contenir de caractères répétitifs", "get-password-policy-forbidRepeatingCharactersCount": "Le mot de passe ne doit pas contenir plus de {{forbidRepeatingCharactersCount}} caractères répétitifs", "get-password-policy-maxLength": "Le mot de passe doit comporter au maximum {{maxLength}} caractères", @@ -3174,6 +3173,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "Clé de chiffrement (JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "Si cette clé est fournie, elle est utilisée pour chiffrer le jeton de l'utilisateur et le système externe doit déchiffrer les données pour accéder au jeton", "Omnichannel_External_Frame_URL": "URL du cadre externe", + "Omnichannel_Reports_Status_Open": "Ouvert", + "Omnichannel_Reports_Status_Closed": "Fermé", "On": "Activé", "On_Hold": "En attente", "On_Hold_Chats": "En attente", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/gl.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/gl.i18n.json index bac8e5c28aa3..5272cd9e1d3f 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/gl.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/gl.i18n.json @@ -226,6 +226,7 @@ "Offline_message": "Mensaxe fora de liña", "Offline_Message": "Mensaxe fora de liña", "Offline_messages": "Mensaxes fora de liña", + "Omnichannel_Reports_Status_Closed": "Pechado", "online": "en liña", "Online": "En liña", "Only_you_can_see_this_message": "So ti podes ver esta mensaxe", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/he.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/he.i18n.json index beefb3f030db..7f391aa806b4 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/he.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/he.i18n.json @@ -994,6 +994,8 @@ "Offline_message": "הודעה מנותקת", "Offline_success_message": "הודעת הצלחה מנותקת", "Offline_unavailable": "זמין מנותק", + "Omnichannel_Reports_Status_Open": "לִפְתוֹחַ", + "Omnichannel_Reports_Status_Closed": "סגור", "On": "פועל", "online": "זמין", "Online": "זמינים", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/hr.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/hr.i18n.json index 8c11ff0d62b7..bbad485652d1 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/hr.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/hr.i18n.json @@ -1964,6 +1964,8 @@ "Offline_success_message": "Izvanmrežna poruka uspjeha", "Offline_unavailable": "Nedostupnost izvanmrežnosti", "Older_than": "Stariji od", + "Omnichannel_Reports_Status_Open": "Otvori", + "Omnichannel_Reports_Status_Closed": "Zatvoreno", "On": "Uključeno", "online": "na liniji", "Online": "Online", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json index 3fd57ecb9a7e..d939e8ad16bb 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json @@ -2213,7 +2213,6 @@ "Generate_new_key": "Új kulcs előállítása", "Generate_New_Link": "Új hivatkozás előállítása", "Generating_key": "Kulcs előállítása", - "Get_link": "Hivatkozás lekérése", "get-password-policy-forbidRepeatingCharacters": "A jelszó nem tartalmazhat ismétlődő karaktereket", "get-password-policy-forbidRepeatingCharactersCount": "A jelszó nem tartalmazhat több mint {{forbidRepeatingCharactersCount}} ismétlődő karaktert", "get-password-policy-maxLength": "A jelszónak legfeljebb {{maxLength}} karakter hosszúságúnak kell lennie", @@ -2489,7 +2488,6 @@ "Invalid_setting_s": "Érvénytelen beállítás: %s", "Invalid_two_factor_code": "Érvénytelen kétfaktoros kód", "Invalid_username": "A megadott felhasználónév érvénytelen", - "Invalid_JSON": "Érvénytelen JSON", "invisible": "láthatatlan", "Invisible": "Láthatatlan", "Invitation": "Meghívás", @@ -3485,6 +3483,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "Titkosítási kulcs (JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "Ha meg van adva, akkor a megadott kulccsal titkosítja a felhasználó tokenjét, és a külső rendszernek vissza kell fejtenie az adatokat, hogy hozzáférjen a tokenhez.", "Omnichannel_External_Frame_URL": "Külső keret URL", + "Omnichannel_Reports_Status_Open": "Nyisd ki", + "Omnichannel_Reports_Status_Closed": "Zárva", "On": "Be", "on-hold-livechat-room": "Összcsatornás szoba várakoztatása", "on-hold-livechat-room_description": "Jogosultság az összcsatornás szoba várakoztatásához", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/id.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/id.i18n.json index ff9a52bddb49..4f78b268bcc8 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/id.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/id.i18n.json @@ -1839,6 +1839,8 @@ "Offline_success_message": "pesan sukses Offline", "Offline_unavailable": "Offline tidak tersedia", "Older_than": "Lebih tua dari", + "Omnichannel_Reports_Status_Open": "Buka", + "Omnichannel_Reports_Status_Closed": "Tutup", "On": "Di", "online": "on line", "Online": "Online", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/it.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/it.i18n.json index b2da95a84e62..498c3ea4b5fc 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/it.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/it.i18n.json @@ -1246,7 +1246,6 @@ "Gaming": "Gaming", "General": "Generale", "Generate_New_Link": "Genera nuovo link", - "Get_link": "Ottieni link", "github_no_public_email": "Non hai un email publica sul tuo account GitHub", "Give_a_unique_name_for_the_custom_oauth": "Dai un nome univoco per l'OAuth personalizzato", "strike": "barrato", @@ -1900,6 +1899,8 @@ "Offline_success_message": "Messaggio di successo offline", "Offline_unavailable": "Offline non disponibile", "Older_than": "Più vecchio di", + "Omnichannel_Reports_Status_Open": "Aperto", + "Omnichannel_Reports_Status_Closed": "Chiuso", "On": "Accendi", "online": "in linea", "Online": "Online", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ja.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ja.i18n.json index 689bdf0a8216..0bf0eb5063ae 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ja.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ja.i18n.json @@ -1992,7 +1992,6 @@ "Generate_new_key": "新しいキーを生成", "Generate_New_Link": "新しいリンクの生成", "Generating_key": "キーを生成中", - "Get_link": "リンクの取得", "get-password-policy-forbidRepeatingCharacters": "パスワードに繰り返し文字を含めないでください", "get-password-policy-forbidRepeatingCharactersCount": "パスワードに{{forbidRepeatingCharactersCount}}個を超える繰り返し文字を含めることはできません", "get-password-policy-maxLength": "パスワードは{{maxLength}}文字以内にする必要があります", @@ -3149,6 +3148,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "暗号化キー(JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "指定されている場合、提供されたキーでユーザーのトークンを暗号化します。また外部システムは、トークンにアクセスするためにデータを復号化する必要があります", "Omnichannel_External_Frame_URL": "外部フレームURL", + "Omnichannel_Reports_Status_Open": "開く", + "Omnichannel_Reports_Status_Closed": "閉鎖", "On": "オン", "On_Hold": "保留中", "On_Hold_Chats": "保留中", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ka-GE.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ka-GE.i18n.json index b9ab44fa5495..15514a726e5b 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ka-GE.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ka-GE.i18n.json @@ -1618,7 +1618,6 @@ "Generate_new_key": "შექმენით ახალი გასაღები", "Generate_New_Link": "შექმენით ახალი ბმული", "Generating_key": "გასაღების გენერაცია", - "Get_link": "მიიღეთ ბმული", "github_no_public_email": "თქვენ არ გაქვთ მითითებული საჯარო ელ.ფოსტა GitHub-თვის", "Give_a_unique_name_for_the_custom_oauth": "მიეცით უნიკალური სახელი ინდივიდუალურ oauth-ს ( ღია ავტორიზაცია)", "Give_the_application_a_name_This_will_be_seen_by_your_users": "დაარქვით აპლიკაციას სახელი.ეს ხილული იქნება თქვენთვის", @@ -2506,6 +2505,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "დაშიფვრის გასაღები(JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "გასაღების მოწოდების შემთხვევაში ეს დაშიფრავს მომხმარებლის ტოკენს და გარე სისტემებს მოუწევთ მონაცემების გაშიფვრა ტოკენის მისაღებად.", "Omnichannel_External_Frame_URL": "გარე ჩარჩოს ლინკი", + "Omnichannel_Reports_Status_Open": "გახსნა", + "Omnichannel_Reports_Status_Closed": "დახურულია", "On": "ჩართულია", "online": "ონლაინ", "Online": "ონლაინ", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/km.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/km.i18n.json index bc06b13a5749..376c4f51610a 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/km.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/km.i18n.json @@ -2138,6 +2138,8 @@ "Offline_unavailable": "មិនអាចប្រើបានក្រៅបណ្តាញ", "Old Colors": "ពណ៌ចាស់", "Older_than": "ចាស់​ជាង", + "Omnichannel_Reports_Status_Open": "បើកទូលាយ", + "Omnichannel_Reports_Status_Closed": "បិទ", "On": "បើក", "online": "អនឡាញ", "Online": "លើបណ្តាញ", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ko.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ko.i18n.json index 6cdbbf56113e..34f7608c9bed 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ko.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ko.i18n.json @@ -1763,7 +1763,6 @@ "Generate_new_key": "새 키 생성", "Generate_New_Link": "새 링크 생성", "Generating_key": "키 생성", - "Get_link": "링크 생성", "get-password-policy-forbidRepeatingCharacters": "비밀번호는 반복되는 문자를 포함하지 않아야합니다", "get-password-policy-forbidRepeatingCharactersCount": "비밀번호는 {{forbidRepeatingCharactersCount}} 반복 문자를 초과 할 수 없습니다", "get-password-policy-maxLength": "비밀번호는 최대 {{maxLength}} 자 여야합니다.", @@ -2720,6 +2719,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "암호화 키 (JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "제공된 경우 제공된 키로 사용자토큰을 암호화해야하고, 외부 시스템은 토큰에 액세스하기 위해 데이터를 해독해야합니다.", "Omnichannel_External_Frame_URL": "외부 프레임 URL", + "Omnichannel_Reports_Status_Open": "열기", + "Omnichannel_Reports_Status_Closed": "종료", "On": "켜짐", "online": "온라인", "Online": "온라인", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ku.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ku.i18n.json index 4eaeac24e15a..8441a8a2fda8 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ku.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ku.i18n.json @@ -1826,6 +1826,8 @@ "Offline_success_message": "message serkeftina is offline", "Offline_unavailable": "Ne girêdayî ne amade ye", "Older_than": "Mezintirîn", + "Omnichannel_Reports_Status_Open": "Vekirî", + "Omnichannel_Reports_Status_Closed": "Girtî", "On": "Li", "online": "online", "Online": "bike", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/lo.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/lo.i18n.json index a62baae6717a..81c5ababade7 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/lo.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/lo.i18n.json @@ -1868,6 +1868,8 @@ "Offline_success_message": "ຂໍ້ຄວາມສໍາເລັດອອຟໄລ", "Offline_unavailable": "ບໍ່ສາມາດໃຊ້ອອຟໄລ", "Older_than": "ອາ​ຍຸ​ສູງ​ກວ່າ", + "Omnichannel_Reports_Status_Open": "ເປີດ", + "Omnichannel_Reports_Status_Closed": "ປິດ", "On": "ສຸດ", "online": "ອອນໄລນ໌", "Online": "ອອນໄລນ໌", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/lt.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/lt.i18n.json index 1d68a9db90c9..8d3e1c746860 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/lt.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/lt.i18n.json @@ -1886,6 +1886,8 @@ "Offline_success_message": "Sesijos neprisijungus pranešimas", "Offline_unavailable": "Atsijungęs nepasiekiamas", "Older_than": "Vyresni nei", + "Omnichannel_Reports_Status_Open": "Atidaryta", + "Omnichannel_Reports_Status_Closed": "Uždaryta", "On": "apie", "online": "prisijungęs", "Online": "Prisijungęs", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/lv.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/lv.i18n.json index de9ed7f71f81..e658e85d3b05 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/lv.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/lv.i18n.json @@ -1844,6 +1844,8 @@ "Offline_success_message": "Bezsaistes vēstule veiksmīga", "Offline_unavailable": "Bezsaiste nav pieejama", "Older_than": "Vecāki par", + "Omnichannel_Reports_Status_Open": "Atvērt", + "Omnichannel_Reports_Status_Closed": "Aizvērts", "On": "Ieslēgts", "online": "tiešsaistē", "Online": "Tiešsaistē", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/mn.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/mn.i18n.json index 75c1882c0313..c7959fc2a85c 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/mn.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/mn.i18n.json @@ -1826,6 +1826,8 @@ "Offline_success_message": "Оффлайн амжилттай зурвас", "Offline_unavailable": "Офлайн боломжгүй байна", "Older_than": "Аас дээш насны", + "Omnichannel_Reports_Status_Open": "Нээлттэй байна", + "Omnichannel_Reports_Status_Closed": "Хаалттай байна", "On": "Дээр", "online": "онлайн байна", "Online": "Онлайн", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ms-MY.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ms-MY.i18n.json index ae8be0bd18e1..dea066ead6fd 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ms-MY.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ms-MY.i18n.json @@ -1838,6 +1838,8 @@ "Offline_success_message": "mesej kejayaan Offline", "Offline_unavailable": "luar talian tidak tersedia", "Older_than": "Lebih tua daripada", + "Omnichannel_Reports_Status_Open": "Dibuka", + "Omnichannel_Reports_Status_Closed": "ditutup", "On": "Pada", "online": "dalam talian", "Online": "Dalam talian", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/nl.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/nl.i18n.json index 5a4891a48f02..f611b39aebd4 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/nl.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/nl.i18n.json @@ -2005,7 +2005,6 @@ "Generate_new_key": "Genereer een nieuwe sleutel", "Generate_New_Link": "Genereer een nieuwe link", "Generating_key": "Sleutel genereren", - "Get_link": "Link krijgen", "get-password-policy-forbidRepeatingCharacters": "Het wachtwoord mag geen herhalende tekens bevatten", "get-password-policy-forbidRepeatingCharactersCount": "Het wachtwoord mag niet meer dan {{forbidRepeatingCharactersCount}} herhalende tekens bevatten", "get-password-policy-maxLength": "Het wachtwoord mag maximaal {{maxLength}} tekens lang zijn", @@ -3167,6 +3166,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "Versleutelingssleuten (JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "Indien verstrekt, versleutelt het het token van de gebruiker met de meegeleverde sleutel en moet het externe systeem de gegevens ontsleutelen om toegang te krijgen tot het token", "Omnichannel_External_Frame_URL": "URL van externe frame", + "Omnichannel_Reports_Status_Open": "Open", + "Omnichannel_Reports_Status_Closed": "Gesloten", "On": "Aan", "On_Hold": "In de wacht", "On_Hold_Chats": "On-hold", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/no.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/no.i18n.json index 4d148f582c36..1eb6c8ceb8bd 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/no.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/no.i18n.json @@ -1917,6 +1917,8 @@ "Offline_success_message": "Frakoblet suksessmelding", "Offline_unavailable": "Frakoblet utilgjengelig", "Older_than": "Eldre enn", + "Omnichannel_Reports_Status_Open": "Åpne", + "Omnichannel_Reports_Status_Closed": "Lukket", "On": "På", "online": "på nett", "Online": "på nett", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/pl.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/pl.i18n.json index e30eaad0bb08..0c4b85e588e0 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/pl.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/pl.i18n.json @@ -2180,7 +2180,6 @@ "Generate_new_key": "Wygeneruj nowy klucz", "Generate_New_Link": "Wygeneruj nowy link", "Generating_key": "Generowanie klucza", - "Get_link": "Skopiuj link", "get-password-policy-forbidRepeatingCharacters": "Hasło nie powinno zawierać powtarzających się znaków", "get-password-policy-forbidRepeatingCharactersCount": "Hasło nie powinno zawierać więcej niż {{forbidRepeatingCharactersCount}} powtarzających się znaków", "get-password-policy-maxLength": "Hasło powinno mieć maksymalną długość {{maxLength}} znaków", @@ -2453,7 +2452,6 @@ "Invalid_setting_s": "Nieprawidłowe ustawienie: %s", "Invalid_two_factor_code": "Nieprawidłowy kod dwuskładnikowy", "Invalid_username": "Wprowadzona nazwa użytkownika jest nieprawidłowa", - "Invalid_JSON": "Nieprawidłowy JSON", "invisible": "niewidoczny", "Invisible": "Niewidoczny", "Invitation": "Zaproszenie", @@ -3425,6 +3423,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "Klucz szyfrujący (JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "Jeśli podane, szyfruje on token użytkownika dostarczonym kluczem, a zewnętrzny system będzie musiał odszyfrować dane, aby uzyskać dostęp do tokena", "Omnichannel_External_Frame_URL": "Adres URL zewnętrznej ramki", + "Omnichannel_Reports_Status_Open": "Otwarty", + "Omnichannel_Reports_Status_Closed": "Zamknięty", "On": "Na", "on-hold-livechat-room": "Wstrzymaj Omnichannel RoomRoom", "on-hold-livechat-room_description": "Pozwolenie na wstrzymanie omnichannel roomu", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json index 931bb7bda467..de5c2356a6b9 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json @@ -5,13 +5,13 @@ "__count__empty_rooms_will_be_removed_automatically__rooms__": "{{count}} salas vazias serão removidas automaticamente:
{{rooms}}.", "__count__message_pruned": "{{count}} mensagem apagada", "__count__message_pruned_plural": "{{count}} mensagens apagadas", + "__count__conversations__period__": "{{count}} conversas, {{period}}", + "__count__tags__and__count__conversations__period__": "{{count}} tags e {{conversations}} conversas, {{period}}", + "__departments__departments_and__count__conversations__period__": "{{departments}} departmentos e {{count}} conversas, {{period}}", "__usersCount__member_joined_plural": "+ {{usersCount}} membros entraram", "__usersCount__people_will_be_invited": "{{usersCount}} usuários vão ser convidados", "__username__is_no_longer__role__defined_by__user_by_": "{{username}} não pertence mais a {{role}}, por {{user_by}}", "__username__was_set__role__by__user_by_": "{{username}} foi definido como {{role}} por {{user_by}}", - "__count__conversations__period__": "{{count}} conversas, {{period}}", - "__count__tags__and__count__conversations__period__": "{{count}} tags e {{conversations}} conversas, {{period}}", - "__departments__departments_and__count__conversations__period__": "{{departments}} departmentos e {{count}} conversas, {{period}}", "__count__without__department__": "{{count}} sem departamento", "__count__without__tags__": "{{count}} sem tags", "__count__without__assignee__": "{{count}} sem responsável", @@ -993,11 +993,6 @@ "conversation_with_s": "a conversa com %s", "Conversations": "Conversas", "Conversations_per_day": "Conversas por dia", - "Conversations_by_agents": "Conversas por agente", - "Conversations_by_channel": "Conversar por canal", - "Conversations_by_department": "Conversas por departamento", - "Conversations_by_status": "Conversas por status", - "Conversations_by_tag": "Conversas por tag", "Convert": "Converter", "Convert_Ascii_Emojis": "Converter ASCII em emoji", "Convert_to_channel": "Converter em canal", @@ -2053,7 +2048,6 @@ "Generate_new_key": "Gerar uma nova chave", "Generate_New_Link": "Gerar novo link", "Generating_key": "Gerando chave", - "Get_link": "Obter link", "get-password-policy-forbidRepeatingCharacters": "A senha não deve conter caracteres repetidos", "get-password-policy-forbidRepeatingCharactersCount": "A senha não deve conter mais de {{forbidRepeatingCharactersCount}} caracteres repetidos", "get-password-policy-maxLength": "A senha deve ter no máximo {{maxLength}} caracteres", @@ -4965,10 +4959,15 @@ "onboarding.form.standaloneServerForm.servicesUnavailable": "Alguns dos serviços estarão indisponíveis ou precisarão de configuração manual", "onboarding.form.standaloneServerForm.publishOwnApp": "Para enviar notificações de push, você precisará compilar e publicar seu próprio aplicativo no Google Play e App Store", "onboarding.form.standaloneServerForm.manuallyIntegrate": "É necessário integrar manualmente com serviços externos", + "Conversations_by_agents": "Conversas por agente", + "Conversations_by_channel": "Conversar por canal", + "Conversations_by_department": "Conversas por departamento", + "Conversations_by_status": "Conversas por status", + "Conversations_by_tag": "Conversas por tag", "Awaiting_confirmation": "Aguardando confirmação", "RegisterWorkspace_Features_MobileNotifications_Title": "Notificações push móveis", "RegisterWorkspace_Features_Marketplace_Title": "Marketplace", "RegisterWorkspace_Features_Omnichannel_Title": "Omnichannel", "RegisterWorkspace_Setup_Label": "E-mail da conta da nuvem", "cloud.RegisterWorkspace_Setup_Terms_Privacy": "Eu concordo com os <1>Termos e condições e a <3>Política de privacidade" -} +} \ No newline at end of file diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/pt.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/pt.i18n.json index 0d87a6512f51..e31b0d86bb0f 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/pt.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/pt.i18n.json @@ -1429,7 +1429,6 @@ "Full_Screen": "Tela cheia", "Gaming": "Jogos", "General": "Geral", - "Get_link": "Obter Ligação", "github_no_public_email": "Não possui um e-mail público na sua conta GitHub", "Give_a_unique_name_for_the_custom_oauth": "Dê um nome exclusivo para o oauth customizado", "strike": "tachado", @@ -2134,6 +2133,8 @@ "Old Colors": "Cores antigas", "Old Colors (minor)": "Cores antigas (menores)", "Older_than": "Mais velho que", + "Omnichannel_Reports_Status_Open": "Aberto", + "Omnichannel_Reports_Status_Closed": "Encerrado", "On": "Ligar", "online": "ligado", "Online": "Ligado", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ro.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ro.i18n.json index d7a84c0d5367..9f1326ebca11 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ro.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ro.i18n.json @@ -1830,6 +1830,8 @@ "Offline_success_message": "Mesajul de succes offline", "Offline_unavailable": "offline nu sunt disponibile", "Older_than": "Mai vechi de", + "Omnichannel_Reports_Status_Open": "Deschis", + "Omnichannel_Reports_Status_Closed": "Închis", "On": "Pe", "online": "pe net", "Online": "Activ", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ru.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ru.i18n.json index bf4713cf7bb5..8f71b6f49ab2 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ru.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ru.i18n.json @@ -2147,7 +2147,6 @@ "Generate_new_key": "Сгенерировать новый ключ", "Generate_New_Link": "Сгенерировать новую ссылку", "Generating_key": "Генерация ключа", - "Get_link": "Получить ссылку", "get-password-policy-forbidRepeatingCharacters": "Пароль не может содержать повторяющихся символов подряд", "get-password-policy-forbidRepeatingCharactersCount": "Пароль не должен содержать более {{forbidRepeatingCharactersCount}} повторяющихся символов в пароле", "get-password-policy-maxLength": "Пароль должен быть максимум {{maxLength}} символов длиной", @@ -3324,6 +3323,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "Ключ шифрования (JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "Если это предусмотрено, то токен пользователя будет зашифрован с помощью предоставленного ключа, и внешняя система должна будет расшифровать данные, чтобы получить доступ к токену", "Omnichannel_External_Frame_URL": "URL-адрес внешнего фрейма", + "Omnichannel_Reports_Status_Open": "Открыть", + "Omnichannel_Reports_Status_Closed": "Закрыто", "On": "Включено", "On_Hold": "На удержании", "On_Hold_Chats": "На удержании", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/sk-SK.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/sk-SK.i18n.json index 881d6dfc7016..dd4830288374 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/sk-SK.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/sk-SK.i18n.json @@ -1840,6 +1840,8 @@ "Offline_success_message": "Správa o úspechu offline", "Offline_unavailable": "Offline nie je k dispozícii", "Older_than": "Starší než", + "Omnichannel_Reports_Status_Open": "OTVORENÉ", + "Omnichannel_Reports_Status_Closed": "ZATVORENÉ", "On": "na", "online": "on-line", "Online": "online", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/sl-SI.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/sl-SI.i18n.json index 4655855136ae..fb52e11295fe 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/sl-SI.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/sl-SI.i18n.json @@ -1820,6 +1820,8 @@ "Offline_success_message": "Sporočilo o uspehu ob nedosegljivosti", "Offline_unavailable": "Nedosegljivo stanje ni na voljo", "Older_than": "Starejša od", + "Omnichannel_Reports_Status_Open": "Odpri", + "Omnichannel_Reports_Status_Closed": "Zaprto", "On": "Vklop", "online": "na spletu", "Online": "Dosegljiv", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/sq.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/sq.i18n.json index 9e95d7d2e600..fdb85c4fe51b 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/sq.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/sq.i18n.json @@ -1830,6 +1830,8 @@ "Offline_success_message": "Mesazhi Offline sukses", "Offline_unavailable": "Offline padisponueshëm", "Older_than": "Më të vjetër se", + "Omnichannel_Reports_Status_Open": "hapur", + "Omnichannel_Reports_Status_Closed": "Mbyllur", "On": "në", "online": "Online", "Online": "Në linjë", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/sr.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/sr.i18n.json index e86375f295fd..73a4e9f57c4e 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/sr.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/sr.i18n.json @@ -1669,6 +1669,8 @@ "Offline_success_message": "Оффлине успех порука", "Offline_unavailable": "оффлине недоступан", "Older_than": "Старији од", + "Omnichannel_Reports_Status_Open": "Отвори", + "Omnichannel_Reports_Status_Closed": "Затворено", "On": "на", "online": "на мрежи", "Online": "На мрежи", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json index e111ab9c3e42..35792cce086a 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json @@ -2292,7 +2292,6 @@ "Generate_new_key": "Generera en ny nyckel", "Generate_New_Link": "Generera en ny länk", "Generating_key": "Genererar nyckel", - "Get_link": "Kopiera länk", "get-password-policy-forbidRepeatingCharacters": "Lösenordet får inte innehålla samma tecken fler än en gång", "get-password-policy-forbidRepeatingCharactersCount": "Lösenordet får inte innehålla fler än {{forbidRepeatingCharactersCount}} upprepade tecken", "get-password-policy-maxLength": "Lösenordet får bestå av högst {{maxLength}} tecken", @@ -2579,7 +2578,6 @@ "Invalid_setting_s": "Ogiltig inställning: %s", "Invalid_two_factor_code": "Ogiltig tvåfaktorkod", "Invalid_username": "Inloggningsnamnet är ogiltigt", - "Invalid_JSON": "Ogiltig JSON", "invisible": "osynlig", "Invisible": "Osynlig", "Invitation": "Inbjudan", @@ -3270,7 +3268,6 @@ "Message_has_been_edited_by": "Meddelandet har redigerats av {{username}}", "Message_has_been_edited_by_at": "Meddelandet redigerades av {{username}} den {{date}}", "Message_has_been_pinned": "Meddelandet har fästs", - "Message_has_been_shared": "Meddelandet har delats", "Message_has_been_starred": "Meddelandet har stjärnmarkerats", "Message_has_been_unpinned": "Meddelandet har lossats", "Message_has_been_unstarred": "Meddelandets stjärnmarkeringar har tagits bort", @@ -3625,6 +3622,8 @@ "omnichannel_sla_change_history": "SLA-policyn har ändrats: {{user}} har ändrat SLA-policy till {{sla}}", "Omnichannel_enable_department_removal": "Aktivera borttagning av avdelningar", "Omnichannel_enable_department_removal_alert": "Avdelningar som tagits bort kan inte återställas, vi rekommenderar att du istället arkiverar avdelningen.", + "Omnichannel_Reports_Status_Open": "Öppna", + "Omnichannel_Reports_Status_Closed": "Stängd", "On": "På", "on-hold-livechat-room": "Parkera Omnichannel-rum", "on-hold-livechat-room_description": "Behörighet att parkera Omnichannel-rum", @@ -4335,7 +4334,6 @@ "Select_an_option": "Välj ett alternativ", "Select_at_least_one_user": "Välj åtminstone en användare", "Select_at_least_two_users": "Välj åtminstone två användare", - "Share_Message": "Dela meddelande", "Select_department": "Välj en avdelning", "Select_file": "Välj fil", "Select_role": "Välj en roll", @@ -4343,7 +4341,6 @@ "Select_tag": "Välj en tagg", "Select_the_channels_you_want_the_user_to_be_removed_from": "Välj de kanaler du vill ta bort användaren från", "Select_the_teams_channels_you_would_like_to_delete": "Välj de teamkanaler du vill ta bort. De du inte väljer flyttas till arbetsytan.", - "Select_atleast_one_channel_to_share_the_messsage": "Välj minst en kanal för att dela meddelandet", "Select_user": "Välj användare", "Select_users": "Välj användare", "Selected_agents": "Utvalda agenter", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ta-IN.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ta-IN.i18n.json index 87ea611e9dc8..b1d003f0f85c 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ta-IN.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ta-IN.i18n.json @@ -1831,6 +1831,8 @@ "Offline_success_message": "ஆஃப்லைன் வெற்றி செய்தியை", "Offline_unavailable": "ஆஃப்லைனில் கிடையாது", "Older_than": "விட பழைய", + "Omnichannel_Reports_Status_Open": "திறந்த", + "Omnichannel_Reports_Status_Closed": "மூடப்பட்ட", "On": "மீது", "online": "ஆன்லைன்", "Online": "ஆன்லைன்", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/th-TH.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/th-TH.i18n.json index a57b7da81f20..21b9d0e62439 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/th-TH.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/th-TH.i18n.json @@ -1824,6 +1824,8 @@ "Offline_success_message": "ข้อความความสำเร็จออฟไลน์", "Offline_unavailable": "ไม่มีออฟไลน์", "Older_than": "เก่ากว่า", + "Omnichannel_Reports_Status_Open": "เปิด", + "Omnichannel_Reports_Status_Closed": "ปิด", "On": "บน", "online": "ออนไลน์", "Online": "ออนไลน์", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/tr.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/tr.i18n.json index 24b5ef7f7b00..77bad5262630 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/tr.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/tr.i18n.json @@ -1451,7 +1451,6 @@ "Gaming": "Oyun", "General": "Genel", "Generate_New_Link": "Yeni Bağlantı Oluştur", - "Get_link": "Bağlantıyı Al", "github_no_public_email": "Sen GitHub hesabınızda kamu e-posta olarak herhangi bir e-posta yok", "Give_a_unique_name_for_the_custom_oauth": "Özel OAuth için benzersiz bir ad verin", "strike": "üstü çizili", @@ -2191,6 +2190,8 @@ "Old Colors (minor)": "Eski Renkler (küçük)", "Older_than": "Daha eski", "Omnichannel": "Çoklu Kanal", + "Omnichannel_Reports_Status_Open": "Aç", + "Omnichannel_Reports_Status_Closed": "Kapalı", "On": "Açık", "online": "çevrimiçi", "Online": "Çevrimiçi", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/ug.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/ug.i18n.json index 4c8759aad52c..e8838c82a80e 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/ug.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/ug.i18n.json @@ -770,6 +770,8 @@ "Offline_message": "تورسىز ئۇچۇر", "Offline_success_message": "ئۇتۇقلۇق تورسىز بولغان ئۇچۇر", "Offline_unavailable": "تورسىز ئىشلەتكىلى بولمايدۇ", + "Omnichannel_Reports_Status_Open": "ئېچىل", + "Omnichannel_Reports_Status_Closed": "ئاخىرلاشتى", "Online": "توردا", "Only_you_can_see_this_message": "پەقەت سىزلا بۇ ئۇچۇرنى كۆرەلەيسىز", "Oops!": "ئاپلا", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/uk.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/uk.i18n.json index 220552fce279..43f5ecab66a4 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/uk.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/uk.i18n.json @@ -1589,7 +1589,6 @@ "Gaming": "Ігри", "General": "Загальні", "Generate_New_Link": "Створити нове посилання", - "Get_link": "Отримати посилання", "github_no_public_email": "У Вашому обліковому записі GitHub, відсутній публічний e-mail", "Give_a_unique_name_for_the_custom_oauth": "Дайте унікальне ім'я для призначеного користувача OAuth", "strike": "страйк", @@ -2349,6 +2348,8 @@ "Offline_success_message": "Немає повідомлення про успішне виконання", "Offline_unavailable": "Offline недоступний", "Older_than": "Старше", + "Omnichannel_Reports_Status_Open": "відкритий", + "Omnichannel_Reports_Status_Closed": "Закрито", "On": "на", "online": "онлайн", "Online": "Онлайн", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/vi-VN.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/vi-VN.i18n.json index 9f4e82a71173..044baaa73720 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/vi-VN.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/vi-VN.i18n.json @@ -1931,6 +1931,8 @@ "Offline_success_message": "Tin nhắn ngoại tuyến thành công", "Offline_unavailable": "Không khả dụng ngoại tuyến", "Older_than": "Lớn tuổi hơn", + "Omnichannel_Reports_Status_Open": "Mở", + "Omnichannel_Reports_Status_Closed": "Đóng", "On": "Trên", "online": "Trực tuyến", "Online": "Trực tuyến", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/zh-HK.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/zh-HK.i18n.json index d2295fedf80d..18c3d1f9548e 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/zh-HK.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/zh-HK.i18n.json @@ -1855,6 +1855,8 @@ "Offline_success_message": "离线成功消息", "Offline_unavailable": "离线不可用", "Older_than": "年长过", + "Omnichannel_Reports_Status_Open": "开放", + "Omnichannel_Reports_Status_Closed": "关闭", "On": "上", "online": "在线", "Online": "在线", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/zh-TW.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/zh-TW.i18n.json index fef07d94e499..5ad5c0eb1d2b 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/zh-TW.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/zh-TW.i18n.json @@ -1971,7 +1971,6 @@ "Generate_new_key": "產生新的金鑰", "Generate_New_Link": "產生新的連接", "Generating_key": "產生金鑰中", - "Get_link": "取得連結", "get-password-policy-forbidRepeatingCharacters": "密碼不應包含重複字元", "get-password-policy-forbidRepeatingCharactersCount": "密碼中不得包含 {{forbidRepeatingCharactersCount}} 個重複字元", "get-password-policy-maxLength": "密碼長度不得超過 {{maxLength}} 個字元", @@ -3088,6 +3087,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "加密金鑰(JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "如果提供,它將使用提供的金鑰加密使用者的token,並且外部系統將需要解密資料以存取token", "Omnichannel_External_Frame_URL": "外部框架網址", + "Omnichannel_Reports_Status_Open": "打開", + "Omnichannel_Reports_Status_Closed": "已關閉", "On": "在", "On_Hold": "保留", "On_Hold_conversations": "保持對話", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/zh.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/zh.i18n.json index 8b08aa0c1489..df4642f4b0df 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/zh.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/zh.i18n.json @@ -1795,7 +1795,6 @@ "Generate_new_key": "生成新钥", "Generate_New_Link": "产生新链接", "Generating_key": "生成钥", - "Get_link": "获取链接", "get-password-policy-forbidRepeatingCharacters": "密码不应包含重复的字符", "get-password-policy-forbidRepeatingCharactersCount": "密码不应包含多于 {{forbidRepeatingCharactersCount}} 个重复的字符", "get-password-policy-maxLength": "密码长度最大不应超过 {{maxLength}} ", @@ -2779,6 +2778,8 @@ "Omnichannel_External_Frame_Encryption_JWK": "加密密钥(JWK)", "Omnichannel_External_Frame_Encryption_JWK_Description": "如提供则会使用提供的密钥加密用户的令牌,外部系统需要对数据进行解密才能使用令牌", "Omnichannel_External_Frame_URL": "外部框架 URL", + "Omnichannel_Reports_Status_Open": "打开", + "Omnichannel_Reports_Status_Closed": "已关闭", "On": "打开", "online": "在线", "Online": "在线", From 212ad923ffe1cff57343e1f039c78d89b3d22483 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Jaeger=20Foresti?= <60678893+juliajforesti@users.noreply.github.com> Date: Tue, 5 Sep 2023 16:52:48 -0300 Subject: [PATCH 072/275] regression: Thread badge click-animation (#30275) --- apps/meteor/tests/e2e/administration.spec.ts | 6 ++ .../fragments/admin-flextab-users.ts | 8 +- .../meteor/tests/e2e/user-invitations.spec.ts | 24 ------ .../HeaderToolboxActionBadge.tsx | 2 + yarn.lock | 86 +++++++++---------- 5 files changed, 55 insertions(+), 71 deletions(-) delete mode 100644 apps/meteor/tests/e2e/user-invitations.spec.ts diff --git a/apps/meteor/tests/e2e/administration.spec.ts b/apps/meteor/tests/e2e/administration.spec.ts index 91130728e20c..5a47a77bba99 100644 --- a/apps/meteor/tests/e2e/administration.spec.ts +++ b/apps/meteor/tests/e2e/administration.spec.ts @@ -47,6 +47,12 @@ test.describe.parallel('administration', () => { await expect(poAdmin.tabs.users.userRole).toBeVisible(); await poAdmin.tabs.users.btnSave.click(); }); + + test('expect SMTP setup warning and routing to email settings', async ({ page }) => { + await poAdmin.tabs.users.btnInvite.click(); + await poAdmin.tabs.users.setupSmtpLink.click(); + await expect(page).toHaveURL('/admin/settings/Email'); + }); }); test.describe('Rooms', () => { diff --git a/apps/meteor/tests/e2e/page-objects/fragments/admin-flextab-users.ts b/apps/meteor/tests/e2e/page-objects/fragments/admin-flextab-users.ts index f4b5104a9a84..bd46de6ea00f 100644 --- a/apps/meteor/tests/e2e/page-objects/fragments/admin-flextab-users.ts +++ b/apps/meteor/tests/e2e/page-objects/fragments/admin-flextab-users.ts @@ -15,6 +15,10 @@ export class AdminFlextabUsers { return this.page.locator('role=button[name="Save"]'); } + get btnInvite(): Locator { + return this.page.locator('role=button[name="Invite"]'); + } + get inputName(): Locator { return this.page.locator('//label[text()="Name"]/following-sibling::span//input'); } @@ -44,10 +48,6 @@ export class AdminFlextabUsers { await this.page.locator(`li[value=${role}]`).click(); } - get inviteUsersTitle(): Locator { - return this.page.locator('aside >> text="Invite Members"'); - } - get setupSmtpLink(): Locator { return this.page.locator('role=link[name="Set up SMTP"]') } diff --git a/apps/meteor/tests/e2e/user-invitations.spec.ts b/apps/meteor/tests/e2e/user-invitations.spec.ts deleted file mode 100644 index 4bcdf82d6f43..000000000000 --- a/apps/meteor/tests/e2e/user-invitations.spec.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { Users } from './fixtures/userStates'; -import { Admin } from './page-objects'; -import { test, expect } from './utils/test'; - -test.use({ storageState: Users.admin.state }); - -test.describe.serial('user-invites', () => { - let poAdmin: Admin; - - test.beforeEach(async ({ page }) => { - poAdmin = new Admin(page); - await page.goto('/admin/users/invite'); - - await expect(poAdmin.tabs.users.inviteUsersTitle).toBeVisible(); - }); - - test('expect SMTP setup warning and routing to email settings', async ({ page }) => { - await expect(poAdmin.tabs.users.setupSmtpLink).toBeVisible(); - - await poAdmin.tabs.users.setupSmtpLink.click(); - - await expect(page).toHaveURL('/admin/settings/Email'); - }); -}); diff --git a/packages/ui-client/src/components/Header/HeaderToolbox/HeaderToolboxActionBadge.tsx b/packages/ui-client/src/components/Header/HeaderToolbox/HeaderToolboxActionBadge.tsx index c05cc3341816..d8da9762de9c 100644 --- a/packages/ui-client/src/components/Header/HeaderToolbox/HeaderToolboxActionBadge.tsx +++ b/packages/ui-client/src/components/Header/HeaderToolbox/HeaderToolboxActionBadge.tsx @@ -5,10 +5,12 @@ import type { ComponentProps, FC } from 'react'; const HeaderToolboxActionBadge: FC> = (props) => ( diff --git a/yarn.lock b/yarn.lock index d14adeed87af..68ef61bc51eb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7917,16 +7917,16 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/css-in-js@npm:~0.31.26-dev.18": - version: 0.31.26-dev.18 - resolution: "@rocket.chat/css-in-js@npm:0.31.26-dev.18" +"@rocket.chat/css-in-js@npm:~0.31.26-dev.20": + version: 0.31.26-dev.20 + resolution: "@rocket.chat/css-in-js@npm:0.31.26-dev.20" dependencies: "@emotion/hash": ^0.9.0 - "@rocket.chat/css-supports": ~0.31.26-dev.18 - "@rocket.chat/memo": ~0.31.26-dev.18 - "@rocket.chat/stylis-logical-props-middleware": ~0.31.26-dev.18 + "@rocket.chat/css-supports": ~0.31.26-dev.20 + "@rocket.chat/memo": ~0.31.26-dev.20 + "@rocket.chat/stylis-logical-props-middleware": ~0.31.26-dev.20 stylis: ~4.1.3 - checksum: 1b4190a2463a0fb9e60c588383951d10aa0d7b501855dd6340ffcc6f1af116c93b3370e9acf03724151a59a53c6f5a111678a3454b23e8fed04a1843ebb31331 + checksum: 0898cc5e6493c67db0623d73896f07e035639d1714942fb7cd28ccf2f050f5e0f6742d75e91ab746b8745524bac86e367e3bec08baf815515a0759673e4d270d languageName: node linkType: hard @@ -7943,12 +7943,12 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/css-supports@npm:~0.31.26-dev.18": - version: 0.31.26-dev.18 - resolution: "@rocket.chat/css-supports@npm:0.31.26-dev.18" +"@rocket.chat/css-supports@npm:~0.31.26-dev.20": + version: 0.31.26-dev.20 + resolution: "@rocket.chat/css-supports@npm:0.31.26-dev.20" dependencies: - "@rocket.chat/memo": ~0.31.26-dev.18 - checksum: 08fe45007b8edaa7a0baedfec0434dab51aa240e20c01f6762906b0841d7871aa5b9a1d91abb0dd0fcf7779b93067d6e6a67f31a59759bf178067c1d660670a2 + "@rocket.chat/memo": ~0.31.26-dev.20 + checksum: 6e123c782288e3dbf18e7c54aabac254d8d041d1592dc08e758519ae1bf54ed33f92ce9b08a47e31b0d5315df7a260cba78fca02ed6c3fd0992405559821bc6a languageName: node linkType: hard @@ -8173,10 +8173,10 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/fuselage-tokens@npm:~0.32.0-dev.378": - version: 0.32.0-dev.378 - resolution: "@rocket.chat/fuselage-tokens@npm:0.32.0-dev.378" - checksum: 2db23b7c013c3a1c290f0a663305dd9d3db4a8bd49b22fde8d17abf411c673f22147599d427595731380021649e125d410dc15e9b6e384530238688240630a64 +"@rocket.chat/fuselage-tokens@npm:~0.32.0-dev.380": + version: 0.32.0-dev.380 + resolution: "@rocket.chat/fuselage-tokens@npm:0.32.0-dev.380" + checksum: b1300376eafba878a07e7c3ae2d434f38b7388bc5fe2d1fa3d87d3e9513f426b1734ec0d4aaa05cfa70c01a1d6ca3bb06119145f812a00b64d1da9ca5bf17845 languageName: node linkType: hard @@ -8236,14 +8236,14 @@ __metadata: linkType: soft "@rocket.chat/fuselage@npm:next": - version: 0.32.0-dev.428 - resolution: "@rocket.chat/fuselage@npm:0.32.0-dev.428" - dependencies: - "@rocket.chat/css-in-js": ~0.31.26-dev.18 - "@rocket.chat/css-supports": ~0.31.26-dev.18 - "@rocket.chat/fuselage-tokens": ~0.32.0-dev.378 - "@rocket.chat/memo": ~0.31.26-dev.18 - "@rocket.chat/styled": ~0.31.26-dev.18 + version: 0.32.0-dev.430 + resolution: "@rocket.chat/fuselage@npm:0.32.0-dev.430" + dependencies: + "@rocket.chat/css-in-js": ~0.31.26-dev.20 + "@rocket.chat/css-supports": ~0.31.26-dev.20 + "@rocket.chat/fuselage-tokens": ~0.32.0-dev.380 + "@rocket.chat/memo": ~0.31.26-dev.20 + "@rocket.chat/styled": ~0.31.26-dev.20 invariant: ^2.2.4 react-aria: ~3.23.1 react-keyed-flatten-children: ^1.3.0 @@ -8255,7 +8255,7 @@ __metadata: react: ^17.0.2 react-dom: ^17.0.2 react-virtuoso: 1.2.4 - checksum: 7f39b64138d77fb9956f821f0a3c638fee38d1f66f1cf243983eed7683ca442096b76ec09bf282fe6f9caf4c6fbab0b38b3fe6310f0fcbc9afd1f09d39f95cf3 + checksum: 5b09c6d0fac32e7b353891c898e1e3ba929af9b8fd9b2d41de9d0e1e1d17cc04101b713934dd59a58a09a301673a1299a688d017e9c86db28a65aeb6d1b1e32e languageName: node linkType: hard @@ -8513,10 +8513,10 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/memo@npm:~0.31.26-dev.18": - version: 0.31.26-dev.18 - resolution: "@rocket.chat/memo@npm:0.31.26-dev.18" - checksum: c3006dc08e1f3e5e1ac95cc23f52a4d5445971c5dbb985023128a7e4f8e929913a5103d4c4b7fdbd2848b1982a32440dc64f3894caaa293c774232160fbe4b71 +"@rocket.chat/memo@npm:~0.31.26-dev.20": + version: 0.31.26-dev.20 + resolution: "@rocket.chat/memo@npm:0.31.26-dev.20" + checksum: 72db6d791028eaff24533c29f633f5abcaa33b78d335c3a04af6baef4b102c912b7176a43ab8a8886c2b49513a892d7da0c4b28620dfd43e867c0c5e06730897 languageName: node linkType: hard @@ -9358,15 +9358,6 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/styled@npm:~0.31.26-dev.18": - version: 0.31.26-dev.18 - resolution: "@rocket.chat/styled@npm:0.31.26-dev.18" - dependencies: - "@rocket.chat/css-in-js": ~0.31.26-dev.18 - checksum: 54ede68d3ab24aa0a685bc55148e52a7e17e394d5f16f7114df64633733ca3c9fd39ba30036065ca16636cff6ef9c045a2a82024c0597d9864e77d49e1e56636 - languageName: node - linkType: hard - "@rocket.chat/styled@npm:~0.31.26-dev.2": version: 0.31.26-dev.7 resolution: "@rocket.chat/styled@npm:0.31.26-dev.7" @@ -9376,14 +9367,23 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/stylis-logical-props-middleware@npm:~0.31.26-dev.18": - version: 0.31.26-dev.18 - resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.26-dev.18" +"@rocket.chat/styled@npm:~0.31.26-dev.20": + version: 0.31.26-dev.20 + resolution: "@rocket.chat/styled@npm:0.31.26-dev.20" + dependencies: + "@rocket.chat/css-in-js": ~0.31.26-dev.20 + checksum: 6e068f46b81681ecca4c0d4ca9f1d207948d1f50cc49edc059573d66093aa1bab303d720d04dc59f48fa6044ed4bf71e336b0ef261d84b84e28b85f4596a3508 + languageName: node + linkType: hard + +"@rocket.chat/stylis-logical-props-middleware@npm:~0.31.26-dev.20": + version: 0.31.26-dev.20 + resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.26-dev.20" dependencies: - "@rocket.chat/css-supports": ~0.31.26-dev.18 + "@rocket.chat/css-supports": ~0.31.26-dev.20 peerDependencies: stylis: 4.0.10 - checksum: 5dd4b4d242d568549c6f2dfd8c0ef85d605176b05214d85f3bbd48f648836a287a404d8e44647e383400232f599e80ba34da377af9d960f452f8716489f862f6 + checksum: 917b96f677478bf9b6e0b553b59019f28bdbedcb18e5e61fffc73631c003ecadc4ac81c370d4205c6553638e88f6dfff49f70e6bf3e192283e8b5e10e912b54c languageName: node linkType: hard From db919f9b23b81c13b653303faab5500cc8a2564e Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Tue, 5 Sep 2023 20:13:30 +0000 Subject: [PATCH 073/275] Bump 6.3.4 --- .changeset/bump-patch-1693944810152.md | 5 +++++ yarn.lock | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/bump-patch-1693944810152.md diff --git a/.changeset/bump-patch-1693944810152.md b/.changeset/bump-patch-1693944810152.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1693944810152.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/yarn.lock b/yarn.lock index 251222652634..95498d62f3b3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9898,9 +9898,9 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.2 + "@rocket.chat/ui-contexts": 1.0.3 "@rocket.chat/ui-kit": "*" - "@rocket.chat/ui-video-conf": 1.0.2 + "@rocket.chat/ui-video-conf": 1.0.3 "@tanstack/react-query": "*" react: "*" react-dom: "*" @@ -9982,14 +9982,14 @@ __metadata: ts-jest: ~29.0.5 typescript: ~5.1.3 peerDependencies: - "@rocket.chat/core-typings": 6.3.2 + "@rocket.chat/core-typings": 6.3.3 "@rocket.chat/css-in-js": "*" "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-tokens": "*" "@rocket.chat/message-parser": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-client": 1.0.2 - "@rocket.chat/ui-contexts": 1.0.2 + "@rocket.chat/ui-client": 1.0.3 + "@rocket.chat/ui-contexts": 1.0.3 katex: "*" react: "*" languageName: unknown @@ -11048,7 +11048,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 1.0.2 + "@rocket.chat/ui-contexts": 1.0.3 react: ~17.0.2 languageName: unknown linkType: soft @@ -11202,7 +11202,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.2 + "@rocket.chat/ui-contexts": 1.0.3 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -11268,7 +11268,7 @@ __metadata: typescript: ~5.1.3 peerDependencies: "@rocket.chat/layout": "*" - "@rocket.chat/ui-contexts": 1.0.2 + "@rocket.chat/ui-contexts": 1.0.3 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From ebeb088441777a3c32bba0d4d50a048e3e9f5b8c Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Mon, 4 Sep 2023 13:33:57 -0600 Subject: [PATCH 074/275] fix: Prevent `RoomProvider.useEffect` from subscribing multiple times (#30273) --- .changeset/forty-hotels-pretend.md | 5 +++++ .../views/room/providers/RoomProvider.tsx | 22 ++++++++++--------- 2 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 .changeset/forty-hotels-pretend.md diff --git a/.changeset/forty-hotels-pretend.md b/.changeset/forty-hotels-pretend.md new file mode 100644 index 000000000000..b23825d5a02a --- /dev/null +++ b/.changeset/forty-hotels-pretend.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +fix: Prevent `RoomProvider.useEffect` from subscribing to room-data stream multiple times diff --git a/apps/meteor/client/views/room/providers/RoomProvider.tsx b/apps/meteor/client/views/room/providers/RoomProvider.tsx index b2935f4702ea..20da5194895f 100644 --- a/apps/meteor/client/views/room/providers/RoomProvider.tsx +++ b/apps/meteor/client/views/room/providers/RoomProvider.tsx @@ -1,5 +1,4 @@ import type { IRoom } from '@rocket.chat/core-typings'; -import { isOmnichannelRoom } from '@rocket.chat/core-typings'; import { usePermission, useStream, useUserId, useRouter } from '@rocket.chat/ui-contexts'; import { useQueryClient } from '@tanstack/react-query'; import type { ReactNode, ContextType, ReactElement } from 'react'; @@ -36,17 +35,18 @@ const RoomProvider = ({ rid, children }: RoomProviderProps): ReactElement => { const queryClient = useQueryClient(); const userId = useUserId(); const isLivechatAdmin = usePermission('view-livechat-rooms'); + const { t: roomType } = room ?? {}; // TODO: move this to omnichannel context only useEffect(() => { - if (!room || !isOmnichannelRoom(room)) { + if (roomType !== 'l') { return; } return subscribeToRoom(rid, (room) => { queryClient.setQueryData(['rooms', rid], room); }); - }, [subscribeToRoom, rid, queryClient, room]); + }, [subscribeToRoom, rid, queryClient, roomType]); // TODO: the following effect is a workaround while we don't have a general and definitive solution for it const router = useRouter(); @@ -56,19 +56,21 @@ const RoomProvider = ({ rid, children }: RoomProviderProps): ReactElement => { } }, [isSuccess, room, router]); + const { _id: servedById } = room?.servedBy ?? {}; + // TODO: Review the necessity of this effect when we move away from cached collections useEffect(() => { - if (!room || !isOmnichannelRoom(room) || !room.servedBy) { + if (roomType !== 'l' || !servedById) { return; } - if (!isLivechatAdmin && room.servedBy._id !== userId) { - ChatRoom.remove(room._id); - queryClient.removeQueries(['rooms', room._id]); - queryClient.removeQueries(['rooms', { reference: room._id, type: 'l' }]); - queryClient.removeQueries(['/v1/rooms.info', room._id]); + if (!isLivechatAdmin && servedById !== userId) { + ChatRoom.remove(rid); + queryClient.removeQueries(['rooms', rid]); + queryClient.removeQueries(['rooms', { reference: rid, type: 'l' }]); + queryClient.removeQueries(['/v1/rooms.info', rid]); } - }, [isLivechatAdmin, queryClient, userId, room]); + }, [isLivechatAdmin, queryClient, userId, rid, roomType, servedById]); const subscriptionQuery = useReactiveQuery(['subscriptions', { rid }], () => ChatSubscription.findOne({ rid }) ?? null); From f800e43110c9746df86c3feaddd07980bc0e29e9 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 5 Sep 2023 23:49:41 -0300 Subject: [PATCH 075/275] test: enable http cache for tests (#30278) --- .github/workflows/ci-test-e2e.yml | 5 +- apps/meteor/package.json | 1 + apps/meteor/playwright.config.ts | 3 + apps/meteor/playwright.prepare.mjs | 9 ++ .../tests/e2e/channel-management.spec.ts | 20 ++--- apps/meteor/tests/e2e/homepage.spec.ts | 82 ++++++++++--------- .../omnichannel/omnichannel-livechat.spec.ts | 1 + .../omnichannel-priorities-sidebar.spec.ts | 1 + .../page-objects/fragments/home-sidenav.ts | 3 + .../tests/e2e/page-objects/home-channel.ts | 9 ++ .../e2e/page-objects/omnichannel-livechat.ts | 2 +- 11 files changed, 84 insertions(+), 52 deletions(-) create mode 100644 apps/meteor/playwright.prepare.mjs diff --git a/.github/workflows/ci-test-e2e.yml b/.github/workflows/ci-test-e2e.yml index e22b293d444b..9a05543605db 100644 --- a/.github/workflows/ci-test-e2e.yml +++ b/.github/workflows/ci-test-e2e.yml @@ -209,8 +209,11 @@ jobs: REPORTER_ROCKETCHAT_DRAFT: ${{ github.event.pull_request.draft }} QASE_API_TOKEN: ${{ secrets.QASE_API_TOKEN }} QASE_REPORT: ${{ github.ref == 'refs/heads/develop' && 'true' || '' }} + CI: true working-directory: ./apps/meteor - run: yarn test:e2e --shard=${{ matrix.shard }}/${{ inputs.total-shard }} + run: | + yarn prepare + yarn test:e2e --shard=${{ matrix.shard }}/${{ inputs.total-shard }} - name: Store playwright test trace if: inputs.type == 'ui' && always() diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 427ad86ddca3..c2e17b3e82c3 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -50,6 +50,7 @@ "set-version": "node .scripts/set-version.js", "release": "meteor npm run set-version --silent", "storybook": "cross-env NODE_OPTIONS=--max-old-space-size=8192 start-storybook -p 6006 --no-version-updates", + "prepare": "node playwright.prepare.mjs", "docker:start": "docker-compose up" }, "license": "MIT", diff --git a/apps/meteor/playwright.config.ts b/apps/meteor/playwright.config.ts index d94efbf60399..329d4daa1947 100644 --- a/apps/meteor/playwright.config.ts +++ b/apps/meteor/playwright.config.ts @@ -5,6 +5,7 @@ import * as constants from './tests/e2e/config/constants'; export default { globalSetup: require.resolve('./tests/e2e/config/global-setup.ts'), use: { + channel: 'chromium', headless: true, ignoreHTTPSErrors: true, trace: 'retain-on-failure', @@ -51,4 +52,6 @@ export default { timeout: 60 * 1000, globalTimeout: (process.env.IS_EE === 'true' ? 50 : 40) * 60 * 1000, maxFailures: process.env.CI ? 5 : undefined, + // Retry on CI only. + retries: process.env.CI ? 2 : 0, } as PlaywrightTestConfig; diff --git a/apps/meteor/playwright.prepare.mjs b/apps/meteor/playwright.prepare.mjs new file mode 100644 index 000000000000..5f3a20f21623 --- /dev/null +++ b/apps/meteor/playwright.prepare.mjs @@ -0,0 +1,9 @@ +// prepare.js + +import { readFileSync, writeFileSync } from 'fs'; +import path from 'path'; + +const modules = path.resolve(`node_modules`); +const destination = path.join(modules, 'playwright-core', 'lib', 'server', 'chromium', 'crNetworkManager.js'); +const buffer = readFileSync(destination); +writeFileSync(destination, buffer.toString().replace('cacheDisabled: true', 'cacheDisabled: false')); diff --git a/apps/meteor/tests/e2e/channel-management.spec.ts b/apps/meteor/tests/e2e/channel-management.spec.ts index 7c1533282519..7cad1be43cbf 100644 --- a/apps/meteor/tests/e2e/channel-management.spec.ts +++ b/apps/meteor/tests/e2e/channel-management.spec.ts @@ -11,13 +11,9 @@ test.use({ storageState: Users.admin.state }); test.describe.serial('channel-management', () => { let poHomeChannel: HomeChannel; let targetChannel: string; - let regularUserPage: Page; - test.beforeAll(async ({ api, browser }) => { + test.beforeAll(async ({ api }) => { targetChannel = await createTargetChannel(api); - regularUserPage = await browser.newPage({ storageState: Users.user2.state }); - await regularUserPage.goto('/home'); - await regularUserPage.waitForSelector('[data-qa-id="home-header"]'); }); test.beforeEach(async ({ page }) => { @@ -26,10 +22,6 @@ test.describe.serial('channel-management', () => { await page.goto('/home'); }); - test.afterAll(async () => { - await regularUserPage.close(); - }); - test('expect add "user1" to "targetChannel"', async () => { await poHomeChannel.sidenav.openChat(targetChannel); await poHomeChannel.tabs.btnTabMembers.click(); @@ -113,7 +105,8 @@ test.describe.serial('channel-management', () => { await expect(poHomeChannel.toastSuccess).toBeVisible(); }); - test('expect "readOnlyChannel" to show join button', async () => { + let regularUserPage: Page; + test('expect "readOnlyChannel" to show join button', async ({ browser }) => { const channelName = faker.string.uuid(); await poHomeChannel.sidenav.openNewByLabel('Channel'); @@ -122,8 +115,15 @@ test.describe.serial('channel-management', () => { await poHomeChannel.sidenav.checkboxReadOnly.click(); await poHomeChannel.sidenav.btnCreate.click(); + regularUserPage = await browser.newPage({ storageState: Users.user2.state }); + + const channel = new HomeChannel(regularUserPage); + await regularUserPage.goto(`/channel/${channelName}`); + await channel.waitForChannel(); await expect(regularUserPage.locator('button >> text="Join"')).toBeVisible(); + + await regularUserPage.close(); }); test.skip('expect all notification preferences of "targetChannel" to be "Mentions"', async () => { diff --git a/apps/meteor/tests/e2e/homepage.spec.ts b/apps/meteor/tests/e2e/homepage.spec.ts index 465ecea03cbf..380fa54d2af3 100644 --- a/apps/meteor/tests/e2e/homepage.spec.ts +++ b/apps/meteor/tests/e2e/homepage.spec.ts @@ -26,16 +26,21 @@ test.describe.serial('homepage', () => { await adminPage.waitForSelector('[data-qa-id="home-header"]'); }); + test.afterAll(async ({ api }) => { + expect((await api.post('/settings/Layout_Home_Custom_Block_Visible', { value: false })).status()).toBe(200); + expect((await api.post('/settings/Layout_Custom_Body_Only', { value: false })).status()).toBe(200); + await adminPage.close(); + }); + test('layout', async () => { await test.step('expect show customize button', async () => { await expect(adminPage.locator('role=button[name="Customize"]')).toBeVisible(); }); - + await test.step('expect all cards to be visible', async () => { await Promise.all(Object.values(CardIds).map((id) => expect(adminPage.locator(`[data-qa-id="${id}"]`)).toBeVisible())); }); - }) - + }); test.describe('custom body with empty custom content', async () => { test.beforeAll(async ({ api }) => { @@ -48,17 +53,16 @@ test.describe.serial('homepage', () => { adminPage.locator('role=status[name="Admins may insert content html to be rendered in this white space."]'), ).toBeVisible(); }); - + await test.step('expect both change visibility and show only custom content buttons to be disabled', async () => { await expect(adminPage.locator('role=button[name="Show to workspace"]')).toBeDisabled(); await expect(adminPage.locator('role=button[name="Show only this content"]')).toBeDisabled(); }); - + await test.step('expect visibility tag to show "not visible"', async () => { await expect(adminPage.locator('role=status[name="Not visible to workspace"]')).toBeVisible(); }); - }) - + }); }); test.describe('custom body with custom content', () => { @@ -66,17 +70,16 @@ test.describe.serial('homepage', () => { await expect((await api.post('/settings/Layout_Home_Body', { value: 'Hello admin' })).status()).toBe(200); }); - test('layout', async() => { + test('layout', async () => { await test.step('expect custom body to be visible', async () => { await expect(adminPage.locator('role=status[name="Hello admin"]')).toBeVisible(); }); - + await test.step('expect correct state for card buttons', async () => { await expect(adminPage.locator('role=button[name="Show to workspace"]')).not.toBeDisabled(); await expect(adminPage.locator('role=button[name="Show only this content"]')).toBeDisabled(); }); - }) - + }); test.describe('enterprise edition', () => { test.skip(!IS_EE, 'Enterprise Only'); @@ -103,12 +106,6 @@ test.describe.serial('homepage', () => { }); }); }); - - test.afterAll(async ({ api }) => { - expect((await api.post('/settings/Layout_Home_Custom_Block_Visible', { value: false })).status()).toBe(200); - expect((await api.post('/settings/Layout_Custom_Body_Only', { value: false })).status()).toBe(200); - await adminPage.close(); - }); }); test.describe('for regular users', () => { @@ -121,23 +118,31 @@ test.describe.serial('homepage', () => { await regularUserPage.waitForSelector('[data-qa-id="home-header"]'); }); + test.afterAll(async () => { + await regularUserPage.close(); + }); + test('layout', async () => { await test.step('expect to not show customize button', async () => { await expect(regularUserPage.locator('role=button[name="Customize"]')).not.toBeVisible(); }); - + await test.step(`expect ${notVisibleCards.join(' and ')} cards to not be visible`, async () => { await Promise.all(notVisibleCards.map((id) => expect(regularUserPage.locator(`[data-qa-id="${id}"]`)).not.toBeVisible())); }); - + await test.step('expect all other cards to be visible', async () => { - await Promise.all(Object.values(CardIds).filter((id) => !notVisibleCards.includes(id)).map((id) => expect(regularUserPage.locator(`[data-qa-id="${id}"]`)).toBeVisible())); + await Promise.all( + Object.values(CardIds) + .filter((id) => !notVisibleCards.includes(id)) + .map((id) => expect(regularUserPage.locator(`[data-qa-id="${id}"]`)).toBeVisible()), + ); }); - + await test.step('expect welcome text to use Site_Name default setting', async () => { await expect(regularUserPage.locator('role=heading[name="Welcome to Rocket.Chat"]')).toBeVisible(); }); - + await test.step('expect header text to use Layout_Home_Title default setting', async () => { await expect(regularUserPage.locator('[data-qa-type="PageHeader-title"]')).toContainText('Home'); }); @@ -152,20 +157,19 @@ test.describe.serial('homepage', () => { await regularUserPage.waitForSelector('[data-qa-id="home-header"]'); }); + test.afterAll(async ({ api }) => { + expect((await api.post('/settings/Site_Name', { value: 'Rocket.Chat' })).status()).toBe(200); + expect((await api.post('/settings/Layout_Home_Title', { value: 'Home' })).status()).toBe(200); + }); + test('layout', async () => { await test.step('expect welcome text to be NewSiteName', async () => { await expect(regularUserPage.locator('role=heading[name="Welcome to NewSiteName"]')).toBeVisible(); }); - + await test.step('expect header text to be Layout_Home_Title setting', async () => { await expect(regularUserPage.locator('[data-qa-type="PageHeader-title"]')).toContainText('NewTitle'); }); - }) - - - test.afterAll(async ({ api }) => { - expect((await api.post('/settings/Site_Name', { value: 'Rocket.Chat' })).status()).toBe(200); - expect((await api.post('/settings/Layout_Home_Title', { value: 'Home' })).status()).toBe(200); }); }); @@ -178,6 +182,10 @@ test.describe.serial('homepage', () => { await regularUserPage.waitForSelector('[data-qa-id="home-header"]'); }); + test.afterAll(async ({ api }) => { + expect((await api.post('/settings/Layout_Home_Body', { value: '' })).status()).toBe(200); + expect((await api.post('/settings/Layout_Home_Custom_Block_Visible', { value: false })).status()).toBe(200); + }); test('expect custom body to be visible', async () => { await expect(regularUserPage.locator('role=status[name="Hello"]')).toBeVisible(); @@ -190,26 +198,20 @@ test.describe.serial('homepage', () => { expect((await api.post('/settings/Layout_Custom_Body_Only', { value: true })).status()).toBe(200); }); + test.afterAll(async ({ api }) => { + expect((await api.post('/settings/Layout_Custom_Body_Only', { value: false })).status()).toBe(200); + }); + test('layout', async () => { await test.step('expect default layout to not be visible', async () => { await expect(regularUserPage.locator('[data-qa-id="homepage-welcome-text"]')).not.toBeVisible(); }); - + await test.step('expect custom body to be visible', async () => { await expect(regularUserPage.locator('role=status[name="Hello"]')).toBeVisible(); }); - }) - - - test.afterAll(async ({ api }) => { - expect((await api.post('/settings/Layout_Custom_Body_Only', { value: false })).status()).toBe(200); }); }); - - test.afterAll(async ({ api }) => { - expect((await api.post('/settings/Layout_Home_Body', { value: '' })).status()).toBe(200); - expect((await api.post('/settings/Layout_Home_Custom_Block_Visible', { value: false })).status()).toBe(200); - }); }); }); }); diff --git a/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat.spec.ts b/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat.spec.ts index c5250b1d1150..8d8bf3eed191 100644 --- a/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat.spec.ts +++ b/apps/meteor/tests/e2e/omnichannel/omnichannel-livechat.spec.ts @@ -32,6 +32,7 @@ test.describe('Livechat', () => { test.afterAll(async ({ api }) => { await api.delete('/livechat/users/agent/user1'); await poAuxContext.page.close(); + await page.close(); }); test('Send message to online agent', async () => { diff --git a/apps/meteor/tests/e2e/omnichannel/omnichannel-priorities-sidebar.spec.ts b/apps/meteor/tests/e2e/omnichannel/omnichannel-priorities-sidebar.spec.ts index b521090e7097..559d24889633 100644 --- a/apps/meteor/tests/e2e/omnichannel/omnichannel-priorities-sidebar.spec.ts +++ b/apps/meteor/tests/e2e/omnichannel/omnichannel-priorities-sidebar.spec.ts @@ -65,6 +65,7 @@ test.describe.serial('Omnichannel Priorities [Sidebar]', () => { await poLivechat.onlineAgentMessage.type('this_a_test_message_from_visitor'); await poLivechat.btnSendMessageToOnlineAgent.click(); await poHomeChannel.sidenav.getSidebarItemByName(NEW_USER.name).click(); + await poLivechat.page.close(); }); await test.step('Queue: Sidebar priority change', async () => { diff --git a/apps/meteor/tests/e2e/page-objects/fragments/home-sidenav.ts b/apps/meteor/tests/e2e/page-objects/fragments/home-sidenav.ts index 5e5e3f93bfb6..4f3d7b4886eb 100644 --- a/apps/meteor/tests/e2e/page-objects/fragments/home-sidenav.ts +++ b/apps/meteor/tests/e2e/page-objects/fragments/home-sidenav.ts @@ -75,7 +75,10 @@ export class HomeSidenav { await this.page.locator('role=navigation >> role=button[name=Search]').click(); await this.page.locator('role=search >> role=searchbox').type(name); await this.page.locator(`role=search >> role=listbox >> role=link >> text="${name}"`).click(); + await this.waitForChannel(); + } + async waitForChannel(): Promise { await this.page.locator('role=main').waitFor(); await this.page.locator('role=main >> role=heading[level=1]').waitFor(); diff --git a/apps/meteor/tests/e2e/page-objects/home-channel.ts b/apps/meteor/tests/e2e/page-objects/home-channel.ts index 1d6e450d9764..d2f43c5cfec5 100644 --- a/apps/meteor/tests/e2e/page-objects/home-channel.ts +++ b/apps/meteor/tests/e2e/page-objects/home-channel.ts @@ -1,5 +1,6 @@ import type { Locator, Page } from '@playwright/test'; +import { expect } from '../utils/test'; import { HomeContent, HomeSidenav, HomeFlextab } from './fragments'; export class HomeChannel { @@ -25,4 +26,12 @@ export class HomeChannel { get btnContextualbarClose(): Locator { return this.page.locator('[data-qa="ContextualbarActionClose"]'); } + + async waitForChannel(): Promise { + await this.page.locator('role=main').waitFor(); + await this.page.locator('role=main >> role=heading[level=1]').waitFor(); + + await expect(this.page.locator('role=main >> .rcx-skeleton')).toHaveCount(0); + await expect(this.page.locator('role=main >> role=list')).not.toHaveAttribute('aria-busy', 'true'); + } } diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts index 754ab9c01d7a..b4a7c9b92345 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts @@ -1,7 +1,7 @@ import type { Page, Locator, APIResponse } from '@playwright/test'; export class OmnichannelLiveChat { - private readonly page: Page; + readonly page: Page; constructor(page: Page, private readonly api: { get(url: string): Promise }) { this.page = page; From 3dfede27033722775c7ee972304ab0630a3ccac1 Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Tue, 5 Sep 2023 23:51:18 -0300 Subject: [PATCH 076/275] chore: Move a11y violation tests to Playwright (#30293) --- .../AccountFeaturePreviewPage.spec.tsx | 30 ---- .../OmnichannelPreferencesPage.spec.tsx | 19 --- .../views/admin/mailer/MailerPage.spec.tsx | 17 --- .../currentChats/CurrentChatsPage.spec.tsx | 17 --- apps/meteor/package.json | 3 +- apps/meteor/tests/e2e/account-profile.spec.ts | 132 ++++++++++++++++++ apps/meteor/tests/e2e/administration.spec.ts | 11 ++ .../omnichannel-current-chats.spec.ts | 15 ++ .../e2e/settings-account-profile.spec.ts | 101 -------------- apps/meteor/tests/e2e/utils/test.ts | 8 ++ yarn.lock | 85 ++++------- 11 files changed, 194 insertions(+), 244 deletions(-) delete mode 100644 apps/meteor/client/views/account/featurePreview/AccountFeaturePreviewPage.spec.tsx delete mode 100644 apps/meteor/client/views/account/omnichannel/OmnichannelPreferencesPage.spec.tsx delete mode 100644 apps/meteor/client/views/admin/mailer/MailerPage.spec.tsx delete mode 100644 apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.spec.tsx create mode 100644 apps/meteor/tests/e2e/account-profile.spec.ts create mode 100644 apps/meteor/tests/e2e/omnichannel/omnichannel-current-chats.spec.ts delete mode 100644 apps/meteor/tests/e2e/settings-account-profile.spec.ts diff --git a/apps/meteor/client/views/account/featurePreview/AccountFeaturePreviewPage.spec.tsx b/apps/meteor/client/views/account/featurePreview/AccountFeaturePreviewPage.spec.tsx deleted file mode 100644 index 157fa9b7acdf..000000000000 --- a/apps/meteor/client/views/account/featurePreview/AccountFeaturePreviewPage.spec.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import { mockAppRoot } from '@rocket.chat/mock-providers'; -import { defaultFeaturesPreview } from '@rocket.chat/ui-client'; -import { render } from '@testing-library/react'; -import { axe, toHaveNoViolations } from 'jest-axe'; -import React from 'react'; - -import AccountFeaturePreviewPage from './AccountFeaturePreviewPage'; - -expect.extend(toHaveNoViolations); - -it('should have no a11y violations', async () => { - const { container } = render(, { - wrapper: mockAppRoot() - .withSetting('Accounts_AllowFeaturePreview', true) - .withUserPreference('featurePreview', defaultFeaturesPreview) - .withEndpoint('POST', '/v1/users.setPreferences', () => ({ - user: { - _id: 'userId', - settings: { - profile: {}, - preferences: {}, - }, - }, - })) - .build(), - }); - - const results = await axe(container); - expect(results).toHaveNoViolations(); -}); diff --git a/apps/meteor/client/views/account/omnichannel/OmnichannelPreferencesPage.spec.tsx b/apps/meteor/client/views/account/omnichannel/OmnichannelPreferencesPage.spec.tsx deleted file mode 100644 index 263d29c2ebdf..000000000000 --- a/apps/meteor/client/views/account/omnichannel/OmnichannelPreferencesPage.spec.tsx +++ /dev/null @@ -1,19 +0,0 @@ -import { mockAppRoot } from '@rocket.chat/mock-providers'; -import { render } from '@testing-library/react'; -import { axe, toHaveNoViolations } from 'jest-axe'; -import React from 'react'; - -import OmnichannelPreferencesPage from './OmnichannelPreferencesPage'; - -expect.extend(toHaveNoViolations); - -it('should have no a11y violations', async () => { - const { container } = render(, { - wrapper: mockAppRoot() - .withMethod('license:getModules', () => ['livechat-enterprise']) - .build(), - }); - - const results = await axe(container); - expect(results).toHaveNoViolations(); -}); diff --git a/apps/meteor/client/views/admin/mailer/MailerPage.spec.tsx b/apps/meteor/client/views/admin/mailer/MailerPage.spec.tsx deleted file mode 100644 index f5e23e35c3d2..000000000000 --- a/apps/meteor/client/views/admin/mailer/MailerPage.spec.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { mockAppRoot } from '@rocket.chat/mock-providers'; -import { render } from '@testing-library/react'; -import { axe, toHaveNoViolations } from 'jest-axe'; -import React from 'react'; - -import MailerPage from './MailerPage'; - -expect.extend(toHaveNoViolations); - -it('should have no a11y violations', async () => { - const { container } = render(, { - wrapper: mockAppRoot().build(), - }); - - const results = await axe(container); - expect(results).toHaveNoViolations(); -}); diff --git a/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.spec.tsx b/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.spec.tsx deleted file mode 100644 index b95af28fe6a6..000000000000 --- a/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.spec.tsx +++ /dev/null @@ -1,17 +0,0 @@ -import { mockAppRoot } from '@rocket.chat/mock-providers'; -import { render } from '@testing-library/react'; -import { axe, toHaveNoViolations } from 'jest-axe'; -import React from 'react'; - -import CurrentChatsPage from './CurrentChatsPage'; - -expect.extend(toHaveNoViolations); - -it('should have no a11y violations', async () => { - const { container } = render( undefined} />, { - wrapper: mockAppRoot().build(), - }); - - const results = await axe(container); - expect(results).toHaveNoViolations(); -}); diff --git a/apps/meteor/package.json b/apps/meteor/package.json index c2e17b3e82c3..7b0ea3b73cc7 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -63,6 +63,7 @@ "email": "support@rocket.chat" }, "devDependencies": { + "@axe-core/playwright": "^4.7.3", "@babel/core": "~7.22.9", "@babel/eslint-parser": "~7.22.9", "@babel/plugin-proposal-nullish-coalescing-operator": "~7.18.6", @@ -115,7 +116,6 @@ "@types/he": "^1.1.2", "@types/i18next-sprintf-postprocessor": "^0.2.0", "@types/imap": "^0.8.37", - "@types/jest-axe": "^3.5.5", "@types/jsdom": "^16.2.15", "@types/jsdom-global": "^3.0.4", "@types/jsrsasign": "^10.5.8", @@ -183,7 +183,6 @@ "fast-glob": "^3.2.12", "i18next": "~23.4.5", "jest": "~29.6.1", - "jest-axe": "^8.0.0", "jsdom-global": "^3.0.2", "mocha": "^9.2.2", "nyc": "^15.1.0", diff --git a/apps/meteor/tests/e2e/account-profile.spec.ts b/apps/meteor/tests/e2e/account-profile.spec.ts new file mode 100644 index 000000000000..b850b7855c6f --- /dev/null +++ b/apps/meteor/tests/e2e/account-profile.spec.ts @@ -0,0 +1,132 @@ +import { faker } from '@faker-js/faker'; + +import { Users } from './fixtures/userStates'; +import { HomeChannel, AccountProfile } from './page-objects'; +import { test, expect } from './utils/test'; + +test.use({ storageState: Users.user3.state }); + +test.describe.serial('settings-account-profile', () => { + let poHomeChannel: HomeChannel; + let poAccountProfile: AccountProfile; + + const token = faker.string.alpha(10); + + test.beforeEach(async ({ page }) => { + poHomeChannel = new HomeChannel(page); + poAccountProfile = new AccountProfile(page); + }); + + // FIXME: solve test intermitencies + test.describe('Profile', () => { + test.beforeEach(async ({ page }) => { + await page.goto('/account/profile'); + }) + + test.skip('expect update profile with new name/username', async () => { + const newName = faker.person.fullName(); + const newUsername = faker.internet.userName({ firstName: newName }); + + await poAccountProfile.inputName.fill(newName); + await poAccountProfile.inputUsername.fill(newUsername); + await poAccountProfile.btnSubmit.click(); + await poAccountProfile.btnClose.click(); + await poHomeChannel.sidenav.openChat('general'); + await poHomeChannel.content.sendMessage('any_message'); + + await expect(poHomeChannel.content.lastUserMessageNotSequential).toContainText(newUsername); + + await poHomeChannel.content.lastUserMessageNotSequential.locator('figure').click(); + await poHomeChannel.content.linkUserCard.click(); + + await expect(poHomeChannel.tabs.userInfoUsername).toHaveText(newUsername); + }) + + test('change avatar', async ({ page }) => { + await test.step('expect change avatar image by upload', async () => { + await poAccountProfile.inputImageFile.setInputFiles('./tests/e2e/fixtures/files/test-image.jpeg'); + + await poAccountProfile.btnSubmit.click(); + await expect(page.locator('.rcx-toastbar.rcx-toastbar--success').first()).toBeVisible(); + }); + + await test.step('expect to close toastbar', async () => { + await page.locator('.rcx-toastbar.rcx-toastbar--success').first().click(); + }); + + await test.step('expect set image from url', async () => { + await poAccountProfile.inputAvatarLink.fill('https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50'); + await poAccountProfile.btnSetAvatarLink.click(); + + await poAccountProfile.btnSubmit.click(); + await expect(page.locator('.rcx-toastbar.rcx-toastbar--success').first()).toBeVisible(); + }); + }); + }); + + test('Personal Access Tokens', async ({ page }) => { + const response = page.waitForResponse('**/api/v1/users.getPersonalAccessTokens'); + await page.goto('/account/tokens'); + await response; + + await test.step('expect show empty personal access tokens table', async () => { + await expect(poAccountProfile.tokensTableEmpty).toBeVisible(); + await expect(poAccountProfile.inputToken).toBeVisible(); + }); + + await test.step('expect show new personal token', async () => { + await poAccountProfile.inputToken.type(token); + await poAccountProfile.btnTokensAdd.click(); + await expect(poAccountProfile.tokenAddedModal).toBeVisible(); + await page.locator('role=button[name=Ok]').click(); + }); + + await test.step('expect not allow add new personal token with same name', async () => { + await poAccountProfile.inputToken.type(token); + await poAccountProfile.btnTokensAdd.click(); + await expect(page.locator('.rcx-toastbar.rcx-toastbar--error')).toBeVisible(); + }); + + await test.step('expect regenerate personal token', async () => { + await poAccountProfile.tokenInTable(token).locator('button >> nth=0').click(); + await poAccountProfile.btnRegenerateTokenModal.click(); + await expect(poAccountProfile.tokenAddedModal).toBeVisible(); + await page.locator('role=button[name=Ok]').click(); + }); + + await test.step('expect delete personal token', async () => { + await poAccountProfile.tokenInTable(token).locator('button >> nth=1').click(); + await poAccountProfile.btnRemoveTokenModal.click(); + await expect(page.locator('.rcx-toastbar.rcx-toastbar--success')).toBeVisible(); + }); + }); + + test.describe('Omnichannel', () => { + test('should not have any accessibility violations', async ({ page, makeAxeBuilder }) => { + await page.goto('/account/omnichannel'); + + const results = await makeAxeBuilder().analyze(); + expect(results.violations).toEqual([]); + }) + }) + + test.describe('Feature Preview', () => { + test('should not have any accessibility violations', async ({ page, makeAxeBuilder }) => { + await page.goto('/account/feature-preview'); + + const results = await makeAxeBuilder().analyze(); + expect(results.violations).toEqual([]); + }) + }) + + test.describe('Accessibility & Appearance', () => { + test('should not have any accessibility violations', async ({ page, makeAxeBuilder }) => { + await page.goto('/account/accessibility-and-appearance'); + + const results = await makeAxeBuilder().analyze(); + expect(results.violations).toEqual([]); + }) + }) +}); + + diff --git a/apps/meteor/tests/e2e/administration.spec.ts b/apps/meteor/tests/e2e/administration.spec.ts index 5a47a77bba99..b439258429f8 100644 --- a/apps/meteor/tests/e2e/administration.spec.ts +++ b/apps/meteor/tests/e2e/administration.spec.ts @@ -78,6 +78,17 @@ test.describe.parallel('administration', () => { }); }); + test.describe('Mailer', () => { + test.beforeEach(async ({ page }) => { + await page.goto('/admin/mailer'); + }) + + test('should not have any accessibility violations', async ({ makeAxeBuilder }) => { + const results = await makeAxeBuilder().analyze(); + expect(results.violations).toEqual([]); + }) + }) + test.describe('Settings', () => { test.describe('General', () => { test.beforeEach(async ({ page }) => { diff --git a/apps/meteor/tests/e2e/omnichannel/omnichannel-current-chats.spec.ts b/apps/meteor/tests/e2e/omnichannel/omnichannel-current-chats.spec.ts new file mode 100644 index 000000000000..8138ab839b75 --- /dev/null +++ b/apps/meteor/tests/e2e/omnichannel/omnichannel-current-chats.spec.ts @@ -0,0 +1,15 @@ +import { Users } from '../fixtures/userStates'; +import { test, expect } from '../utils/test'; + +test.use({ storageState: Users.admin.state }); + +test.describe.parallel('Omnichannel current chats', () => { + test.beforeEach(async ({ page }) =>{ + await page.goto('/omnichannel/current') + }) + + test.skip('should not have any accessibility violations', async ({ makeAxeBuilder }) => { + const results = await makeAxeBuilder().analyze(); + expect(results.violations).toEqual([]); + }) +}) diff --git a/apps/meteor/tests/e2e/settings-account-profile.spec.ts b/apps/meteor/tests/e2e/settings-account-profile.spec.ts deleted file mode 100644 index 7d33d71cfae6..000000000000 --- a/apps/meteor/tests/e2e/settings-account-profile.spec.ts +++ /dev/null @@ -1,101 +0,0 @@ -import { faker } from '@faker-js/faker'; - -import { Users } from './fixtures/userStates'; -import { HomeChannel, AccountProfile } from './page-objects'; -import { test, expect } from './utils/test'; - -test.use({ storageState: Users.user3.state }); - -test.describe.serial('settings-account-profile', () => { - let poHomeChannel: HomeChannel; - let poAccountProfile: AccountProfile; - - const token = faker.string.alpha(10); - - test.beforeEach(async ({ page }) => { - poHomeChannel = new HomeChannel(page); - poAccountProfile = new AccountProfile(page); - - await page.goto('/account/profile'); - }); - - // FIXME: solve test intermitencies - test.skip('expect update profile with new name/username', async () => { - const newName = faker.person.fullName(); - const newUsername = faker.internet.userName(newName); - - await poAccountProfile.inputName.fill(newName); - await poAccountProfile.inputUsername.fill(newUsername); - await poAccountProfile.btnSubmit.click(); - await poAccountProfile.btnClose.click(); - await poHomeChannel.sidenav.openChat('general'); - await poHomeChannel.content.sendMessage('any_message'); - - await expect(poHomeChannel.content.lastUserMessageNotSequential).toContainText(newUsername); - - await poHomeChannel.content.lastUserMessageNotSequential.locator('figure').click(); - await poHomeChannel.content.linkUserCard.click(); - - await expect(poHomeChannel.tabs.userInfoUsername).toHaveText(newUsername); - }); - - test('Personal Access Tokens', async ({ page }) => { - const response = page.waitForResponse('**/api/v1/users.getPersonalAccessTokens'); - await page.goto('/account/tokens'); - await response; - - await test.step('expect show empty personal access tokens table', async () => { - await expect(poAccountProfile.tokensTableEmpty).toBeVisible(); - await expect(poAccountProfile.inputToken).toBeVisible(); - }); - - await test.step('expect show new personal token', async () => { - await poAccountProfile.inputToken.type(token); - await poAccountProfile.btnTokensAdd.click(); - await expect(poAccountProfile.tokenAddedModal).toBeVisible(); - await page.locator('role=button[name=Ok]').click(); - }); - - await test.step('expect not allow add new personal token with same name', async () => { - await poAccountProfile.inputToken.type(token); - await poAccountProfile.btnTokensAdd.click(); - await expect(page.locator('.rcx-toastbar.rcx-toastbar--error')).toBeVisible(); - }); - - await test.step('expect regenerate personal token', async () => { - await poAccountProfile.tokenInTable(token).locator('button >> nth=0').click(); - await poAccountProfile.btnRegenerateTokenModal.click(); - await expect(poAccountProfile.tokenAddedModal).toBeVisible(); - await page.locator('role=button[name=Ok]').click(); - }); - - await test.step('expect delete personal token', async () => { - await poAccountProfile.tokenInTable(token).locator('button >> nth=1').click(); - await poAccountProfile.btnRemoveTokenModal.click(); - await expect(page.locator('.rcx-toastbar.rcx-toastbar--success')).toBeVisible(); - }); - }); - - test('change avatar', async ({ page }) => { - await page.goto('/account/profile'); - - await test.step('expect change avatar image by upload', async () => { - await poAccountProfile.inputImageFile.setInputFiles('./tests/e2e/fixtures/files/test-image.jpeg'); - - await poAccountProfile.btnSubmit.click(); - await expect(page.locator('.rcx-toastbar.rcx-toastbar--success').first()).toBeVisible(); - }); - - await test.step('expect to close toastbar', async () => { - await page.locator('.rcx-toastbar.rcx-toastbar--success').first().click(); - }); - - await test.step('expect set image from url', async () => { - await poAccountProfile.inputAvatarLink.fill('https://www.gravatar.com/avatar/205e460b479e2e5b48aec07710c08d50'); - await poAccountProfile.btnSetAvatarLink.click(); - - await poAccountProfile.btnSubmit.click(); - await expect(page.locator('.rcx-toastbar.rcx-toastbar--success').first()).toBeVisible(); - }); - }); -}); diff --git a/apps/meteor/tests/e2e/utils/test.ts b/apps/meteor/tests/e2e/utils/test.ts index 7418307a647d..5ccea233d88a 100644 --- a/apps/meteor/tests/e2e/utils/test.ts +++ b/apps/meteor/tests/e2e/utils/test.ts @@ -1,6 +1,7 @@ import * as fs from 'fs'; import * as path from 'path'; +import AxeBuilder from '@axe-core/playwright'; import type { Locator, APIResponse, APIRequestContext } from '@playwright/test'; import { test as baseTest, request as baseRequest } from '@playwright/test'; import { v4 as uuid } from 'uuid'; @@ -21,6 +22,7 @@ export type BaseTest = { put(uri: string, data: AnyObj, prefix?: string): Promise; delete(uri: string, params?: AnyObj, prefix?: string): Promise; }; + makeAxeBuilder: () => AxeBuilder; }; declare global { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -112,6 +114,12 @@ export const test = baseTest.extend({ }, }); }, + makeAxeBuilder: async ({ page }, use) => { + const SELECT_KNOW_ISSUES = ['aria-hidden-focus', 'nested-interactive'] + + const makeAxeBuilder = () => new AxeBuilder({ page }).withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']).disableRules(['document-title', ...SELECT_KNOW_ISSUES]); + await use(makeAxeBuilder); + } }); export const { expect } = test; diff --git a/yarn.lock b/yarn.lock index 68ef61bc51eb..061b01927896 100644 --- a/yarn.lock +++ b/yarn.lock @@ -955,6 +955,17 @@ __metadata: languageName: node linkType: hard +"@axe-core/playwright@npm:^4.7.3": + version: 4.7.3 + resolution: "@axe-core/playwright@npm:4.7.3" + dependencies: + axe-core: ^4.7.0 + peerDependencies: + playwright-core: ">= 1.0.0" + checksum: c913cf6a816af283fc733411013460656213cf6c0efffcc36db1fd2984ffac3d780efd0a9aabd3b41ce78e2a536fee9ba5436d19311f660067e4c3560677b115 + languageName: node + linkType: hard + "@babel/code-frame@npm:7.12.11": version: 7.12.11 resolution: "@babel/code-frame@npm:7.12.11" @@ -8540,6 +8551,7 @@ __metadata: version: 0.0.0-use.local resolution: "@rocket.chat/meteor@workspace:apps/meteor" dependencies: + "@axe-core/playwright": ^4.7.3 "@babel/core": ~7.22.9 "@babel/eslint-parser": ~7.22.9 "@babel/plugin-proposal-nullish-coalescing-operator": ~7.18.6 @@ -8658,7 +8670,6 @@ __metadata: "@types/he": ^1.1.2 "@types/i18next-sprintf-postprocessor": ^0.2.0 "@types/imap": ^0.8.37 - "@types/jest-axe": ^3.5.5 "@types/jsdom": ^16.2.15 "@types/jsdom-global": ^3.0.4 "@types/jsrsasign": ^10.5.8 @@ -8796,7 +8807,6 @@ __metadata: ip-range-check: ^0.2.0 is-svg: ^4.3.2 jest: ~29.6.1 - jest-axe: ^8.0.0 jquery: ^3.6.0 jschardet: ^3.0.0 jsdom: ^16.7.0 @@ -12338,16 +12348,6 @@ __metadata: languageName: node linkType: hard -"@types/jest-axe@npm:^3.5.5": - version: 3.5.5 - resolution: "@types/jest-axe@npm:3.5.5" - dependencies: - "@types/jest": "*" - axe-core: ^3.5.5 - checksum: 535038968034fe80fb466dcd5939ea5d9e9adb3ef00852ded3e41c62536c05137eb30bcbfd608142d2bc571d65c20b8e3563181674fb48594c2662d340bb4da5 - languageName: node - linkType: hard - "@types/jest@npm:*, @types/jest@npm:~29.5.3": version: 29.5.3 resolution: "@types/jest@npm:29.5.3" @@ -15075,20 +15075,13 @@ __metadata: languageName: node linkType: hard -"axe-core@npm:4.7.2, axe-core@npm:^4.2.0": +"axe-core@npm:^4.2.0, axe-core@npm:^4.7.0": version: 4.7.2 resolution: "axe-core@npm:4.7.2" checksum: 5d86fa0f45213b0e54cbb5d713ce885c4a8fe3a72b92dd915a47aa396d6fd149c4a87fec53aa978511f6d941402256cfeb26f2db35129e370f25a453c688655a languageName: node linkType: hard -"axe-core@npm:^3.5.5": - version: 3.5.6 - resolution: "axe-core@npm:3.5.6" - checksum: 000777d2b6bf1f390beb1fb4b8714ed9127797c021c345b032db0c144e07320dbbe8cb0bcb7688b90b79cfbd3cdc1f27a4dc857804e3c61d7e0defb34deeb830 - languageName: node - linkType: hard - "axios@npm:^0.21.0, axios@npm:^0.21.1": version: 0.21.4 resolution: "axios@npm:0.21.4" @@ -16707,16 +16700,6 @@ __metadata: languageName: node linkType: hard -"chalk@npm:4.1.2, chalk@npm:^4, chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.2": - version: 4.1.2 - resolution: "chalk@npm:4.1.2" - dependencies: - ansi-styles: ^4.1.0 - supports-color: ^7.1.0 - checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc - languageName: node - linkType: hard - "chalk@npm:^1.0.0": version: 1.1.3 resolution: "chalk@npm:1.1.3" @@ -16730,6 +16713,16 @@ __metadata: languageName: node linkType: hard +"chalk@npm:^4, chalk@npm:^4.0.0, chalk@npm:^4.1.0, chalk@npm:^4.1.2": + version: 4.1.2 + resolution: "chalk@npm:4.1.2" + dependencies: + ansi-styles: ^4.1.0 + supports-color: ^7.1.0 + checksum: fe75c9d5c76a7a98d45495b91b2172fa3b7a09e0cc9370e5c8feb1c567b85c4288e2b3fded7cfdd7359ac28d6b3844feb8b82b8686842e93d23c827c417e83fc + languageName: node + linkType: hard + "change-case@npm:^4.1.2": version: 4.1.2 resolution: "change-case@npm:4.1.2" @@ -25496,18 +25489,6 @@ __metadata: languageName: node linkType: hard -"jest-axe@npm:^8.0.0": - version: 8.0.0 - resolution: "jest-axe@npm:8.0.0" - dependencies: - axe-core: 4.7.2 - chalk: 4.1.2 - jest-matcher-utils: 29.2.2 - lodash.merge: 4.6.2 - checksum: 895501afa6ac6c49e5e45ee1cd4a8e923589f220f6f950a8f5366cc3f3636aaee9c9d501a469f9658185e7a5928b59a337d4b4f1c7bb3f4b3b5ba8b3811c9f15 - languageName: node - linkType: hard - "jest-changed-files@npm:^29.5.0": version: 29.5.0 resolution: "jest-changed-files@npm:29.5.0" @@ -25623,7 +25604,7 @@ __metadata: languageName: node linkType: hard -"jest-diff@npm:^29.2.1, jest-diff@npm:^29.6.1": +"jest-diff@npm:^29.6.1": version: 29.6.2 resolution: "jest-diff@npm:29.6.2" dependencies: @@ -25709,7 +25690,7 @@ __metadata: languageName: node linkType: hard -"jest-get-type@npm:^29.2.0, jest-get-type@npm:^29.4.3": +"jest-get-type@npm:^29.4.3": version: 29.4.3 resolution: "jest-get-type@npm:29.4.3" checksum: 6ac7f2dde1c65e292e4355b6c63b3a4897d7e92cb4c8afcf6d397f2682f8080e094c8b0b68205a74d269882ec06bf696a9de6cd3e1b7333531e5ed7b112605ce @@ -25774,18 +25755,6 @@ __metadata: languageName: node linkType: hard -"jest-matcher-utils@npm:29.2.2": - version: 29.2.2 - resolution: "jest-matcher-utils@npm:29.2.2" - dependencies: - chalk: ^4.0.0 - jest-diff: ^29.2.1 - jest-get-type: ^29.2.0 - pretty-format: ^29.2.1 - checksum: 97ef2638ab826c25f84bfedea231cef091820ae0876ba316922da81145e950d2b9d2057d3645813b5ee880bb975ed4f22e228dda5d0d26a20715e575b675357d - languageName: node - linkType: hard - "jest-matcher-utils@npm:^29.6.1": version: 29.6.1 resolution: "jest-matcher-utils@npm:29.6.1" @@ -27144,7 +27113,7 @@ __metadata: languageName: node linkType: hard -"lodash.merge@npm:4.6.2, lodash.merge@npm:^4.6.2": +"lodash.merge@npm:^4.6.2": version: 4.6.2 resolution: "lodash.merge@npm:4.6.2" checksum: ad580b4bdbb7ca1f7abf7e1bce63a9a0b98e370cf40194b03380a46b4ed799c9573029599caebc1b14e3f24b111aef72b96674a56cfa105e0f5ac70546cdc005 @@ -32083,7 +32052,7 @@ __metadata: languageName: node linkType: hard -"pretty-format@npm:^29.0.0, pretty-format@npm:^29.2.1, pretty-format@npm:^29.6.1, pretty-format@npm:^29.6.2": +"pretty-format@npm:^29.0.0, pretty-format@npm:^29.6.1, pretty-format@npm:^29.6.2": version: 29.6.2 resolution: "pretty-format@npm:29.6.2" dependencies: From 3245a0a3184f3adcab7ad239135457f0c0f29659 Mon Sep 17 00:00:00 2001 From: Rafael Tapia Date: Wed, 6 Sep 2023 09:05:57 -0300 Subject: [PATCH 077/275] fix: linkedin oauth broken (#30252) --- .changeset/odd-elephants-promise.md | 5 + .../lib/server/startup/oAuthServicesUpdate.js | 2 +- .../linkedin-oauth/linkedin-client.js | 2 +- .../linkedin-oauth/linkedin-server.js | 120 +++++++----------- 4 files changed, 51 insertions(+), 78 deletions(-) create mode 100644 .changeset/odd-elephants-promise.md diff --git a/.changeset/odd-elephants-promise.md b/.changeset/odd-elephants-promise.md new file mode 100644 index 000000000000..a12817ed175b --- /dev/null +++ b/.changeset/odd-elephants-promise.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fix LinkedIn OAuth broken diff --git a/apps/meteor/app/lib/server/startup/oAuthServicesUpdate.js b/apps/meteor/app/lib/server/startup/oAuthServicesUpdate.js index 397c3a491c5d..b01ef2f9fb0c 100644 --- a/apps/meteor/app/lib/server/startup/oAuthServicesUpdate.js +++ b/apps/meteor/app/lib/server/startup/oAuthServicesUpdate.js @@ -97,7 +97,7 @@ async function _OAuthServicesUpdate() { if (serviceName === 'Linkedin') { data.clientConfig = { - requestPermissions: ['r_liteprofile', 'r_emailaddress'], + requestPermissions: ['openid', 'email', 'profile'], }; } diff --git a/apps/meteor/packages/linkedin-oauth/linkedin-client.js b/apps/meteor/packages/linkedin-oauth/linkedin-client.js index 4c2ae09d1cae..29be9dd1af22 100644 --- a/apps/meteor/packages/linkedin-oauth/linkedin-client.js +++ b/apps/meteor/packages/linkedin-oauth/linkedin-client.js @@ -29,7 +29,7 @@ Linkedin.requestCredential = async function (options, credentialRequestCompleteC scope = requestPermissions.join('+'); } else { // If extra permissions not passed, we need to request basic, available to all - scope = 'r_emailaddress+r_liteprofile'; + scope = 'openid+email+profile'; } const loginStyle = OAuth._loginStyle('linkedin', config, options); if (!otherOptionsToPassThrough.popupOptions) { diff --git a/apps/meteor/packages/linkedin-oauth/linkedin-server.js b/apps/meteor/packages/linkedin-oauth/linkedin-server.js index fe67fe11b028..62e4dad143ce 100644 --- a/apps/meteor/packages/linkedin-oauth/linkedin-server.js +++ b/apps/meteor/packages/linkedin-oauth/linkedin-server.js @@ -4,45 +4,6 @@ import { ServiceConfiguration } from 'meteor/service-configuration'; export const Linkedin = {}; -const getImage = (profilePicture) => { - const image = []; - if (profilePicture !== undefined) { - for (const element of profilePicture['displayImage~'].elements) { - for (const identifier of element.identifiers) { - image.push(identifier.identifier); - } - } - } - return { - displayImage: profilePicture ? profilePicture.displayImage : null, - identifiersUrl: image, - }; -}; - -// Request for email, returns array -const getEmails = async function (accessToken) { - const url = encodeURI( - `https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements*(handle~))&oauth2_access_token=${accessToken}`, - ); - const data = await fetch(url); - const response = await data.json(); - const emails = []; - for (const element of response.elements) { - emails.push(element['handle~'].emailAddress); - } - return emails; -}; - -// checks whether a string parses as JSON -const isJSON = function (str) { - try { - JSON.parse(str); - return true; - } catch (e) { - return false; - } -}; - // returns an object containing: // - accessToken // - expiresIn: lifetime of token in seconds @@ -53,33 +14,37 @@ const getTokenResponse = async function (query) { let responseContent; try { // Request an access token - const request = await fetch('https://api.linkedin.com/uas/oauth2/accessToken', { + const body = new URLSearchParams({ + grant_type: 'authorization_code', + client_id: config.clientId, + client_secret: OAuth.openSecret(config.secret), + code: query.code, + redirect_uri: OAuth._redirectUri('linkedin', config), + }); + + const response = await fetch('https://api.linkedin.com/uas/oauth2/accessToken', { method: 'POST', - body: JSON.stringify({ - grant_type: 'authorization_code', - client_id: config.clientId, - client_secret: OAuth.openSecret(config.secret), - code: query.code, - redirect_uri: OAuth._redirectUri('linkedin', config), - }), + headers: { + 'Content-Type': 'application/x-www-form-urlencoded', + }, + body, }); - responseContent = await request.text(); + + if (!response.ok) { + throw new Error(responseContent.error_description); + } + + responseContent = await response.json(); } catch (err) { throw new Error(`Failed to complete OAuth handshake with Linkedin. ${err.message}`); } - // If 'responseContent' does not parse as JSON, it is an error. - if (!isJSON(responseContent)) { - throw new Error(`Failed to complete OAuth handshake with Linkedin. ${responseContent}`); - } - // Success! Extract access token and expiration - const parsedResponse = JSON.parse(responseContent); - const accessToken = parsedResponse.access_token; - const expiresIn = parsedResponse.expires_in; + const accessToken = responseContent.access_token; + const expiresIn = responseContent.expires_in; if (!accessToken) { - throw new Error(`Failed to complete OAuth handshake with Linkedin -- can't find access token in HTTP response. ${responseContent}`); + throw new Error(`Failed to complete OAuth handshake with Linkedin -- can't find access token in HTTP response. ${JSON.stringify(responseContent)}`); } return { @@ -88,13 +53,23 @@ const getTokenResponse = async function (query) { }; }; -// Request available fields from r_liteprofile +// Request available fields from profile const getIdentity = async function (accessToken) { try { const url = encodeURI( - `https://api.linkedin.com/v2/me?projection=(id,firstName,lastName,profilePicture(displayImage~:playableStreams))&oauth2_access_token=${accessToken}`, + `https://api.linkedin.com/v2/userinfo`, ); - const request = await fetch(url); + const request = await fetch(url, { + method: 'GET', + headers: { + Authorization: `Bearer ${accessToken}`, + }, + }); + + if (!request.ok) { + throw new Error(await request.text()); + } + return request.json(); } catch (err) { throw new Error(`Failed to fetch identity from Linkedin. ${err.message}`); @@ -106,30 +81,23 @@ OAuth.registerService('linkedin', 2, null, async (query) => { const { accessToken } = response; const identity = await getIdentity(accessToken); - const { id, firstName, lastName, profilePicture } = identity; + const { sub, given_name, family_name, picture, email } = identity; - if (!id) { + if (!sub) { throw new Error('Linkedin did not provide an id'); } - const emails = await getEmails(accessToken); - const fields = { - linkedinId: id, - firstName, - lastName, - profilePicture: getImage(profilePicture), - emails, + linkedinId: sub, + firstName: given_name, + lastName: family_name, + profilePicture: picture, + emailAddress: email, + email }; - if (emails.length) { - const primaryEmail = emails[0]; - fields.emailAddress = primaryEmail; // for backward compatibility with previous versions of this package - fields.email = primaryEmail; - } - const serviceData = { - id, + id: sub, accessToken, expiresAt: +new Date() + 1000 * response.expiresIn, ...fields, From e6d92ff1323537ba6cc653049e5d24ea4a17b12a Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Wed, 6 Sep 2023 11:11:01 -0300 Subject: [PATCH 078/275] chore: Registration form a11y improvements (#30280) --- apps/meteor/tests/e2e/register.spec.ts | 9 ++ .../src/components/CustomFieldsForm.tsx | 21 +++- .../web-ui-registration/src/RegisterForm.tsx | 119 +++++++++++------- 3 files changed, 102 insertions(+), 47 deletions(-) diff --git a/apps/meteor/tests/e2e/register.spec.ts b/apps/meteor/tests/e2e/register.spec.ts index 37d4c9b2c696..f99f212ff718 100644 --- a/apps/meteor/tests/e2e/register.spec.ts +++ b/apps/meteor/tests/e2e/register.spec.ts @@ -123,6 +123,15 @@ test.describe.serial('register', () => { await expect(poRegistration.registrationDisabledCallout).toBeVisible(); }); }); + + test('should not have any accessibility violations', async ({ page, makeAxeBuilder }) => { + await page.goto('/home'); + await poRegistration.goToRegister.click(); + + const results = await makeAxeBuilder().disableRules(['landmark-one-main', 'region']).analyze(); + + expect(results.violations).toEqual([]); + }); }); test.describe('Registration for secret password', async () => { diff --git a/packages/ui-client/src/components/CustomFieldsForm.tsx b/packages/ui-client/src/components/CustomFieldsForm.tsx index 49d4a120e47d..9423456ebe8e 100644 --- a/packages/ui-client/src/components/CustomFieldsForm.tsx +++ b/packages/ui-client/src/components/CustomFieldsForm.tsx @@ -1,6 +1,7 @@ import type { CustomFieldMetadata } from '@rocket.chat/core-typings'; import type { SelectOption } from '@rocket.chat/fuselage'; import { Field, Select, TextInput } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useTranslation } from '@rocket.chat/ui-contexts'; import { useCallback, useMemo } from 'react'; @@ -35,6 +36,7 @@ const CustomField = ({ }: CustomFieldProps) => { const t = useTranslation(); const { errors } = useFormState({ control }); + const fieldId = useUniqueId(); const Component = FIELD_TYPES[type] ?? null; @@ -47,7 +49,7 @@ const CustomField = ({ const validateRequired = useCallback((value) => (required ? typeof value === 'string' && !!value.trim() : true), [required]); const getErrorMessage = useCallback( - (error: any) => { + (error) => { switch (error?.type) { case 'required': return t('The_field_is_required', label || name); @@ -71,14 +73,23 @@ const CustomField = ({ rules={{ minLength: props.minLength, maxLength: props.maxLength, validate: { required: validateRequired } }} render={({ field }) => ( - + {label || t(name as TranslationKey)} - {required && '*'} - + - {errorMessage} + + {errorMessage} + )} /> diff --git a/packages/web-ui-registration/src/RegisterForm.tsx b/packages/web-ui-registration/src/RegisterForm.tsx index db3879d6e027..32ba9238766d 100644 --- a/packages/web-ui-registration/src/RegisterForm.tsx +++ b/packages/web-ui-registration/src/RegisterForm.tsx @@ -34,8 +34,14 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo const passwordConfirmationPlaceholder = String(useSetting('Accounts_ConfirmPasswordPlaceholder')); const formLabelId = useUniqueId(); - const passwordId = useUniqueId(); const passwordVerifierId = useUniqueId(); + const nameId = useUniqueId(); + const emailId = useUniqueId(); + const usernameId = useUniqueId(); + const passwordId = useUniqueId(); + const passwordConfirmationId = useUniqueId(); + const reasonId = useUniqueId(); + const registerUser = useRegisterMethod(); const customFields = useAccountsCustomFields(); @@ -54,7 +60,7 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo formState: { errors }, } = useForm({ mode: 'onBlur' }); - const password = watch('password'); + const { password } = watch(); const passwordIsValid = useValidatePassword(password); const handleRegister = async ({ password, passwordConfirmation: _, ...formData }: LoginRegisterPayload) => { @@ -103,8 +109,8 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo - - {requireNameForRegister ? `${t('registration.component.form.name')}*` : t('registration.component.form.nameOptional')} + + {t('registration.component.form.name')} - {errors.name && {t('registration.component.form.requiredField')}} + {errors.name && ( + + {t('registration.component.form.requiredField')} + + )} - {t('registration.component.form.email')}* + + {t('registration.component.form.email')} + - {errors.email && {errors.email.message || t('registration.component.form.requiredField')}} + {errors.email && ( + + {errors.email.message} + + )} - {t('registration.component.form.username')}* + + {t('registration.component.form.username')} + - {errors.username?.message && {errors.username.message}} - {errors.username?.type === 'required' && {t('registration.component.form.requiredField')}} + {errors.username && ( + + {errors.username.message} + + )} - {t('registration.component.form.password')}* + + {t('registration.component.form.password')} + {errors?.password && ( @@ -176,43 +201,53 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo )} - {requiresPasswordConfirmation && ( + + {requiresPasswordConfirmation && ( + + {t('registration.component.form.confirmPassword')} watch('password') === val, + validate: (val: string) => (watch('password') === val ? true : t('registration.component.form.invalidConfirmPass')), })} - error={errors.passwordConfirmation?.type === 'validate' ? t('registration.component.form.invalidConfirmPass') : undefined} - aria-invalid={errors.passwordConfirmation ? 'true' : false} - id='passwordConfirmation' + error={errors.passwordConfirmation?.message} + aria-invalid={errors.passwordConfirmation ? 'true' : 'false'} + id={passwordConfirmationId} + aria-describedby={`${passwordConfirmationId}-error`} placeholder={passwordConfirmationPlaceholder || t('Confirm_password')} disabled={!passwordIsValid} /> - )} - {errors.passwordConfirmation?.type === 'validate' && requiresPasswordConfirmation && ( - {t('registration.component.form.invalidConfirmPass')} - )} - {errors.passwordConfirmation?.type === 'required' && requiresPasswordConfirmation && ( - {t('registration.component.form.requiredField')} - )} - + {errors.passwordConfirmation && ( + + {errors.passwordConfirmation.message} + + )} + + )} {manuallyApproveNewUsersRequired && ( - {t('registration.component.form.reasonToJoin')}* + + {t('registration.component.form.reasonToJoin')} + - {errors.reason && {t('registration.component.form.requiredField')}} + {errors.reason && ( + + {t('registration.component.form.requiredField')} + + )} )} From d418d0e752a69abecfe41ef84d1f7abf70a03d20 Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Wed, 6 Sep 2023 12:45:10 -0300 Subject: [PATCH 079/275] fix: added debounce to units and custom fields search (#30291) --- .../views/omnichannel/customFields/CustomFieldsTable.tsx | 7 ++++--- apps/meteor/ee/client/omnichannel/units/UnitsTable.tsx | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/meteor/client/views/omnichannel/customFields/CustomFieldsTable.tsx b/apps/meteor/client/views/omnichannel/customFields/CustomFieldsTable.tsx index b92fad97633a..d9ef416226cc 100644 --- a/apps/meteor/client/views/omnichannel/customFields/CustomFieldsTable.tsx +++ b/apps/meteor/client/views/omnichannel/customFields/CustomFieldsTable.tsx @@ -1,5 +1,5 @@ import { Pagination } from '@rocket.chat/fuselage'; -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import { useDebouncedValue, useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useRoute, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; import type { MutableRefObject } from 'react'; @@ -24,18 +24,19 @@ const CustomFieldsTable = ({ reload }: { reload: MutableRefObject<() => void> }) const t = useTranslation(); const [filter, setFilter] = useState(''); const departmentsRoute = useRoute('omnichannel-customfields'); + const debouncedFilter = useDebouncedValue(filter, 500); const { current, itemsPerPage, setItemsPerPage: onSetItemsPerPage, setCurrent: onSetCurrent, ...paginationProps } = usePagination(); const { sortBy, sortDirection, setSort } = useSort<'_id' | 'label' | 'scope' | 'visibility'>('_id'); const query = useMemo( () => ({ - text: filter, + text: debouncedFilter, sort: `{ "${sortBy}": ${sortDirection === 'asc' ? 1 : -1} }`, ...(itemsPerPage && { count: itemsPerPage }), ...(current && { offset: current }), }), - [filter, itemsPerPage, current, sortBy, sortDirection], + [debouncedFilter, itemsPerPage, current, sortBy, sortDirection], ); const getCustomFields = useEndpoint('GET', '/v1/livechat/custom-fields'); diff --git a/apps/meteor/ee/client/omnichannel/units/UnitsTable.tsx b/apps/meteor/ee/client/omnichannel/units/UnitsTable.tsx index a9ab094229f6..f85b73216612 100644 --- a/apps/meteor/ee/client/omnichannel/units/UnitsTable.tsx +++ b/apps/meteor/ee/client/omnichannel/units/UnitsTable.tsx @@ -1,5 +1,5 @@ import { Pagination } from '@rocket.chat/fuselage'; -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import { useDebouncedValue, useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useEndpoint, useRoute, useTranslation } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; import type { MutableRefObject } from 'react'; @@ -24,6 +24,7 @@ const UnitsTable = ({ reload }: { reload: MutableRefObject<() => void> }) => { const t = useTranslation(); const [filter, setFilter] = useState(''); const unitsRoute = useRoute('omnichannel-units'); + const debouncedFilter = useDebouncedValue(filter, 500); const { current, itemsPerPage, setItemsPerPage: onSetItemsPerPage, setCurrent: onSetCurrent, ...paginationProps } = usePagination(); const { sortBy, sortDirection, setSort } = useSort<'name' | 'visibility'>('name'); @@ -31,12 +32,12 @@ const UnitsTable = ({ reload }: { reload: MutableRefObject<() => void> }) => { const query = useMemo( () => ({ fields: JSON.stringify({ name: 1 }), - text: filter, + text: debouncedFilter, sort: JSON.stringify({ [sortBy]: sortDirection === 'asc' ? 1 : -1 }), ...(itemsPerPage && { count: itemsPerPage }), ...(current && { offset: current }), }), - [filter, itemsPerPage, current, sortBy, sortDirection], + [debouncedFilter, itemsPerPage, current, sortBy, sortDirection], ); const getUnits = useEndpoint('GET', '/v1/livechat/units'); From ace35997a635328e9d2b645bae6db475784d00f7 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Wed, 6 Sep 2023 09:59:09 -0600 Subject: [PATCH 080/275] chore: Increase cache time to 10s on `getUnits` function (#30285) --- .changeset/three-birds-tickle.md | 5 +++++ apps/meteor/ee/app/livechat-enterprise/server/lib/units.ts | 2 +- .../server/methods/getUnitsFromUserRoles.ts | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/three-birds-tickle.md diff --git a/.changeset/three-birds-tickle.md b/.changeset/three-birds-tickle.md new file mode 100644 index 000000000000..0ce911d9f6fa --- /dev/null +++ b/.changeset/three-birds-tickle.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +chore: Increase cache time from 5s to 10s on `getUnits` helpers. This should reduce the number of DB calls made by this method to fetch the unit limitations for a user. diff --git a/apps/meteor/ee/app/livechat-enterprise/server/lib/units.ts b/apps/meteor/ee/app/livechat-enterprise/server/lib/units.ts index d550b1335978..58a75abc943c 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/lib/units.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/lib/units.ts @@ -8,7 +8,7 @@ async function hasUnits(): Promise { } // Units should't change really often, so we can cache the result -const memoizedHasUnits = mem(hasUnits, { maxAge: 5000 }); +const memoizedHasUnits = mem(hasUnits, { maxAge: 10000 }); export async function getUnitsFromUser(): Promise<{ [k: string]: any }[] | undefined> { if (!(await memoizedHasUnits())) { diff --git a/apps/meteor/ee/app/livechat-enterprise/server/methods/getUnitsFromUserRoles.ts b/apps/meteor/ee/app/livechat-enterprise/server/methods/getUnitsFromUserRoles.ts index 0a6663c1f0b3..dd0f3867f574 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/methods/getUnitsFromUserRoles.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/methods/getUnitsFromUserRoles.ts @@ -17,7 +17,7 @@ async function getUnitsFromUserRoles(user: string | null): Promise Date: Wed, 6 Sep 2023 15:02:39 -0300 Subject: [PATCH 081/275] chore: prevent unneeded calls to EE settings service (#30249) --- .../modules/listeners/listeners.module.ts | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/meteor/server/modules/listeners/listeners.module.ts b/apps/meteor/server/modules/listeners/listeners.module.ts index 973b542bf54a..f21081e43d0a 100644 --- a/apps/meteor/server/modules/listeners/listeners.module.ts +++ b/apps/meteor/server/modules/listeners/listeners.module.ts @@ -2,8 +2,9 @@ import type { AppStatus } from '@rocket.chat/apps-engine/definition/AppStatus'; import type { ISetting as AppsSetting } from '@rocket.chat/apps-engine/definition/settings'; import type { IServiceClass } from '@rocket.chat/core-services'; import { EnterpriseSettings } from '@rocket.chat/core-services'; -import { UserStatus, isSettingColor } from '@rocket.chat/core-typings'; +import { UserStatus, isSettingColor, isSettingEnterprise } from '@rocket.chat/core-typings'; import type { IUser, IRoom, VideoConference, ISetting, IOmnichannelRoom } from '@rocket.chat/core-typings'; +import { Logger } from '@rocket.chat/logger'; import { parse } from '@rocket.chat/message-parser'; import { settings } from '../../../app/settings/server/cached'; @@ -26,6 +27,8 @@ const minimongoChangeMap: Record = { export class ListenersModule { constructor(service: IServiceClass, notifications: NotificationsModule) { + const logger = new Logger('ListenersModule'); + service.onEvent('emoji.deleteCustom', (emoji) => { notifications.notifyLoggedInThisInstance('deleteEmojiCustom', { emojiData: emoji, @@ -247,11 +250,16 @@ export class ListenersModule { }); service.onEvent('watch.settings', async ({ clientAction, setting }): Promise => { - if (clientAction !== 'removed') { - // TODO check if setting is EE before calling this - const result = await EnterpriseSettings.changeSettingValue(setting); - if (result !== undefined && !(result instanceof Error)) { - setting.value = result; + // if a EE setting changed make sure we broadcast the correct value according to license + if (clientAction !== 'removed' && isSettingEnterprise(setting)) { + try { + const result = await EnterpriseSettings.changeSettingValue(setting); + if (result !== undefined && !(result instanceof Error)) { + setting.value = result; + } + } catch (err: unknown) { + logger.error({ msg: 'Error getting proper enterprise setting value. Returning `invalidValue` instead.', err }); + setting.value = setting.invalidValue; } } From 69bb4771d76fdeaf95c439a90597223397d9e3eb Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Wed, 6 Sep 2023 15:02:39 -0300 Subject: [PATCH 082/275] chore: prevent unneeded calls to EE settings service (#30249) --- .../modules/listeners/listeners.module.ts | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/apps/meteor/server/modules/listeners/listeners.module.ts b/apps/meteor/server/modules/listeners/listeners.module.ts index 5c46343f67a4..856b91efce56 100644 --- a/apps/meteor/server/modules/listeners/listeners.module.ts +++ b/apps/meteor/server/modules/listeners/listeners.module.ts @@ -1,10 +1,11 @@ import type { ISetting as AppsSetting } from '@rocket.chat/apps-engine/definition/settings'; -import { UserStatus, isSettingColor } from '@rocket.chat/core-typings'; +import { UserStatus, isSettingColor, isSettingEnterprise } from '@rocket.chat/core-typings'; import type { AppStatus } from '@rocket.chat/apps-engine/definition/AppStatus'; -import type { IUser, IRoom, VideoConference, ISetting, IOmnichannelRoom } from '@rocket.chat/core-typings'; -import { parse } from '@rocket.chat/message-parser'; import type { IServiceClass } from '@rocket.chat/core-services'; import { EnterpriseSettings } from '@rocket.chat/core-services'; +import type { IUser, IRoom, VideoConference, ISetting, IOmnichannelRoom } from '@rocket.chat/core-typings'; +import { Logger } from '@rocket.chat/logger'; +import { parse } from '@rocket.chat/message-parser'; import type { NotificationsModule } from '../notifications/notifications.module'; import { settings } from '../../../app/settings/server/cached'; @@ -26,6 +27,8 @@ const minimongoChangeMap: Record = { export class ListenersModule { constructor(service: IServiceClass, notifications: NotificationsModule) { + const logger = new Logger('ListenersModule'); + service.onEvent('emoji.deleteCustom', (emoji) => { notifications.notifyLoggedInThisInstance('deleteEmojiCustom', { emojiData: emoji, @@ -247,11 +250,16 @@ export class ListenersModule { }); service.onEvent('watch.settings', async ({ clientAction, setting }): Promise => { - if (clientAction !== 'removed') { - // TODO check if setting is EE before calling this - const result = await EnterpriseSettings.changeSettingValue(setting); - if (result !== undefined && !(result instanceof Error)) { - setting.value = result; + // if a EE setting changed make sure we broadcast the correct value according to license + if (clientAction !== 'removed' && isSettingEnterprise(setting)) { + try { + const result = await EnterpriseSettings.changeSettingValue(setting); + if (result !== undefined && !(result instanceof Error)) { + setting.value = result; + } + } catch (err: unknown) { + logger.error({ msg: 'Error getting proper enterprise setting value. Returning `invalidValue` instead.', err }); + setting.value = setting.invalidValue; } } From 8ca4ac78cf5584bc02b6faa92781d1171ebcd01f Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Wed, 6 Sep 2023 16:56:47 -0300 Subject: [PATCH 083/275] chore: fix logger import --- apps/meteor/server/modules/listeners/listeners.module.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/server/modules/listeners/listeners.module.ts b/apps/meteor/server/modules/listeners/listeners.module.ts index 856b91efce56..06e494fdb556 100644 --- a/apps/meteor/server/modules/listeners/listeners.module.ts +++ b/apps/meteor/server/modules/listeners/listeners.module.ts @@ -4,11 +4,11 @@ import type { AppStatus } from '@rocket.chat/apps-engine/definition/AppStatus'; import type { IServiceClass } from '@rocket.chat/core-services'; import { EnterpriseSettings } from '@rocket.chat/core-services'; import type { IUser, IRoom, VideoConference, ISetting, IOmnichannelRoom } from '@rocket.chat/core-typings'; -import { Logger } from '@rocket.chat/logger'; import { parse } from '@rocket.chat/message-parser'; import type { NotificationsModule } from '../notifications/notifications.module'; import { settings } from '../../../app/settings/server/cached'; +import { Logger } from '../../lib/logger/Logger'; const isMessageParserDisabled = process.env.DISABLE_MESSAGE_PARSER === 'true'; From 03bda64be6853e9e858a961ec64e0b4a7030917f Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Wed, 6 Sep 2023 16:57:19 -0300 Subject: [PATCH 084/275] chore: Add `body` on axe scope to avoid false positive results (#30311) --- apps/meteor/tests/e2e/utils/test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/tests/e2e/utils/test.ts b/apps/meteor/tests/e2e/utils/test.ts index 5ccea233d88a..81479231fd65 100644 --- a/apps/meteor/tests/e2e/utils/test.ts +++ b/apps/meteor/tests/e2e/utils/test.ts @@ -117,7 +117,7 @@ export const test = baseTest.extend({ makeAxeBuilder: async ({ page }, use) => { const SELECT_KNOW_ISSUES = ['aria-hidden-focus', 'nested-interactive'] - const makeAxeBuilder = () => new AxeBuilder({ page }).withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']).disableRules(['document-title', ...SELECT_KNOW_ISSUES]); + const makeAxeBuilder = () => new AxeBuilder({ page }).withTags(['wcag2a', 'wcag2aa', 'wcag21a', 'wcag21aa']).include('body').disableRules([...SELECT_KNOW_ISSUES]); await use(makeAxeBuilder); } }); From 516658dcfcc27169c6ebfebf82dd27a5d7801b80 Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Wed, 6 Sep 2023 18:37:45 -0300 Subject: [PATCH 085/275] fix: Selected options not being displayed for monitors and departments (#30292) Co-authored-by: Kevin Aleman <11577696+KevLehman@users.noreply.github.com> --- .../views/hooks/useDepartmentsByUnitsList.ts | 1 - .../client/views/hooks/useMonitorsList.ts | 12 ++++----- .../server/lib/Department.ts | 2 +- .../ee/client/omnichannel/units/UnitEdit.js | 25 +++++++++---------- 4 files changed, 19 insertions(+), 21 deletions(-) diff --git a/apps/meteor/client/views/hooks/useDepartmentsByUnitsList.ts b/apps/meteor/client/views/hooks/useDepartmentsByUnitsList.ts index ceb7dc933df5..6c402a199ded 100644 --- a/apps/meteor/client/views/hooks/useDepartmentsByUnitsList.ts +++ b/apps/meteor/client/views/hooks/useDepartmentsByUnitsList.ts @@ -45,7 +45,6 @@ export const useDepartmentsByUnitsList = ( name: department.archived ? `${name} [${t('Archived')}]` : name, label: name, value: _id, - ...(_updatedAt && { _updatedAt: new Date(_updatedAt) }), }; }), itemCount: total, diff --git a/apps/meteor/client/views/hooks/useMonitorsList.ts b/apps/meteor/client/views/hooks/useMonitorsList.ts index 4d9ccba5c883..512b49d49d8e 100644 --- a/apps/meteor/client/views/hooks/useMonitorsList.ts +++ b/apps/meteor/client/views/hooks/useMonitorsList.ts @@ -33,15 +33,15 @@ export const useMonitorsList = ( text: options.filter, offset: start, count: end + start, + sort: JSON.stringify({ username: 1 }), }); return { - items: monitors.map((members: any) => { - members._updatedAt = new Date(members._updatedAt); - members.label = members.username; - members.value = members._id; - return members; - }), + items: monitors.map((members: any) => ({ + ...members, + label: members.username, + value: members._id, + })), itemCount: total, }; }, diff --git a/apps/meteor/ee/app/livechat-enterprise/server/lib/Department.ts b/apps/meteor/ee/app/livechat-enterprise/server/lib/Department.ts index b70ee79b6a94..094f0c9000d4 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/lib/Department.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/lib/Department.ts @@ -24,7 +24,7 @@ export const findAllDepartmentsAvailable = async ( query = await callbacks.run('livechat.applyDepartmentRestrictions', query, { userId: uid }); } - const { cursor, totalCount } = LivechatDepartment.findPaginated(query, { limit: count, offset }); + const { cursor, totalCount } = LivechatDepartment.findPaginated(query, { limit: count, offset, sort: { name: 1 } }); const [departments, total] = await Promise.all([cursor.toArray(), totalCount]); diff --git a/apps/meteor/ee/client/omnichannel/units/UnitEdit.js b/apps/meteor/ee/client/omnichannel/units/UnitEdit.js index 297a25d4a4c1..2c172bcf38c6 100644 --- a/apps/meteor/ee/client/omnichannel/units/UnitEdit.js +++ b/apps/meteor/ee/client/omnichannel/units/UnitEdit.js @@ -33,17 +33,6 @@ function UnitEdit({ title, data, unitId, isNew, unitMonitors, unitDepartments, r const { phase: departmentsPhase, items: departmentsItems, itemCount: departmentsTotal } = useRecordList(departmentsList); - const departmentsSortedByName = departmentsItems.sort((a, b) => { - if (a.name > b.name) { - return 1; - } - if (a.name < b.name) { - return -1; - } - - return 0; - }); - const unit = data || {}; const currUnitMonitors = useMemo( @@ -82,6 +71,16 @@ function UnitEdit({ title, data, unitId, isNew, unitMonitors, unitDepartments, r const { handleName, handleVisibility, handleDepartments, handleMonitors } = handlers; const { name, visibility, departments, monitors } = values; + const departmentsOptions = useMemo(() => { + const pending = departments.filter(({ value }) => !departmentsItems.find((dep) => dep.value === value)); + return [...departmentsItems, ...pending]; + }, [departments, departmentsItems]); + + const monitorsOptions = useMemo(() => { + const pending = monitors.filter(({ value }) => !monitorsItems.find((mon) => mon.value === value)); + return [...monitorsItems, ...pending]; + }, [monitors, monitorsItems]); + const nameError = useMemo(() => (!name || name.length === 0 ? t('The_field_is_required', t('name')) : undefined), [name, t]); const visibilityError = useMemo( () => (!visibility || visibility.length === 0 ? t('The_field_is_required', t('description')) : undefined), @@ -172,7 +171,7 @@ function UnitEdit({ title, data, unitId, isNew, unitMonitors, unitDepartments, r withTitle filter={departmentsFilter} setFilter={setDepartmentsFilter} - options={departmentsSortedByName} + options={departmentsOptions} value={departments} error={hasUnsavedChanges && departmentError} maxWidth='100%' @@ -194,7 +193,7 @@ function UnitEdit({ title, data, unitId, isNew, unitMonitors, unitDepartments, r withTitle filter={monitorsFilter} setFilter={setMonitorsFilter} - options={monitorsItems} + options={monitorsOptions} value={monitors} error={hasUnsavedChanges && unitMonitorsError} maxWidth='100%' From 0409097ff0ea411586704bc0a75844f8dffa3c4a Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 6 Sep 2023 19:57:57 -0300 Subject: [PATCH 086/275] test: codecov flags (#30302) --- .github/workflows/ci-test-e2e.yml | 3 +++ .github/workflows/ci-test-unit.yml | 4 ++++ .github/workflows/ci.yml | 3 +++ codecov.yml | 9 +++++++++ 4 files changed, 19 insertions(+) diff --git a/.github/workflows/ci-test-e2e.yml b/.github/workflows/ci-test-e2e.yml index 9a05543605db..e14857a97a09 100644 --- a/.github/workflows/ci-test-e2e.yml +++ b/.github/workflows/ci-test-e2e.yml @@ -57,6 +57,8 @@ on: required: false REPORTER_ROCKETCHAT_API_KEY: required: false + CODECOV_TOKEN: + required: false env: MONGO_URL: mongodb://localhost:27017/rocketchat?replicaSet=rs0&directConnection=true @@ -237,6 +239,7 @@ jobs: directory: ./apps/meteor flags: e2e verbose: true + token: ${{ secrets.CODECOV_TOKEN }} - name: Store e2e-ee-coverage if: inputs.type == 'ui' && inputs.release == 'ee' diff --git a/.github/workflows/ci-test-unit.yml b/.github/workflows/ci-test-unit.yml index 03c6bc2352ab..b4ef5cb273ad 100644 --- a/.github/workflows/ci-test-unit.yml +++ b/.github/workflows/ci-test-unit.yml @@ -6,6 +6,9 @@ on: node-version: required: true type: string + secrets: + CODECOV_TOKEN: + required: false env: MONGO_URL: mongodb://localhost:27017/rocketchat?replicaSet=rs0&directConnection=true @@ -36,3 +39,4 @@ jobs: with: flags: unit verbose: true + token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fe46ecf66c3..70ec4dcba6ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -337,6 +337,8 @@ jobs: uses: ./.github/workflows/ci-test-unit.yml with: node-version: ${{ needs.release-versions.outputs.node-version }} + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} test-api: name: 🔨 Test API (CE) @@ -431,6 +433,7 @@ jobs: QASE_API_TOKEN: ${{ secrets.QASE_API_TOKEN }} REPORTER_ROCKETCHAT_API_KEY: ${{ secrets.REPORTER_ROCKETCHAT_API_KEY }} REPORTER_ROCKETCHAT_URL: ${{ secrets.REPORTER_ROCKETCHAT_URL }} + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} tests-done: name: ✅ Tests Done diff --git a/codecov.yml b/codecov.yml index 0a3501678c1e..2fe2eaf32b42 100644 --- a/codecov.yml +++ b/codecov.yml @@ -1,3 +1,5 @@ +codecov: + max_report_age: off coverage: status: patch: off @@ -10,6 +12,13 @@ coverage: flags: - client flags: + unit: + carryforward: true + e2e: + paths: + - apps/meteor/ + carryforward: true + client: paths: - apps/meteor/client From fb98eebb1101182f65054ab586fffa5dc7427f63 Mon Sep 17 00:00:00 2001 From: Tiago Evangelista Pinto Date: Wed, 6 Sep 2023 20:43:28 -0300 Subject: [PATCH 087/275] regression: Change UiKit buttons event handler (#30310) --- .../fuselage-ui-kit/src/elements/ButtonElement.tsx | 10 +++++++--- packages/fuselage-ui-kit/src/hooks/useUiKitState.ts | 5 +++-- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/fuselage-ui-kit/src/elements/ButtonElement.tsx b/packages/fuselage-ui-kit/src/elements/ButtonElement.tsx index c7fe05971e27..1f80358b3d93 100644 --- a/packages/fuselage-ui-kit/src/elements/ButtonElement.tsx +++ b/packages/fuselage-ui-kit/src/elements/ButtonElement.tsx @@ -1,6 +1,6 @@ import { Button, Throbber } from '@rocket.chat/fuselage'; import * as UiKit from '@rocket.chat/ui-kit'; -import type { ReactElement } from 'react'; +import type { MouseEventHandler, ReactElement } from 'react'; import { useUiKitState } from '../hooks/useUiKitState'; import type { BlockProps } from '../utils/BlockProps'; @@ -15,6 +15,10 @@ const ButtonElement = ({ const [{ loading }, action] = useUiKitState(block, context); const { style, url, text, value, secondary } = block; + const handleClick: MouseEventHandler = (e) => { + action({ target: e.currentTarget }); + }; + if (url) { return ( - + diff --git a/apps/meteor/client/views/account/accessibility/HighContrastUpsellModal.tsx b/apps/meteor/client/views/account/accessibility/HighContrastUpsellModal.tsx index c06501aae282..bcb28ea587d1 100644 --- a/apps/meteor/client/views/account/accessibility/HighContrastUpsellModal.tsx +++ b/apps/meteor/client/views/account/accessibility/HighContrastUpsellModal.tsx @@ -33,7 +33,7 @@ const HighContrastUpsellModal = ({ onClose }: { onClose: () => void }) => { onClose={onClose} onCancel={handleTalkToSales} onConfirm={handleGoFullyFeatured} - cancelText={t('Talk_to_sales')} + cancelText={t('Talk_to_an_expert')} confirmText={t('Start_free_trial')} /> ); diff --git a/apps/meteor/client/views/account/accessibility/MentionsWithSymbolUpsellModal.tsx b/apps/meteor/client/views/account/accessibility/MentionsWithSymbolUpsellModal.tsx new file mode 100644 index 000000000000..8a998af348c0 --- /dev/null +++ b/apps/meteor/client/views/account/accessibility/MentionsWithSymbolUpsellModal.tsx @@ -0,0 +1,41 @@ +import { useRole, useTranslation } from '@rocket.chat/ui-contexts'; +import React from 'react'; + +import GenericUpsellModal from '../../../components/GenericUpsellModal'; +import { useUpsellActions } from '../../../components/GenericUpsellModal/hooks'; + +const MentionsWithSymbolUpsellModal = ({ onClose }: { onClose: () => void }) => { + const t = useTranslation(); + + const isAdmin = useRole('admin'); + const { handleGoFullyFeatured, handleTalkToSales } = useUpsellActions(); + + if (!isAdmin) { + return ( + + ); + } + return ( + + ); +}; +export default MentionsWithSymbolUpsellModal; diff --git a/apps/meteor/client/views/account/accessibility/hooks/useAcessibilityPreferencesValues.ts b/apps/meteor/client/views/account/accessibility/hooks/useAcessibilityPreferencesValues.ts new file mode 100644 index 000000000000..339cdcff7dd9 --- /dev/null +++ b/apps/meteor/client/views/account/accessibility/hooks/useAcessibilityPreferencesValues.ts @@ -0,0 +1,31 @@ +import type { FontSize } from '@rocket.chat/rest-typings'; +import { useUserPreference } from '@rocket.chat/ui-contexts'; +import type { ThemePreference } from '@rocket.chat/ui-theming/src/types/themes'; + +export type AccessibilityPreferencesData = { + themeAppearence?: ThemePreference; + fontSize?: FontSize; + fontSizePreference?: FontSize; + mentionsWithSymbol?: boolean; + clockMode?: 0 | 1 | 2; + hideUsernames?: boolean; + hideRoles?: boolean; +}; + +export const useAccessiblityPreferencesValues = (): AccessibilityPreferencesData => { + const themeAppearence = useUserPreference('themeAppearence') || 'auto'; + const fontSize = useUserPreference('fontSize') || '100%'; + const mentionsWithSymbol = useUserPreference('mentionsWithSymbol') || false; + const clockMode = useUserPreference<0 | 1 | 2>('clockMode') ?? 0; + const hideUsernames = useUserPreference('hideUsernames'); + const hideRoles = useUserPreference('hideRoles'); + + return { + themeAppearence, + fontSize, + mentionsWithSymbol, + clockMode, + hideUsernames, + hideRoles, + }; +}; diff --git a/apps/meteor/client/views/account/accessibility/hooks/useAdsjustableFontSize.tsx b/apps/meteor/client/views/account/accessibility/hooks/useAdsjustableFontSize.tsx deleted file mode 100644 index 35607de1f9b5..000000000000 --- a/apps/meteor/client/views/account/accessibility/hooks/useAdsjustableFontSize.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import type { FontSize } from '@rocket.chat/rest-typings'; -import { useUserPreference } from '@rocket.chat/ui-contexts'; -import { useState } from 'react'; - -import { useCreateFontStyleElement } from './useCreateFontStyleElement'; - -export const useAdjustableFontSize = (): [FontSize, (value: FontSize) => void] => { - const fontSizePreference = useUserPreference('fontSize') || '100%'; - const [fontSize, setFontSize] = useState(fontSizePreference); - - useCreateFontStyleElement(fontSize); - - return [fontSize, setFontSize]; -}; diff --git a/apps/meteor/client/views/account/accessibility/hooks/useCreateFontStyleElement.ts b/apps/meteor/client/views/account/accessibility/hooks/useCreateFontStyleElement.ts index 63ecd3c0cf4b..923b3af88c60 100644 --- a/apps/meteor/client/views/account/accessibility/hooks/useCreateFontStyleElement.ts +++ b/apps/meteor/client/views/account/accessibility/hooks/useCreateFontStyleElement.ts @@ -1,4 +1,4 @@ -import { useEffect } from 'react'; +import { useMemo } from 'react'; const createStyleElement = (id: string) => { const styleElement = document.getElementById(id); @@ -10,11 +10,14 @@ const createStyleElement = (id: string) => { return newStyleElement; }; -export const useCreateFontStyleElement = (fontSize: string): void => { - useEffect(() => { - const styleElement = createStyleElement('rcx-font-size'); - const css = `html { font-size: ${fontSize}; }`; - styleElement.innerHTML = css; - document.head.appendChild(styleElement); - }, [fontSize]); +export const useCreateFontStyleElement = (): ((fontSize: string) => void) => { + return useMemo( + () => (fontSize: string) => { + const styleElement = createStyleElement('rcx-font-size'); + const css = `html { font-size: ${fontSize}; }`; + styleElement.innerHTML = css; + document.head.appendChild(styleElement); + }, + [], + ); }; diff --git a/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx index e5157d517967..30c4c5fe6725 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesMessagesSection.tsx @@ -1,14 +1,16 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { Accordion, Field, Select, FieldGroup, ToggleSwitch, Box } from '@rocket.chat/fuselage'; +import { FieldDescription, FieldLabel, Accordion, Field, Select, FieldGroup, ToggleSwitch, Box } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; -import { useSetting, useTranslation } from '@rocket.chat/ui-contexts'; +import { useRouter, useTranslation } from '@rocket.chat/ui-contexts'; import React, { useMemo } from 'react'; import { Controller, useFormContext } from 'react-hook-form'; const PreferencesMessagesSection = () => { const t = useTranslation(); - const displayRolesEnabled = useSetting('UI_DisplayRoles'); const { control } = useFormContext(); + const router = useRouter(); + + const handleGoToAccessibilityPage = () => router.navigate('/account/accessibility-and-appearance'); const alsoSendThreadMessageToChannelOptions = useMemo( (): SelectOption[] => [ @@ -19,15 +21,6 @@ const PreferencesMessagesSection = () => { [t], ); - const timeFormatOptions = useMemo( - (): SelectOption[] => [ - ['0', t('Default')], // TO DO: update SelectOption type to accept number as first item - ['1', t('12_Hour')], - ['2', t('24_Hour')], - ], - [t], - ); - const sendOnEnterOptions = useMemo( (): SelectOption[] => [ ['normal', t('Enter_Normal')], @@ -40,14 +33,11 @@ const PreferencesMessagesSection = () => { const unreadAlertId = useUniqueId(); const showThreadsInMainChannelId = useUniqueId(); const alsoSendThreadToChannelId = useUniqueId(); - const clockModeId = useUniqueId(); const useEmojisId = useUniqueId(); const convertAsciiEmojiId = useUniqueId(); const autoImageLoadId = useUniqueId(); const saveMobileBandwidthId = useUniqueId(); const collapseMediaByDefaultId = useUniqueId(); - const hideUsernamesId = useUniqueId(); - const hideRolesId = useUniqueId(); const hideFlexTabId = useUniqueId(); const displayAvatarsId = useUniqueId(); const sendOnEnterId = useUniqueId(); @@ -114,16 +104,10 @@ const PreferencesMessagesSection = () => { - {t('Message_TimeFormat')} - - ( - - {children} - - ); -} diff --git a/packages/livechat/src/components/FilesDropTarget/index.tsx b/packages/livechat/src/components/FilesDropTarget/index.tsx new file mode 100644 index 000000000000..3e9935c37565 --- /dev/null +++ b/packages/livechat/src/components/FilesDropTarget/index.tsx @@ -0,0 +1,122 @@ +import type { ComponentChildren, Ref } from 'preact'; +import type { TargetedEvent } from 'preact/compat'; +import { useState } from 'preact/hooks'; +import type { JSXInternal } from 'preact/src/jsx'; + +import { createClassName } from '../../helpers/createClassName'; +import styles from './styles.scss'; + +const escapeForRegExp = (string: string) => string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); + +type FilesDropTargetProps = { + overlayed?: boolean; + overlayText?: string; + accept?: string; + multiple?: boolean; + className?: string; + style?: JSXInternal.CSSProperties; + children?: ComponentChildren; + inputRef?: Ref; + onUpload?: (files: File[]) => void; +}; + +export const FilesDropTarget = ({ + overlayed, + overlayText, + accept, + multiple, + className, + style = {}, + children, + inputRef, + onUpload, +}: FilesDropTargetProps) => { + const [dragLevel, setDragLevel] = useState(0); + + const handleDragOver = (event: DragEvent) => { + event.preventDefault(); + }; + + const handleDragEnter = (event: DragEvent) => { + event.preventDefault(); + setDragLevel(dragLevel + 1); + }; + + const handleDragLeave = (event: DragEvent) => { + event.preventDefault(); + setDragLevel(dragLevel - 1); + }; + + const handleDrop = (event: DragEvent) => { + event.preventDefault(); + + if (dragLevel === 0 || !event?.dataTransfer?.files?.length) { + return; + } + + setDragLevel(0); + + handleUpload(event?.dataTransfer?.files); + }; + + const handleInputChange = (event: TargetedEvent) => { + if (!event?.currentTarget?.files?.length) { + return; + } + + handleUpload(event.currentTarget.files); + }; + + const handleUpload = (files: FileList) => { + if (!onUpload) { + return; + } + + let filteredFiles = Array.from(files); + + if (accept) { + const acceptMatchers = accept.split(',').map((acceptString) => { + if (acceptString.charAt(0) === '.') { + return ({ name }: { name: string }) => new RegExp(`${escapeForRegExp(acceptString)}$`, 'i').test(name); + } + + const matchTypeOnly = /^(.+)\/\*$/i.exec(acceptString); + if (matchTypeOnly) { + return ({ type }: { type: string }) => new RegExp(`^${escapeForRegExp(matchTypeOnly[1])}/.*$`, 'i').test(type); + } + + return ({ type }: { type: string }) => new RegExp(`^s${escapeForRegExp(acceptString)}$`, 'i').test(type); + }); + + filteredFiles = filteredFiles.filter((file) => acceptMatchers.some((acceptMatcher) => acceptMatcher(file))); + } + + if (!multiple) { + filteredFiles = filteredFiles.slice(0, 1); + } + + filteredFiles.length && onUpload(filteredFiles); + }; + + return ( +
0 }, [className])} + style={style} + > + + {children} +
+ ); +}; diff --git a/packages/livechat/src/components/FilesDropTarget/stories.tsx b/packages/livechat/src/components/FilesDropTarget/stories.tsx index e1a01cbaea09..d687fbaad492 100644 --- a/packages/livechat/src/components/FilesDropTarget/stories.tsx +++ b/packages/livechat/src/components/FilesDropTarget/stories.tsx @@ -71,7 +71,7 @@ AcceptingMultipleFiles.args = { export const TriggeringBrowseAction = Template.bind({}); TriggeringBrowseAction.storyName = 'triggering browse action'; -const ref = createRef(); +const inputRef = createRef(); TriggeringBrowseAction.args = { children: (
- +
), - ref, + inputRef, }; diff --git a/packages/livechat/src/routes/Chat/component.js b/packages/livechat/src/routes/Chat/component.js index 98991ab72b53..8bd9ac468c6e 100644 --- a/packages/livechat/src/routes/Chat/component.js +++ b/packages/livechat/src/routes/Chat/component.js @@ -1,4 +1,4 @@ -import { Component } from 'preact'; +import { Component, createRef } from 'preact'; import { Suspense, lazy } from 'preact/compat'; import { withTranslation } from 'react-i18next'; @@ -35,6 +35,8 @@ class Chat extends Component { emojiPickerActive: false, }; + inputRef = createRef(null); + handleFilesDropTargetRef = (ref) => { this.filesDropTarget = ref; }; @@ -61,7 +63,7 @@ class Chat extends Component { handleUploadClick = (event) => { event.preventDefault(); - this.filesDropTarget.browse(); + this.inputRef?.current?.click(); }; handleSendClick = (event) => { @@ -151,7 +153,7 @@ class Chat extends Component { handleEmojiClick={this.handleEmojiClick} {...props} > - + {incomingCallAlert && !!incomingCallAlert.show && } {incomingCallAlert?.show && ongoingCall && ongoingCall.callStatus === CallStatus.IN_PROGRESS_SAME_TAB ? ( From 781bdfe9055ce1178629d5e6d0c147c2071356c0 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Thu, 14 Sep 2023 14:47:15 -0300 Subject: [PATCH 135/275] regression: commit subject alignment --- apps/meteor/client/views/admin/info/DeploymentCard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/client/views/admin/info/DeploymentCard.tsx b/apps/meteor/client/views/admin/info/DeploymentCard.tsx index 6bc9ece2b850..7a95e7aae018 100644 --- a/apps/meteor/client/views/admin/info/DeploymentCard.tsx +++ b/apps/meteor/client/views/admin/info/DeploymentCard.tsx @@ -65,7 +65,7 @@ const DeploymentCard = ({ info, statistics, instances }: DeploymentCardProps): R {t('Commit_details')} {t('github_HEAD')}: ({commit.hash ? commit.hash.slice(0, 9) : ''})
- {t('Branch')}: {commit.branch} + {t('Branch')}: {commit.branch}
{commit.subject}
From 3bbe12e8502680151b488816d903d8d46372d06e Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Thu, 14 Sep 2023 18:10:03 +0000 Subject: [PATCH 136/275] Bump 6.3.6 --- .changeset/bump-patch-1694715003701.md | 5 +++++ yarn.lock | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/bump-patch-1694715003701.md diff --git a/.changeset/bump-patch-1694715003701.md b/.changeset/bump-patch-1694715003701.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1694715003701.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/yarn.lock b/yarn.lock index 2c9a3afee277..f74e6ebcd635 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9898,9 +9898,9 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.4 + "@rocket.chat/ui-contexts": 1.0.5 "@rocket.chat/ui-kit": "*" - "@rocket.chat/ui-video-conf": 1.0.4 + "@rocket.chat/ui-video-conf": 1.0.5 "@tanstack/react-query": "*" react: "*" react-dom: "*" @@ -9982,14 +9982,14 @@ __metadata: ts-jest: ~29.0.5 typescript: ~5.1.3 peerDependencies: - "@rocket.chat/core-typings": 6.3.4 + "@rocket.chat/core-typings": 6.3.5 "@rocket.chat/css-in-js": "*" "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-tokens": "*" "@rocket.chat/message-parser": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-client": 1.0.4 - "@rocket.chat/ui-contexts": 1.0.4 + "@rocket.chat/ui-client": 1.0.5 + "@rocket.chat/ui-contexts": 1.0.5 katex: "*" react: "*" languageName: unknown @@ -11048,7 +11048,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 1.0.4 + "@rocket.chat/ui-contexts": 1.0.5 react: ~17.0.2 languageName: unknown linkType: soft @@ -11202,7 +11202,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.4 + "@rocket.chat/ui-contexts": 1.0.5 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -11268,7 +11268,7 @@ __metadata: typescript: ~5.1.3 peerDependencies: "@rocket.chat/layout": "*" - "@rocket.chat/ui-contexts": 1.0.4 + "@rocket.chat/ui-contexts": 1.0.5 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From 285e591a732d0c8f3f4ba7917a9a9dc41c785232 Mon Sep 17 00:00:00 2001 From: Rafael Tapia Date: Thu, 7 Sep 2023 15:43:15 -0300 Subject: [PATCH 137/275] fix: engagement dashboard not working (#30277) --- .changeset/lucky-balloons-divide.md | 5 +++++ apps/meteor/app/statistics/server/lib/SAUMonitor.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/lucky-balloons-divide.md diff --git a/.changeset/lucky-balloons-divide.md b/.changeset/lucky-balloons-divide.md new file mode 100644 index 000000000000..beb4cbfe3b57 --- /dev/null +++ b/.changeset/lucky-balloons-divide.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fix engagement dashboard not showing data diff --git a/apps/meteor/app/statistics/server/lib/SAUMonitor.ts b/apps/meteor/app/statistics/server/lib/SAUMonitor.ts index de6b0877d973..370bb3774e20 100644 --- a/apps/meteor/app/statistics/server/lib/SAUMonitor.ts +++ b/apps/meteor/app/statistics/server/lib/SAUMonitor.ts @@ -46,7 +46,7 @@ export class SAUMonitorClass { constructor() { this._started = false; this._dailyComputeJobName = 'aggregate-sessions'; - this._dailyFinishSessionsJobName = 'aggregate-sessions'; + this._dailyFinishSessionsJobName = 'finish-sessions'; } async start(): Promise { From 886631bef6c6dcaae58f5143f869b0d6e38e0aeb Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Thu, 14 Sep 2023 12:20:48 -0600 Subject: [PATCH 138/275] regression: Move queue-timeout setting to CE and remove dependency on waiting queue (#30386) --- .../app/livechat-enterprise/server/settings.ts | 16 ---------------- apps/meteor/server/services/omnichannel/queue.ts | 2 +- apps/meteor/server/settings/omnichannel.ts | 10 ++++++++++ 3 files changed, 11 insertions(+), 17 deletions(-) diff --git a/apps/meteor/ee/app/livechat-enterprise/server/settings.ts b/apps/meteor/ee/app/livechat-enterprise/server/settings.ts index d72e5364d101..0f21374ebf83 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/settings.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/settings.ts @@ -114,22 +114,6 @@ export const createSettings = async (): Promise => { modules: ['livechat-enterprise'], }); - await this.add('Omnichannel_queue_delay_timeout', 5, { - type: 'int', - group: 'Omnichannel', - section: 'Queue_management', - i18nLabel: 'Queue_delay_timeout', - i18nDescription: 'Time_in_seconds', - enableQuery: [ - { _id: 'Livechat_waiting_queue', value: true }, - { _id: 'Livechat_Routing_Method', value: { $ne: 'Manual_Selection' } }, - omnichannelEnabledQuery, - ], - enterprise: true, - invalidValue: 5, - modules: ['livechat-enterprise'], - }); - await this.add('Livechat_number_most_recent_chats_estimate_wait_time', 100, { type: 'int', group: 'Omnichannel', diff --git a/apps/meteor/server/services/omnichannel/queue.ts b/apps/meteor/server/services/omnichannel/queue.ts index 8bf5453587ce..684c10161a94 100644 --- a/apps/meteor/server/services/omnichannel/queue.ts +++ b/apps/meteor/server/services/omnichannel/queue.ts @@ -15,7 +15,7 @@ export class OmnichannelQueue implements IOmnichannelQueue { private queues: (string | undefined)[] = []; private delay() { - const timeout = settings.get('Omnichannel_queue_delay_timeout'); + const timeout = settings.get('Omnichannel_queue_delay_timeout') ?? 5; return timeout < 1 ? DEFAULT_RACE_TIMEOUT : timeout * 1000; } diff --git a/apps/meteor/server/settings/omnichannel.ts b/apps/meteor/server/settings/omnichannel.ts index 70fa92d347b8..fe5d27c1e677 100644 --- a/apps/meteor/server/settings/omnichannel.ts +++ b/apps/meteor/server/settings/omnichannel.ts @@ -534,6 +534,16 @@ export const createOmniSettings = () => enableQuery: [{ _id: 'Livechat_Routing_Method', value: 'External' }, omnichannelEnabledQuery], }); + await this.add('Omnichannel_queue_delay_timeout', 5, { + type: 'int', + group: 'Omnichannel', + section: 'Queue_management', + i18nLabel: 'Queue_delay_timeout', + i18nDescription: 'Time_in_seconds', + enableQuery: [{ _id: 'Livechat_Routing_Method', value: { $ne: 'Manual_Selection' } }, omnichannelEnabledQuery], + invalidValue: 5, + }); + await this.add('Livechat_Allow_collect_and_store_HTTP_header_informations', false, { type: 'boolean', group: 'Omnichannel', From 7ac55bfac9d2509dfd45988c4976ed1bf0f4c82e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrique=20Guimar=C3=A3es=20Ribeiro?= Date: Thu, 14 Sep 2023 15:32:13 -0300 Subject: [PATCH 139/275] regression: Fix rooms table not showing teams (#30361) --- apps/meteor/client/views/admin/rooms/RoomsTable.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/meteor/client/views/admin/rooms/RoomsTable.tsx b/apps/meteor/client/views/admin/rooms/RoomsTable.tsx index c480fab9f657..094ccb95857a 100644 --- a/apps/meteor/client/views/admin/rooms/RoomsTable.tsx +++ b/apps/meteor/client/views/admin/rooms/RoomsTable.tsx @@ -22,14 +22,15 @@ import RoomsTableFilters from './RoomsTableFilters'; type RoomFilters = { searchText: string; types: OptionProp[]; - visibility: OptionProp[]; }; +const DEFAULT_TYPES = ['d', 'p', 'c', 'l', 'discussions', 'teams']; + const RoomsTable = ({ reload }: { reload: MutableRefObject<() => void> }): ReactElement => { const t = useTranslation(); const mediaQuery = useMediaQuery('(min-width: 1024px)'); - const [roomFilters, setRoomFilters] = useState({ searchText: '', types: [], visibility: [] }); + const [roomFilters, setRoomFilters] = useState({ searchText: '', types: [] }); const prevRoomFilterText = useRef(roomFilters.searchText); @@ -47,7 +48,7 @@ const RoomsTable = ({ reload }: { reload: MutableRefObject<() => void> }): React sort: `{ "${sortBy}": ${sortDirection === 'asc' ? 1 : -1} }`, count: itemsPerPage, offset: searchText === prevRoomFilterText.current ? current : 0, - types: [...roomFilters.types.map((roomType) => roomType.id)], + types: roomFilters.types.length ? [...roomFilters.types.map((roomType) => roomType.id)] : DEFAULT_TYPES, }; }, [searchText, sortBy, sortDirection, itemsPerPage, current, roomFilters.types, setCurrent]), 500, From 3a3245a8e182349ea92396657ec6159815f2ac80 Mon Sep 17 00:00:00 2001 From: Heitor Tanoue <68477006+heitortanoue@users.noreply.github.com> Date: Thu, 14 Sep 2023 16:02:09 -0300 Subject: [PATCH 140/275] test: tests for muting and unmuting (#30286) --- .../meteor/tests/end-to-end/api/24-methods.js | 235 +++++++++++++++++- 1 file changed, 234 insertions(+), 1 deletion(-) diff --git a/apps/meteor/tests/end-to-end/api/24-methods.js b/apps/meteor/tests/end-to-end/api/24-methods.js index 032d25018066..899eb0db7d5f 100644 --- a/apps/meteor/tests/end-to-end/api/24-methods.js +++ b/apps/meteor/tests/end-to-end/api/24-methods.js @@ -5,7 +5,7 @@ import { getCredentials, request, methodCall, api, credentials } from '../../dat import { CI_MAX_ROOMS_PER_GUEST as maxRoomsPerGuest } from '../../data/constants'; import { updatePermission, updateSetting } from '../../data/permissions.helper'; import { createRoom } from '../../data/rooms.helper'; -import { createUser, deleteUser } from '../../data/users.helper.js'; +import { createUser, deleteUser, login } from '../../data/users.helper.js'; describe('Meteor.methods', function () { this.retries(0); @@ -2397,4 +2397,237 @@ describe('Meteor.methods', function () { }); }); }); + + describe('[@muteUserInRoom & @unmuteUserInRoom]', () => { + let rid = null; + let channelName = null; + let testUser = null; + let testUserCredentials = {}; + + before('create test user', async () => { + const username = `user.test.${Date.now()}`; + const email = `${username}@rocket.chat`; + + testUser = await createUser({ email, name: username, username, password: username, roles: ['user'] }); + }); + + before('create channel', async () => { + channelName = `methods-test-channel-${Date.now()}`; + rid = (await createRoom({ type: 'c', name: channelName, members: [testUser.username] })).body.channel._id; + }); + + before('login testUser', async () => { + testUserCredentials = await login(testUser.username, testUser.username); + }); + + describe('-> standard room', () => { + describe('- when muting a user in a standard room', () => { + it('should mute an user in a standard room', async () => { + await request + .post(methodCall('muteUserInRoom')) + .set(credentials) + .send({ + message: JSON.stringify({ + method: 'muteUserInRoom', + params: [{ rid, username: testUser.username }], + id: 'id', + msg: 'method', + }), + }) + .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('message').that.is.a('string'); + const data = JSON.parse(res.body.message); + expect(data).to.have.a.property('msg', 'result'); + expect(data).to.have.a.property('id', 'id'); + expect(data).not.to.have.a.property('error'); + }); + }); + + it('muted user should not be able to send message', async () => { + await request + .post(api('chat.sendMessage')) + .set(testUserCredentials) + .send({ + message: { + msg: 'Sample message', + rid, + }, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error').that.is.a('string'); + expect(res.body.error).to.equal('You_have_been_muted'); + }); + }); + }); + + describe('- when unmuting a user in a standard room', () => { + it('should unmute an user in a standard room', async () => { + await request + .post(methodCall('unmuteUserInRoom')) + .set(credentials) + .send({ + message: JSON.stringify({ + method: 'unmuteUserInRoom', + params: [{ rid, username: testUser.username }], + id: 'id', + msg: 'method', + }), + }) + .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('message').that.is.a('string'); + const data = JSON.parse(res.body.message); + expect(data).to.have.a.property('msg', 'result'); + expect(data).to.have.a.property('id', 'id'); + expect(data).not.to.have.a.property('error'); + }); + }); + + it('unmuted user should be able to send message', async () => { + await request + .post(api('chat.sendMessage')) + .set(testUserCredentials) + .send({ + message: { + msg: 'Sample message', + rid, + }, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }); + }); + }); + }); + + describe('-> read-only room', () => { + before('set room to read-only', async () => { + await request + .post(api('channels.setReadOnly')) + .set(credentials) + .send({ + roomId: rid, + readOnly: true, + }) + .expect('Content-Type', 'application/json') + .expect(200); + }); + + it('should not allow an user to send messages', async () => { + await request + .post(api('chat.sendMessage')) + .set(testUserCredentials) + .send({ + message: { + msg: 'Sample message', + rid, + }, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error').that.is.a('string'); + expect(res.body.error).to.equal(`You can't send messages because the room is readonly.`); + }); + }); + + describe('- when unmuting a user in a read-only room', () => { + it('should unmute an user in a read-only room', async () => { + await request + .post(methodCall('unmuteUserInRoom')) + .set(credentials) + .send({ + message: JSON.stringify({ + method: 'unmuteUserInRoom', + params: [{ rid, username: testUser.username }], + id: 'id', + msg: 'method', + }), + }) + .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('message').that.is.a('string'); + const data = JSON.parse(res.body.message); + expect(data).to.have.a.property('msg', 'result'); + expect(data).to.have.a.property('id', 'id'); + expect(data).not.to.have.a.property('error'); + }); + }); + + it('unmuted user in read-only room should be able to send message', async () => { + await request + .post(api('chat.sendMessage')) + .set(testUserCredentials) + .send({ + message: { + msg: 'Sample message', + rid, + }, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }); + }); + }); + + describe('- when muting a user in a read-only room', () => { + it('should mute an user in a read-only room', async () => { + await request + .post(methodCall('muteUserInRoom')) + .set(credentials) + .send({ + message: JSON.stringify({ + method: 'muteUserInRoom', + params: [{ rid, username: testUser.username }], + id: 'id', + msg: 'method', + }), + }) + .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('message').that.is.a('string'); + const data = JSON.parse(res.body.message); + expect(data).to.have.a.property('msg', 'result'); + expect(data).to.have.a.property('id', 'id'); + expect(data).not.to.have.a.property('error'); + }); + }); + + it('muted user in read-only room should not be able to send message', async () => { + await request + .post(api('chat.sendMessage')) + .set(testUserCredentials) + .send({ + message: { + msg: 'Sample message', + rid, + }, + }) + .expect('Content-Type', 'application/json') + .expect(400) + .expect((res) => { + expect(res.body).to.have.property('success', false); + expect(res.body).to.have.property('error').that.is.a('string'); + }); + }); + }); + }); + }); }); From fa0708bea098e5851398a69c3f3487046afeb4b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrique=20Guimar=C3=A3es=20Ribeiro?= Date: Thu, 14 Sep 2023 18:06:52 -0300 Subject: [PATCH 141/275] regression: Login page callout messages (#30399) --- packages/web-ui-registration/src/LoginForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/web-ui-registration/src/LoginForm.tsx b/packages/web-ui-registration/src/LoginForm.tsx index 112139a483e6..efc7e6268feb 100644 --- a/packages/web-ui-registration/src/LoginForm.tsx +++ b/packages/web-ui-registration/src/LoginForm.tsx @@ -99,7 +99,7 @@ export const LoginForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRoute const renderErrorOnSubmit = (error: LoginErrors) => { const { type, i18n } = LOGIN_SUBMIT_ERRORS[error]; - return {i18n}; + return {t(i18n)}; }; if (errors.username?.type === 'invalid-email') { From db43ef890b39b3575749a0343274e523e9e8cd1c Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Thu, 14 Sep 2023 23:57:54 +0000 Subject: [PATCH 142/275] Release 6.3.6 [no ci] --- .changeset/bump-patch-1694715003701.md | 5 ---- .changeset/lucky-balloons-divide.md | 5 ---- apps/meteor/.docker/Dockerfile.rhel | 2 +- apps/meteor/CHANGELOG.md | 26 +++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 10 +++++++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 10 +++++++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 10 +++++++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 12 +++++++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 11 ++++++++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 10 +++++++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 10 +++++++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 9 +++++++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 7 +++++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 7 +++++ ee/packages/ddp-client/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 11 ++++++++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 6 +++++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 8 ++++++ ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 8 ++++++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 2 ++ packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 7 +++++ packages/cron/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 8 ++++++ packages/fuselage-ui-kit/package.json | 6 ++--- packages/gazzodown/CHANGELOG.md | 8 ++++++ packages/gazzodown/package.json | 8 +++--- packages/instance-status/CHANGELOG.md | 6 +++++ packages/instance-status/package.json | 2 +- packages/model-typings/CHANGELOG.md | 6 +++++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 6 +++++ packages/models/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 6 +++++ packages/rest-typings/package.json | 2 +- packages/ui-client/CHANGELOG.md | 6 +++++ packages/ui-client/package.json | 4 +-- packages/ui-contexts/CHANGELOG.md | 8 ++++++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 6 +++++ packages/ui-video-conf/package.json | 4 +-- packages/uikit-playground/CHANGELOG.md | 7 +++++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 6 +++++ packages/web-ui-registration/package.json | 4 +-- 61 files changed, 276 insertions(+), 49 deletions(-) delete mode 100644 .changeset/bump-patch-1694715003701.md delete mode 100644 .changeset/lucky-balloons-divide.md diff --git a/.changeset/bump-patch-1694715003701.md b/.changeset/bump-patch-1694715003701.md deleted file mode 100644 index e1eaa7980afb..000000000000 --- a/.changeset/bump-patch-1694715003701.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Bump @rocket.chat/meteor version. diff --git a/.changeset/lucky-balloons-divide.md b/.changeset/lucky-balloons-divide.md deleted file mode 100644 index beb4cbfe3b57..000000000000 --- a/.changeset/lucky-balloons-divide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fix engagement dashboard not showing data diff --git a/apps/meteor/.docker/Dockerfile.rhel b/apps/meteor/.docker/Dockerfile.rhel index c351eb6d4450..df3f57884ce1 100644 --- a/apps/meteor/.docker/Dockerfile.rhel +++ b/apps/meteor/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 6.3.5 +ENV RC_VERSION 6.3.6 MAINTAINER buildmaster@rocket.chat diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index 312d30461f77..411d568aadb5 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,31 @@ # @rocket.chat/meteor +## 6.3.6 + +### Patch Changes + +- 3bbe12e850: Bump @rocket.chat/meteor version. +- Bump @rocket.chat/meteor version. +- 285e591a73: Fix engagement dashboard not showing data + - @rocket.chat/core-typings@6.3.6 + - @rocket.chat/rest-typings@6.3.6 + - @rocket.chat/api-client@0.1.6 + - @rocket.chat/omnichannel-services@0.0.12 + - @rocket.chat/pdf-worker@0.0.12 + - @rocket.chat/presence@0.0.12 + - @rocket.chat/core-services@0.1.6 + - @rocket.chat/cron@0.0.8 + - @rocket.chat/gazzodown@1.0.6 + - @rocket.chat/model-typings@0.0.12 + - @rocket.chat/ui-contexts@1.0.6 + - @rocket.chat/fuselage-ui-kit@1.0.6 + - @rocket.chat/models@0.0.12 + - @rocket.chat/ui-theming@0.0.1 + - @rocket.chat/ui-client@1.0.6 + - @rocket.chat/ui-video-conf@1.0.6 + - @rocket.chat/web-ui-registration@1.0.6 + - @rocket.chat/instance-status@0.0.12 + ## 6.3.5 ### Patch Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index ad7a7f611711..dd5225ccd8d7 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.3.5" + "version": "6.3.6" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index faa70b77b09c..fef6a1afd627 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,15 @@ # rocketchat-services +## 1.1.6 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/rest-typings@6.3.6 +- @rocket.chat/core-services@0.1.6 +- @rocket.chat/model-typings@0.0.12 +- @rocket.chat/models@0.0.12 + ## 1.1.5 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 1d6834ce99d2..9cd474d8d313 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.5", + "version": "1.1.6", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index f33e836995a9..03b83755faa5 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.3.5", + "version": "6.3.6", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index aaa49cdc19aa..9fabd0886289 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/account-service +## 0.2.6 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/rest-typings@6.3.6 +- @rocket.chat/core-services@0.1.6 +- @rocket.chat/model-typings@0.0.12 +- @rocket.chat/models@0.0.12 + ## 0.2.5 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index 047d313cf5a5..4d987dd0a002 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.2.5", + "version": "0.2.6", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index 7587e33e021e..528320aa2622 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/authorization-service +## 0.2.6 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/rest-typings@6.3.6 +- @rocket.chat/core-services@0.1.6 +- @rocket.chat/model-typings@0.0.12 +- @rocket.chat/models@0.0.12 + ## 0.2.5 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index ef397d1812da..60ca18dcd9dd 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.2.5", + "version": "0.2.6", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index 493157091bae..f5a32f533a43 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/ddp-streamer +## 0.1.6 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/rest-typings@6.3.6 +- @rocket.chat/core-services@0.1.6 +- @rocket.chat/model-typings@0.0.12 +- @rocket.chat/ui-contexts@1.0.6 +- @rocket.chat/models@0.0.12 +- @rocket.chat/instance-status@0.0.12 + ## 0.1.5 ### Patch Changes diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 9f804c175f20..2db7333fe350 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.1.5", + "version": "0.1.6", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index c1ea9bcc713d..dcb38ad24016 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-transcript +## 0.2.6 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/omnichannel-services@0.0.12 +- @rocket.chat/pdf-worker@0.0.12 +- @rocket.chat/core-services@0.1.6 +- @rocket.chat/model-typings@0.0.12 +- @rocket.chat/models@0.0.12 + ## 0.2.5 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index d4ca4c276817..4b6edef420de 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.2.5", + "version": "0.2.6", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index 788c4e8ee58f..ac9e0c98c089 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/presence-service +## 0.2.6 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/presence@0.0.12 +- @rocket.chat/core-services@0.1.6 +- @rocket.chat/model-typings@0.0.12 +- @rocket.chat/models@0.0.12 + ## 0.2.5 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index 6c034ec44f29..a2c39e0518c2 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.2.5", + "version": "0.2.6", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index fd65d61ca6db..cb7e231f3aa6 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/queue-worker +## 0.2.6 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/omnichannel-services@0.0.12 +- @rocket.chat/core-services@0.1.6 +- @rocket.chat/model-typings@0.0.12 +- @rocket.chat/models@0.0.12 + ## 0.2.5 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index 9b71610bf208..8c6df52977ce 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.2.5", + "version": "0.2.6", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index 6d7c07507afd..2d03cc992eb3 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/stream-hub-service +## 0.2.6 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/core-services@0.1.6 +- @rocket.chat/model-typings@0.0.12 +- @rocket.chat/models@0.0.12 + ## 0.2.5 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index a33e0e01a02c..aacd997473e1 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.2.5", + "version": "0.2.6", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index 6bfc7ca29e86..7424a2793b7f 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/api-client +## 0.1.6 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/rest-typings@6.3.6 + ## 0.1.5 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index 322df088445d..463a1a835059 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/api-client", - "version": "0.1.5", + "version": "0.1.6", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index 93091ac68a74..067872b9102e 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/ddp-client +## 0.1.6 + +### Patch Changes + +- @rocket.chat/rest-typings@6.3.6 +- @rocket.chat/api-client@0.1.6 + ## 0.1.5 ### Patch Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index 7548af76d202..da4701cfa450 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ddp-client", - "version": "0.1.5", + "version": "0.1.6", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index 309b9db3d4ab..2978b6e0d040 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-services +## 0.0.12 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/rest-typings@6.3.6 +- @rocket.chat/pdf-worker@0.0.12 +- @rocket.chat/core-services@0.1.6 +- @rocket.chat/model-typings@0.0.12 +- @rocket.chat/models@0.0.12 + ## 0.0.11 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index a3f3f594026f..b52222b745e6 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.0.11", + "version": "0.0.12", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index 4f6a6457035c..854547b5f9ec 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/pdf-worker +## 0.0.12 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 + ## 0.0.11 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index 0f141493e1e2..5523064812b7 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.11", + "version": "0.0.12", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index 9a190ef2cce4..bb5797aa4bf0 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/presence +## 0.0.12 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/core-services@0.1.6 +- @rocket.chat/models@0.0.12 + ## 0.0.11 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 7d83e5833f62..5c4d5ff68864 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.0.11", + "version": "0.0.12", "private": true, "devDependencies": { "@babel/core": "~7.22.5", diff --git a/package.json b/package.json index 2147c4f3d9fb..4674313c5096 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.3.5", + "version": "6.3.6", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index ea6e66ae4e75..e3f1dae4abc0 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/core-services +## 0.1.6 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/rest-typings@6.3.6 +- @rocket.chat/models@0.0.12 + ## 0.1.5 ### Patch Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 152d7ed8ff30..2222ac18e05a 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.1.5", + "version": "0.1.6", "private": true, "devDependencies": { "@babel/core": "^7.21.4", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index cf9fcdfceaed..94c719551e59 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,7 @@ # @rocket.chat/core-typings +## 6.3.6 + ## 6.3.5 ## 6.3.4 diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 705e5ee1703c..3cd0a312aa4b 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-typings", - "version": "6.3.5", + "version": "6.3.6", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.43.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index 44f83d2a66eb..2bee9aea43fe 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/cron +## 0.0.8 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/models@0.0.12 + ## 0.0.7 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index 483f86e1bfa9..ffec42e7056a 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.7", + "version": "0.0.8", "private": true, "devDependencies": { "@types/jest": "^27.4.1", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index a9d9d80edbad..4f4601173288 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 1.0.6 + +### Patch Changes + +- @rocket.chat/gazzodown@1.0.6 +- @rocket.chat/ui-contexts@1.0.6 +- @rocket.chat/ui-video-conf@1.0.6 + ## 1.0.5 ### Patch Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index c213f1006e88..2330e2825076 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "1.0.5", + "version": "1.0.6", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -47,9 +47,9 @@ "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "1.0.5", + "@rocket.chat/ui-contexts": "1.0.6", "@rocket.chat/ui-kit": "*", - "@rocket.chat/ui-video-conf": "1.0.5", + "@rocket.chat/ui-video-conf": "1.0.6", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index 017cfda56da1..8eadf7c8ee12 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/gazzodown +## 1.0.6 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/ui-contexts@1.0.6 +- @rocket.chat/ui-client@1.0.6 + ## 1.0.5 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index e7bcd59c70d0..00acba4363c7 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "1.0.5", + "version": "1.0.6", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.3.5", + "@rocket.chat/core-typings": "6.3.6", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "1.0.5", - "@rocket.chat/ui-contexts": "1.0.5", + "@rocket.chat/ui-client": "1.0.6", + "@rocket.chat/ui-contexts": "1.0.6", "katex": "*", "react": "*" }, diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index 7bf8af7c0408..830f4b9304a7 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/instance-status +## 0.0.12 + +### Patch Changes + +- @rocket.chat/models@0.0.12 + ## 0.0.11 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index df467c68749f..b47b71936a9f 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.11", + "version": "0.0.12", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index 0b24ee6c382f..26ccaa9524bf 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/model-typings +## 0.0.12 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 + ## 0.0.11 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index 408993ef7fae..2029970c8a62 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.0.11", + "version": "0.0.12", "private": true, "devDependencies": { "@types/jest": "~29.5.2", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index d3a9722b3e26..3f7d7e9456bd 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/models +## 0.0.12 + +### Patch Changes + +- @rocket.chat/model-typings@0.0.12 + ## 0.0.11 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index 27d5d58fcb81..f4991ae85db1 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.11", + "version": "0.0.12", "private": true, "devDependencies": { "@types/jest": "~29.5.2", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index d3c98c1d5d36..b708dfc8ac89 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/rest-typings +## 6.3.6 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 + ## 6.3.5 ### Patch Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 5be801d3db98..f4d6c8c6beb8 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/rest-typings", - "version": "6.3.5", + "version": "6.3.6", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.2", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index 1b31effb7118..3dc07e124e60 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-client +## 1.0.6 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.6 + ## 1.0.5 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 67f65cb44f8b..6b5b5959a4bf 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "1.0.5", + "version": "1.0.6", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -53,7 +53,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "1.0.5", + "@rocket.chat/ui-contexts": "1.0.6", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index fa7eac82131b..dd6bf6a33e6e 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/ui-contexts +## 1.0.6 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/rest-typings@6.3.6 +- @rocket.chat/ddp-client@0.1.6 + ## 1.0.5 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 3a1f3cfc92d1..979442310f20 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "1.0.5", + "version": "1.0.6", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index b87008e5df9c..a0b379bf3b6b 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-video-conf +## 1.0.6 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.6 + ## 1.0.5 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index d8b1f62f744c..fbd8c6843909 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "1.0.5", + "version": "1.0.6", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "1.0.5", + "@rocket.chat/ui-contexts": "1.0.6", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index 0500041f3f23..0f539a5fdbb9 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/uikit-playground +## 0.1.6 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.6 +- @rocket.chat/fuselage-ui-kit@1.0.6 + ## 0.1.5 ### Patch Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index 60ba6b84dc2a..58930541bedd 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.1.5", + "version": "0.1.6", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index 58b731980522..c87f91401ab9 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/web-ui-registration +## 1.0.6 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.6 + ## 1.0.5 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index 3e64f17725e4..686ddff549b4 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "1.0.5", + "version": "1.0.6", "private": true, "devDependencies": { "@rocket.chat/layout": "next", @@ -17,7 +17,7 @@ }, "peerDependencies": { "@rocket.chat/layout": "*", - "@rocket.chat/ui-contexts": "1.0.5", + "@rocket.chat/ui-contexts": "1.0.6", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", From f634601d909812b368941298e428af96f671fb83 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Fri, 15 Sep 2023 01:31:48 +0000 Subject: [PATCH 143/275] Release 6.4.0-rc.1 [no ci] --- .changeset/bump-patch-1694741499930.md | 5 ++++ .changeset/pre.json | 1 + apps/meteor/.docker/Dockerfile.rhel | 2 +- apps/meteor/CHANGELOG.md | 24 +++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 10 ++++++++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 10 ++++++++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 10 ++++++++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 12 ++++++++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 11 +++++++++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 10 ++++++++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 10 ++++++++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 9 +++++++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 7 ++++++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 7 ++++++ ee/packages/ddp-client/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 11 +++++++++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 6 +++++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 8 +++++++ ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 8 +++++++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 2 ++ packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 7 ++++++ packages/cron/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 8 +++++++ packages/fuselage-ui-kit/package.json | 6 ++--- packages/gazzodown/CHANGELOG.md | 8 +++++++ packages/gazzodown/package.json | 8 +++---- packages/instance-status/CHANGELOG.md | 6 +++++ packages/instance-status/package.json | 2 +- packages/livechat/CHANGELOG.md | 6 +++++ packages/livechat/package.json | 2 +- packages/model-typings/CHANGELOG.md | 6 +++++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 6 +++++ packages/models/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 6 +++++ packages/rest-typings/package.json | 2 +- packages/ui-client/CHANGELOG.md | 6 +++++ packages/ui-client/package.json | 4 ++-- packages/ui-contexts/CHANGELOG.md | 8 +++++++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 6 +++++ packages/ui-video-conf/package.json | 4 ++-- packages/uikit-playground/CHANGELOG.md | 7 ++++++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 6 +++++ packages/web-ui-registration/package.json | 4 ++-- 63 files changed, 287 insertions(+), 40 deletions(-) create mode 100644 .changeset/bump-patch-1694741499930.md diff --git a/.changeset/bump-patch-1694741499930.md b/.changeset/bump-patch-1694741499930.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1694741499930.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/.changeset/pre.json b/.changeset/pre.json index e39bf5821cf9..bf2911665af5 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -56,6 +56,7 @@ "bright-carpets-fly", "bright-snakes-vanish", "brown-clouds-add", + "bump-patch-1694741499930", "chilled-flies-fold", "chilled-phones-give", "cool-students-tan", diff --git a/apps/meteor/.docker/Dockerfile.rhel b/apps/meteor/.docker/Dockerfile.rhel index fc8ddacd14bc..037a4e51337e 100644 --- a/apps/meteor/.docker/Dockerfile.rhel +++ b/apps/meteor/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 6.4.0-rc.0 +ENV RC_VERSION 6.4.0-rc.1 MAINTAINER buildmaster@rocket.chat diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index 5f5a8ba0ab00..f2d50f90c7da 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,29 @@ # @rocket.chat/meteor +## 6.4.0-rc.1 + +### Patch Changes + +- Bump @rocket.chat/meteor version. + - @rocket.chat/core-typings@6.4.0-rc.1 + - @rocket.chat/rest-typings@6.4.0-rc.1 + - @rocket.chat/api-client@0.1.5-rc.1 + - @rocket.chat/omnichannel-services@0.0.11-rc.1 + - @rocket.chat/pdf-worker@0.0.11-rc.1 + - @rocket.chat/presence@0.0.11-rc.1 + - @rocket.chat/core-services@0.2.0-rc.1 + - @rocket.chat/cron@0.0.7-rc.1 + - @rocket.chat/gazzodown@2.0.0-rc.1 + - @rocket.chat/model-typings@0.1.0-rc.1 + - @rocket.chat/ui-contexts@2.0.0-rc.1 + - @rocket.chat/fuselage-ui-kit@2.0.0-rc.1 + - @rocket.chat/models@0.0.11-rc.1 + - @rocket.chat/ui-theming@0.1.0-rc.0 + - @rocket.chat/ui-client@2.0.0-rc.1 + - @rocket.chat/ui-video-conf@2.0.0-rc.1 + - @rocket.chat/web-ui-registration@2.0.0-rc.1 + - @rocket.chat/instance-status@0.0.11-rc.1 + ## 6.4.0-rc.0 ### Minor Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index 4f19f3927185..660bed4d191b 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.4.0-rc.0" + "version": "6.4.0-rc.1" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index 2d6687144bba..2789731d04f1 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,15 @@ # rocketchat-services +## 1.1.5-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/rest-typings@6.4.0-rc.1 +- @rocket.chat/core-services@0.2.0-rc.1 +- @rocket.chat/model-typings@0.1.0-rc.1 +- @rocket.chat/models@0.0.11-rc.1 + ## 1.1.5-rc.0 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index c1fc40a4ae02..3c8bfb1cdc8c 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.5-rc.0", + "version": "1.1.5-rc.1", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index b8f734fb191a..568e96beff0d 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.4.0-rc.0", + "version": "6.4.0-rc.1", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index 5907054a9a8b..544fffee9b05 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/account-service +## 0.2.5-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/rest-typings@6.4.0-rc.1 +- @rocket.chat/core-services@0.2.0-rc.1 +- @rocket.chat/model-typings@0.1.0-rc.1 +- @rocket.chat/models@0.0.11-rc.1 + ## 0.2.5-rc.0 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index 059ef76c1066..689a5e1bb7cf 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.2.5-rc.0", + "version": "0.2.5-rc.1", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index 7f26f70250d6..f33180f55f15 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/authorization-service +## 0.2.5-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/rest-typings@6.4.0-rc.1 +- @rocket.chat/core-services@0.2.0-rc.1 +- @rocket.chat/model-typings@0.1.0-rc.1 +- @rocket.chat/models@0.0.11-rc.1 + ## 0.2.5-rc.0 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index eb832c48e455..76aab841e82a 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.2.5-rc.0", + "version": "0.2.5-rc.1", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index a4a45e8b5c50..f94faa46a76a 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/ddp-streamer +## 0.1.5-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/rest-typings@6.4.0-rc.1 +- @rocket.chat/core-services@0.2.0-rc.1 +- @rocket.chat/model-typings@0.1.0-rc.1 +- @rocket.chat/ui-contexts@2.0.0-rc.1 +- @rocket.chat/models@0.0.11-rc.1 +- @rocket.chat/instance-status@0.0.11-rc.1 + ## 0.1.5-rc.0 ### Patch Changes diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 85424ade0529..b6b4f23109e1 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.1.5-rc.0", + "version": "0.1.5-rc.1", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index c2365ba36730..22e8f02d25a6 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-transcript +## 0.2.5-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/omnichannel-services@0.0.11-rc.1 +- @rocket.chat/pdf-worker@0.0.11-rc.1 +- @rocket.chat/core-services@0.2.0-rc.1 +- @rocket.chat/model-typings@0.1.0-rc.1 +- @rocket.chat/models@0.0.11-rc.1 + ## 0.2.5-rc.0 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index 217b9898d180..30bcbeec74d4 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.2.5-rc.0", + "version": "0.2.5-rc.1", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index 3706e35e6792..fc1429886c66 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/presence-service +## 0.2.5-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/presence@0.0.11-rc.1 +- @rocket.chat/core-services@0.2.0-rc.1 +- @rocket.chat/model-typings@0.1.0-rc.1 +- @rocket.chat/models@0.0.11-rc.1 + ## 0.2.5-rc.0 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index 1d461ba668a0..15db25ea9e15 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.2.5-rc.0", + "version": "0.2.5-rc.1", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index 3c7203fed5a3..7d5f29ad24a7 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/queue-worker +## 0.2.5-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/omnichannel-services@0.0.11-rc.1 +- @rocket.chat/core-services@0.2.0-rc.1 +- @rocket.chat/model-typings@0.1.0-rc.1 +- @rocket.chat/models@0.0.11-rc.1 + ## 0.2.5-rc.0 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index 64c87a9124bc..4ef2db926961 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.2.5-rc.0", + "version": "0.2.5-rc.1", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index c62c7b6fe349..83becb8f7ac2 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/stream-hub-service +## 0.2.5-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/core-services@0.2.0-rc.1 +- @rocket.chat/model-typings@0.1.0-rc.1 +- @rocket.chat/models@0.0.11-rc.1 + ## 0.2.5-rc.0 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index 2052b598fd51..d601e1e23b3b 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.2.5-rc.0", + "version": "0.2.5-rc.1", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index 78995509f213..77b96078d0da 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/api-client +## 0.1.5-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/rest-typings@6.4.0-rc.1 + ## 0.1.5-rc.0 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index c9ff1ca756f8..03b012d720e6 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/api-client", - "version": "0.1.5-rc.0", + "version": "0.1.5-rc.1", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index e27581f37632..5fa1bc86a677 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/ddp-client +## 0.2.0-rc.1 + +### Patch Changes + +- @rocket.chat/rest-typings@6.4.0-rc.1 +- @rocket.chat/api-client@0.1.5-rc.1 + ## 0.2.0-rc.0 ### Minor Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index e49f74c5003f..fe74871830c1 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ddp-client", - "version": "0.2.0-rc.0", + "version": "0.2.0-rc.1", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index 89a52e900f64..080206c83a0f 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-services +## 0.0.11-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/rest-typings@6.4.0-rc.1 +- @rocket.chat/pdf-worker@0.0.11-rc.1 +- @rocket.chat/core-services@0.2.0-rc.1 +- @rocket.chat/model-typings@0.1.0-rc.1 +- @rocket.chat/models@0.0.11-rc.1 + ## 0.0.11-rc.0 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 05c9e80cfa4d..4759e8423b7f 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.0.11-rc.0", + "version": "0.0.11-rc.1", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index d79f1ecad4d8..e438e4713796 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/pdf-worker +## 0.0.11-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 + ## 0.0.11-rc.0 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index 77c3e702fe27..ee97717a72c1 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.11-rc.0", + "version": "0.0.11-rc.1", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index b029ffc5ccb5..a50d5bdeaef9 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/presence +## 0.0.11-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/core-services@0.2.0-rc.1 +- @rocket.chat/models@0.0.11-rc.1 + ## 0.0.11-rc.0 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index e607edbca0c4..f6b555a60d99 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.0.11-rc.0", + "version": "0.0.11-rc.1", "private": true, "devDependencies": { "@babel/core": "~7.22.9", diff --git a/package.json b/package.json index f1cdae960726..978e0634a0ae 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.4.0-rc.0", + "version": "6.4.0-rc.1", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index 4dd13f0e9231..fed560627994 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/core-services +## 0.2.0-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/rest-typings@6.4.0-rc.1 +- @rocket.chat/models@0.0.11-rc.1 + ## 0.2.0-rc.0 ### Minor Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 238ecf7f8efb..c5185a20d394 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.2.0-rc.0", + "version": "0.2.0-rc.1", "private": true, "devDependencies": { "@babel/core": "~7.22.9", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index e3746fc996e0..20ddc9082a41 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,7 @@ # @rocket.chat/core-typings +## 6.4.0-rc.1 + ## 6.4.0-rc.0 ### Minor Changes diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index ba92b31a7cd8..5512e8fb5df4 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-typings", - "version": "6.4.0-rc.0", + "version": "6.4.0-rc.1", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index 37570bdeeb5d..a1d91cc2d52a 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/cron +## 0.0.7-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/models@0.0.11-rc.1 + ## 0.0.7-rc.0 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index 12e16e759d15..312e5bdbb599 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.7-rc.0", + "version": "0.0.7-rc.1", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index 6a73eb77ac60..d646b2eb3712 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 2.0.0-rc.1 + +### Patch Changes + +- @rocket.chat/gazzodown@2.0.0-rc.1 +- @rocket.chat/ui-contexts@2.0.0-rc.1 +- @rocket.chat/ui-video-conf@2.0.0-rc.1 + ## 2.0.0-rc.0 ### Minor Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 979726fd5087..cb28e0699874 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "2.0.0-rc.0", + "version": "2.0.0-rc.1", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -46,9 +46,9 @@ "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.0", + "@rocket.chat/ui-contexts": "2.0.0-rc.1", "@rocket.chat/ui-kit": "*", - "@rocket.chat/ui-video-conf": "2.0.0-rc.0", + "@rocket.chat/ui-video-conf": "2.0.0-rc.1", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index 3e38986be6bd..8b8096b99251 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/gazzodown +## 2.0.0-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/ui-contexts@2.0.0-rc.1 +- @rocket.chat/ui-client@2.0.0-rc.1 + ## 2.0.0-rc.0 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index 4a654b4b6051..6f0d63803d66 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "2.0.0-rc.0", + "version": "2.0.0-rc.1", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.4.0-rc.0", + "@rocket.chat/core-typings": "6.4.0-rc.1", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "2.0.0-rc.0", - "@rocket.chat/ui-contexts": "2.0.0-rc.0", + "@rocket.chat/ui-client": "2.0.0-rc.1", + "@rocket.chat/ui-contexts": "2.0.0-rc.1", "katex": "*", "react": "*" }, diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index 5c3093e07a29..399307d7f772 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/instance-status +## 0.0.11-rc.1 + +### Patch Changes + +- @rocket.chat/models@0.0.11-rc.1 + ## 0.0.11-rc.0 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 8e0b758e4436..d446a42b7e79 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.11-rc.0", + "version": "0.0.11-rc.1", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/livechat/CHANGELOG.md b/packages/livechat/CHANGELOG.md index 02f804e0949e..08ebfcb6dc18 100644 --- a/packages/livechat/CHANGELOG.md +++ b/packages/livechat/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/livechat Change Log +## 1.14.0-rc.1 + +### Patch Changes + +- @rocket.chat/gazzodown@2.0.0-rc.1 + ## 1.14.0-rc.0 ### Minor Changes diff --git a/packages/livechat/package.json b/packages/livechat/package.json index ce9df8755849..b2ebd22a89f2 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/livechat", - "version": "1.14.0-rc.0", + "version": "1.14.0-rc.1", "files": [ "/build" ], diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index 69d9005974d3..498fc2cef4a3 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/model-typings +## 0.1.0-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 + ## 0.1.0-rc.0 ### Minor Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index 0618912a2f51..f9cbc45b910c 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.1.0-rc.0", + "version": "0.1.0-rc.1", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index 16d8372b6b6a..d1523c91b283 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/models +## 0.0.11-rc.1 + +### Patch Changes + +- @rocket.chat/model-typings@0.1.0-rc.1 + ## 0.0.11-rc.0 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index 9823117a92eb..dffa357f0768 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.11-rc.0", + "version": "0.0.11-rc.1", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index 228209db8b62..5150a5160262 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/rest-typings +## 6.4.0-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 + ## 6.4.0-rc.0 ### Minor Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 34dcc90e2076..26b7de5653d3 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/rest-typings", - "version": "6.4.0-rc.0", + "version": "6.4.0-rc.1", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.3", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index 727e050db4c8..e7b3d0de00e7 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-client +## 2.0.0-rc.1 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.1 + ## 2.0.0-rc.0 ### Minor Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 2d9e156dcb8c..4bfa46253f8e 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "2.0.0-rc.0", + "version": "2.0.0-rc.1", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -61,7 +61,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.0", + "@rocket.chat/ui-contexts": "2.0.0-rc.1", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index fb04c87aefbd..91761e8c8c76 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/ui-contexts +## 2.0.0-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/rest-typings@6.4.0-rc.1 +- @rocket.chat/ddp-client@0.2.0-rc.1 + ## 2.0.0-rc.0 ### Minor Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 5c0ae099f718..49c9fc82227a 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "2.0.0-rc.0", + "version": "2.0.0-rc.1", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index 04a9823f8153..9b6c98073ed4 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-video-conf +## 2.0.0-rc.1 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.1 + ## 2.0.0-rc.0 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index 3c89b5dfeade..5c01a6db8f21 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "2.0.0-rc.0", + "version": "2.0.0-rc.1", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.0", + "@rocket.chat/ui-contexts": "2.0.0-rc.1", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index fbffbd624c36..b84a4b9f22bf 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/uikit-playground +## 0.2.0-rc.1 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.1 +- @rocket.chat/fuselage-ui-kit@2.0.0-rc.1 + ## 0.2.0-rc.0 ### Minor Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index f31b9fcf1ddb..1e3998359a66 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.2.0-rc.0", + "version": "0.2.0-rc.1", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index 0399b9558155..fd436f651254 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/web-ui-registration +## 2.0.0-rc.1 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.1 + ## 2.0.0-rc.0 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index 502ed3b402d6..2f31e571ca8c 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "2.0.0-rc.0", + "version": "2.0.0-rc.1", "private": true, "homepage": "https://rocket.chat", "main": "./dist/index.js", @@ -49,7 +49,7 @@ }, "peerDependencies": { "@rocket.chat/layout": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.0", + "@rocket.chat/ui-contexts": "2.0.0-rc.1", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", From f1e36a5e4698300e2ac79dc92fad97bb17f35f33 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Fri, 15 Sep 2023 18:38:57 +0000 Subject: [PATCH 144/275] Bump 6.3.7 --- .changeset/bump-patch-1694803137282.md | 5 +++++ yarn.lock | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/bump-patch-1694803137282.md diff --git a/.changeset/bump-patch-1694803137282.md b/.changeset/bump-patch-1694803137282.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1694803137282.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/yarn.lock b/yarn.lock index f74e6ebcd635..bf0ee10b6019 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9898,9 +9898,9 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.5 + "@rocket.chat/ui-contexts": 1.0.6 "@rocket.chat/ui-kit": "*" - "@rocket.chat/ui-video-conf": 1.0.5 + "@rocket.chat/ui-video-conf": 1.0.6 "@tanstack/react-query": "*" react: "*" react-dom: "*" @@ -9982,14 +9982,14 @@ __metadata: ts-jest: ~29.0.5 typescript: ~5.1.3 peerDependencies: - "@rocket.chat/core-typings": 6.3.5 + "@rocket.chat/core-typings": 6.3.6 "@rocket.chat/css-in-js": "*" "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-tokens": "*" "@rocket.chat/message-parser": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-client": 1.0.5 - "@rocket.chat/ui-contexts": 1.0.5 + "@rocket.chat/ui-client": 1.0.6 + "@rocket.chat/ui-contexts": 1.0.6 katex: "*" react: "*" languageName: unknown @@ -11048,7 +11048,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 1.0.5 + "@rocket.chat/ui-contexts": 1.0.6 react: ~17.0.2 languageName: unknown linkType: soft @@ -11202,7 +11202,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.5 + "@rocket.chat/ui-contexts": 1.0.6 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -11268,7 +11268,7 @@ __metadata: typescript: ~5.1.3 peerDependencies: "@rocket.chat/layout": "*" - "@rocket.chat/ui-contexts": 1.0.5 + "@rocket.chat/ui-contexts": 1.0.6 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From c7206553d2ba6609d60d73687f79ed80c5d2f4ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrique=20Guimar=C3=A3es=20Ribeiro?= Date: Fri, 15 Sep 2023 16:02:14 -0300 Subject: [PATCH 145/275] refactor: Implement functional code for the 'useFilteredApps' hook (#30279) Co-authored-by: Tiago Evangelista Pinto <17487063+tiagoevanp@users.noreply.github.com> --- .../marketplace/AppsPage/AppsPageContent.tsx | 24 +++- .../marketplace/hooks/useFilteredApps.ts | 114 ++++++++---------- 2 files changed, 71 insertions(+), 67 deletions(-) diff --git a/apps/meteor/client/views/marketplace/AppsPage/AppsPageContent.tsx b/apps/meteor/client/views/marketplace/AppsPage/AppsPageContent.tsx index 40d90b56e046..5b47634bff29 100644 --- a/apps/meteor/client/views/marketplace/AppsPage/AppsPageContent.tsx +++ b/apps/meteor/client/views/marketplace/AppsPage/AppsPageContent.tsx @@ -100,6 +100,24 @@ const AppsPageContent = (): ReactElement => { } }, [context, marketplaceApps, installedApps, privateApps]); + const findSort = () => { + const possibleSort = sortFilterStructure.items.find(({ checked }) => checked); + + return possibleSort ? possibleSort.id : 'mru'; + }; + + const findPurchaseType = () => { + const possiblePurchaseType = freePaidFilterStructure.items.find(({ checked }) => checked); + + return possiblePurchaseType ? possiblePurchaseType.id : 'all'; + }; + + const findStatus = () => { + const possibleStatus = statusFilterStructure.items.find(({ checked }) => checked); + + return possibleStatus ? possibleStatus.id : 'all'; + }; + const [categories, selectedCategories, categoryTagList, onSelected] = useCategories(); const appsResult = useFilteredApps({ appsData: getAppsData(), @@ -107,9 +125,9 @@ const AppsPageContent = (): ReactElement => { current, itemsPerPage, categories: useMemo(() => selectedCategories.map(({ label }) => label), [selectedCategories]), - purchaseType: useMemo(() => freePaidFilterStructure.items.find(({ checked }) => checked)?.id, [freePaidFilterStructure]), - sortingMethod: useMemo(() => sortFilterStructure.items.find(({ checked }) => checked)?.id, [sortFilterStructure]), - status: useMemo(() => statusFilterStructure.items.find(({ checked }) => checked)?.id, [statusFilterStructure]), + purchaseType: useMemo(findPurchaseType, [freePaidFilterStructure]), + sortingMethod: useMemo(findSort, [sortFilterStructure]), + status: useMemo(findStatus, [statusFilterStructure]), context, }); diff --git a/apps/meteor/client/views/marketplace/hooks/useFilteredApps.ts b/apps/meteor/client/views/marketplace/hooks/useFilteredApps.ts index 19664cd4b693..1027aae75a8a 100644 --- a/apps/meteor/client/views/marketplace/hooks/useFilteredApps.ts +++ b/apps/meteor/client/views/marketplace/hooks/useFilteredApps.ts @@ -33,11 +33,11 @@ export const useFilteredApps = ({ text: string; current: number; itemsPerPage: number; - categories?: string[]; - purchaseType?: string; + categories: string[]; + purchaseType: string; isEnterpriseOnly?: boolean; - sortingMethod?: string; - status?: string; + sortingMethod: string; + status: string; context?: string; }): AsyncState< { items: App[] } & { shouldShowSearchText: boolean } & PaginatedResult & { allApps: App[] } & { totalAppsLength: number } @@ -48,72 +48,58 @@ export const useFilteredApps = ({ } const { apps } = appsData.value; - - let filtered: App[] = apps; - let shouldShowSearchText = true; - - const sortingMethods: Record App[]> = { - urf: () => - filtered.sort( - (firstApp, secondApp) => (secondApp?.appRequestStats?.totalUnseen || 0) - (firstApp?.appRequestStats?.totalUnseen || 0), - ), - url: () => - filtered.sort( - (firstApp, secondApp) => (firstApp?.appRequestStats?.totalUnseen || 0) - (secondApp?.appRequestStats?.totalUnseen || 0), - ), - az: () => filtered.sort((firstApp, secondApp) => sortAppsByAlphabeticalOrInverseOrder(firstApp.name, secondApp.name)), - za: () => filtered.sort((firstApp, secondApp) => sortAppsByAlphabeticalOrInverseOrder(secondApp.name, firstApp.name)), - mru: () => - filtered.sort((firstApp, secondApp) => sortAppsByClosestOrFarthestModificationDate(firstApp.modifiedAt, secondApp.modifiedAt)), - lru: () => - filtered.sort((firstApp, secondApp) => sortAppsByClosestOrFarthestModificationDate(secondApp.modifiedAt, firstApp.modifiedAt)), + const fallback = (apps: App[]) => apps; + + const sortingMethods: Record App[]> = { + urf: (apps: App[]) => + apps.sort((firstApp, secondApp) => (secondApp?.appRequestStats?.totalUnseen || 0) - (firstApp?.appRequestStats?.totalUnseen || 0)), + url: (apps: App[]) => + apps.sort((firstApp, secondApp) => (firstApp?.appRequestStats?.totalUnseen || 0) - (secondApp?.appRequestStats?.totalUnseen || 0)), + az: (apps: App[]) => apps.sort((firstApp, secondApp) => sortAppsByAlphabeticalOrInverseOrder(firstApp.name, secondApp.name)), + za: (apps: App[]) => apps.sort((firstApp, secondApp) => sortAppsByAlphabeticalOrInverseOrder(secondApp.name, firstApp.name)), + mru: (apps: App[]) => + apps.sort((firstApp, secondApp) => sortAppsByClosestOrFarthestModificationDate(firstApp.modifiedAt, secondApp.modifiedAt)), + lru: (apps: App[]) => + apps.sort((firstApp, secondApp) => sortAppsByClosestOrFarthestModificationDate(secondApp.modifiedAt, firstApp.modifiedAt)), }; - if (context && context === 'enterprise') { - filtered = apps.filter(({ categories }) => categories.includes('Enterprise')); - } - - if (sortingMethod) { - filtered = sortingMethods[sortingMethod](); - } - - const filterByPurchaseType: Record App[]> = { - paid: () => filtered.filter(filterAppsByPaid), - enterprise: () => filtered.filter(filterAppsByEnterprise), - free: () => filtered.filter(filterAppsByFree), + const filterByPurchaseType: Record App[]> = { + all: fallback, + paid: (apps: App[]) => apps.filter(filterAppsByPaid), + enterprise: (apps: App[]) => apps.filter(filterAppsByEnterprise), + free: (apps: App[]) => apps.filter(filterAppsByFree), }; - if (purchaseType && purchaseType !== 'all') { - filtered = filterByPurchaseType[purchaseType](); - - if (!filtered.length) shouldShowSearchText = false; - } - - if (status && status !== 'all') { - filtered = status === 'enabled' ? filtered.filter(filterAppsByEnabled) : filtered.filter(filterAppsByDisabled); - - if (!filtered.length) shouldShowSearchText = false; - } - - if (Boolean(categories.length) && Boolean(text)) { - filtered = filtered.filter((app) => filterAppsByCategories(app, categories)).filter(({ name }) => filterAppsByText(name, text)); - shouldShowSearchText = true; - } - - if (Boolean(categories.length) && !text) { - filtered = filtered.filter((app) => filterAppsByCategories(app, categories)); - shouldShowSearchText = false; - } - - if (!categories.length && Boolean(text)) { - filtered = filtered.filter(({ name }) => filterAppsByText(name, text)); - shouldShowSearchText = true; - } + const filterByStatus: Record App[]> = { + all: fallback, + enabled: (apps: App[]) => apps.filter(filterAppsByEnabled), + disabled: (apps: App[]) => apps.filter(filterAppsByDisabled), + }; - if (context && context === 'requested') { - filtered = apps.filter(({ appRequestStats, installed }) => Boolean(appRequestStats) && !installed); - } + const filterByContext: Record App[]> = { + explore: fallback, + installed: fallback, + private: fallback, + enterprise: (apps: App[]) => apps.filter(({ categories }) => categories.includes('Enterprise')), + requested: (apps: App[]) => apps.filter(({ appRequestStats, installed }) => Boolean(appRequestStats) && !installed), + }; + type appsFilterFunction = (apps: App[]) => App[]; + const pipeAppsFilter = + (...functions: appsFilterFunction[]) => + (initialValue: App[]) => + functions.reduce((currentAppsList, currentFilterFunction) => currentFilterFunction(currentAppsList), initialValue); + + const filtered = pipeAppsFilter( + context ? filterByContext[context] : fallback, + filterByPurchaseType[purchaseType], + filterByStatus[status], + categories.length ? (apps: App[]) => apps.filter((app) => filterAppsByCategories(app, categories)) : fallback, + text ? (apps: App[]) => apps.filter(({ name }) => filterAppsByText(name, text)) : fallback, + sortingMethods[sortingMethod], + )(apps); + + const shouldShowSearchText = !!text; const total = filtered.length; const offset = current > total ? 0 : current; const end = current + itemsPerPage; From e1acdda0a3ed2541f5c8c12fe2b87ffdfce6cfe2 Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Fri, 25 Aug 2023 00:32:03 -0300 Subject: [PATCH 146/275] fix: User information crashing for some locales (#30167) --- .changeset/heavy-baboons-laugh.md | 5 + apps/meteor/client/hooks/useTimeAgo.ts | 11 +- apps/meteor/private/moment-locales | 1 + apps/meteor/private/moment-locales/af.js | 73 ------- apps/meteor/private/moment-locales/ar-ma.js | 60 ------ apps/meteor/private/moment-locales/ar-sa.js | 104 ---------- apps/meteor/private/moment-locales/ar-tn.js | 58 ------ apps/meteor/private/moment-locales/ar.js | 137 ------------- apps/meteor/private/moment-locales/az.js | 105 ---------- apps/meteor/private/moment-locales/be.js | 134 ------------- apps/meteor/private/moment-locales/bg.js | 90 --------- apps/meteor/private/moment-locales/bn.js | 119 ------------ apps/meteor/private/moment-locales/bo.js | 119 ------------ apps/meteor/private/moment-locales/br.js | 108 ----------- apps/meteor/private/moment-locales/bs.js | 143 -------------- apps/meteor/private/moment-locales/ca.js | 81 -------- apps/meteor/private/moment-locales/cs.js | 172 ---------------- apps/meteor/private/moment-locales/cv.js | 63 ------ apps/meteor/private/moment-locales/cy.js | 80 -------- apps/meteor/private/moment-locales/da.js | 60 ------ apps/meteor/private/moment-locales/de-at.js | 79 -------- apps/meteor/private/moment-locales/de.js | 78 -------- apps/meteor/private/moment-locales/dv.js | 99 ---------- apps/meteor/private/moment-locales/el.js | 98 ---------- apps/meteor/private/moment-locales/en-au.js | 66 ------- apps/meteor/private/moment-locales/en-ca.js | 63 ------ apps/meteor/private/moment-locales/en-gb.js | 67 ------- apps/meteor/private/moment-locales/en-ie.js | 67 ------- apps/meteor/private/moment-locales/en-nz.js | 66 ------- apps/meteor/private/moment-locales/eo.js | 73 ------- apps/meteor/private/moment-locales/es-do.js | 80 -------- apps/meteor/private/moment-locales/es.js | 81 -------- apps/meteor/private/moment-locales/et.js | 80 -------- apps/meteor/private/moment-locales/eu.js | 66 ------- apps/meteor/private/moment-locales/fa.js | 106 ---------- apps/meteor/private/moment-locales/fi.js | 107 ---------- apps/meteor/private/moment-locales/fo.js | 60 ------ apps/meteor/private/moment-locales/fr-ca.js | 60 ------ apps/meteor/private/moment-locales/fr-ch.js | 64 ------ apps/meteor/private/moment-locales/fr.js | 64 ------ apps/meteor/private/moment-locales/fy.js | 73 ------- apps/meteor/private/moment-locales/gd.js | 76 -------- apps/meteor/private/moment-locales/gl.js | 77 -------- apps/meteor/private/moment-locales/he.js | 99 ---------- apps/meteor/private/moment-locales/hi.js | 124 ------------ apps/meteor/private/moment-locales/hr.js | 145 -------------- apps/meteor/private/moment-locales/hu.js | 108 ----------- apps/meteor/private/moment-locales/hy-am.js | 95 --------- apps/meteor/private/moment-locales/id.js | 83 -------- apps/meteor/private/moment-locales/is.js | 127 ------------ apps/meteor/private/moment-locales/it.js | 70 ------- apps/meteor/private/moment-locales/ja.js | 76 -------- apps/meteor/private/moment-locales/jv.js | 83 -------- apps/meteor/private/moment-locales/ka.js | 89 --------- apps/meteor/private/moment-locales/kk.js | 87 --------- apps/meteor/private/moment-locales/km.js | 58 ------ apps/meteor/private/moment-locales/ko.js | 68 ------- apps/meteor/private/moment-locales/ky.js | 88 --------- apps/meteor/private/moment-locales/lb.js | 136 ------------- apps/meteor/private/moment-locales/lo.js | 70 ------- apps/meteor/private/moment-locales/lt.js | 117 ----------- apps/meteor/private/moment-locales/lv.js | 97 ---------- apps/meteor/private/moment-locales/me.js | 111 ----------- apps/meteor/private/moment-locales/mk.js | 90 --------- apps/meteor/private/moment-locales/ml.js | 81 -------- apps/meteor/private/moment-locales/mr.js | 159 --------------- apps/meteor/private/moment-locales/ms-my.js | 83 -------- apps/meteor/private/moment-locales/ms.js | 82 -------- apps/meteor/private/moment-locales/my.js | 93 --------- apps/meteor/private/moment-locales/nb.js | 63 ------ apps/meteor/private/moment-locales/ne.js | 123 ------------ apps/meteor/private/moment-locales/nl.js | 73 ------- apps/meteor/private/moment-locales/nn.js | 60 ------ apps/meteor/private/moment-locales/pa-in.js | 124 ------------ apps/meteor/private/moment-locales/pl.js | 105 ---------- apps/meteor/private/moment-locales/pt-br.js | 61 ------ apps/meteor/private/moment-locales/pt.js | 65 ------- apps/meteor/private/moment-locales/ro.js | 75 ------- apps/meteor/private/moment-locales/ru.js | 183 ------------------ apps/meteor/private/moment-locales/se.js | 61 ------ apps/meteor/private/moment-locales/si.js | 71 ------- apps/meteor/private/moment-locales/sk.js | 150 -------------- apps/meteor/private/moment-locales/sl.js | 162 ---------------- apps/meteor/private/moment-locales/sq.js | 70 ------- apps/meteor/private/moment-locales/sr-cyrl.js | 110 ----------- apps/meteor/private/moment-locales/sr.js | 110 ----------- apps/meteor/private/moment-locales/ss.js | 89 --------- apps/meteor/private/moment-locales/sv.js | 69 ------- apps/meteor/private/moment-locales/sw.js | 59 ------ apps/meteor/private/moment-locales/ta.js | 129 ------------ apps/meteor/private/moment-locales/te.js | 89 --------- apps/meteor/private/moment-locales/th.js | 67 ------- apps/meteor/private/moment-locales/tl-ph.js | 62 ------ apps/meteor/private/moment-locales/tlh.js | 120 ------------ apps/meteor/private/moment-locales/tr.js | 90 --------- apps/meteor/private/moment-locales/tzl.js | 91 --------- .../meteor/private/moment-locales/tzm-latn.js | 58 ------ apps/meteor/private/moment-locales/tzm.js | 58 ------ apps/meteor/private/moment-locales/uk.js | 146 -------------- apps/meteor/private/moment-locales/uz.js | 58 ------ apps/meteor/private/moment-locales/vi.js | 79 -------- .../meteor/private/moment-locales/x-pseudo.js | 68 ------- apps/meteor/private/moment-locales/zh-cn.js | 127 ------------ apps/meteor/private/moment-locales/zh-tw.js | 104 ---------- apps/meteor/private/moment-locales/zh.js | 127 ------------ 105 files changed, 12 insertions(+), 9336 deletions(-) create mode 100644 .changeset/heavy-baboons-laugh.md create mode 120000 apps/meteor/private/moment-locales delete mode 100644 apps/meteor/private/moment-locales/af.js delete mode 100644 apps/meteor/private/moment-locales/ar-ma.js delete mode 100644 apps/meteor/private/moment-locales/ar-sa.js delete mode 100644 apps/meteor/private/moment-locales/ar-tn.js delete mode 100644 apps/meteor/private/moment-locales/ar.js delete mode 100644 apps/meteor/private/moment-locales/az.js delete mode 100644 apps/meteor/private/moment-locales/be.js delete mode 100644 apps/meteor/private/moment-locales/bg.js delete mode 100644 apps/meteor/private/moment-locales/bn.js delete mode 100644 apps/meteor/private/moment-locales/bo.js delete mode 100644 apps/meteor/private/moment-locales/br.js delete mode 100644 apps/meteor/private/moment-locales/bs.js delete mode 100644 apps/meteor/private/moment-locales/ca.js delete mode 100644 apps/meteor/private/moment-locales/cs.js delete mode 100644 apps/meteor/private/moment-locales/cv.js delete mode 100644 apps/meteor/private/moment-locales/cy.js delete mode 100644 apps/meteor/private/moment-locales/da.js delete mode 100644 apps/meteor/private/moment-locales/de-at.js delete mode 100644 apps/meteor/private/moment-locales/de.js delete mode 100644 apps/meteor/private/moment-locales/dv.js delete mode 100644 apps/meteor/private/moment-locales/el.js delete mode 100644 apps/meteor/private/moment-locales/en-au.js delete mode 100644 apps/meteor/private/moment-locales/en-ca.js delete mode 100644 apps/meteor/private/moment-locales/en-gb.js delete mode 100644 apps/meteor/private/moment-locales/en-ie.js delete mode 100644 apps/meteor/private/moment-locales/en-nz.js delete mode 100644 apps/meteor/private/moment-locales/eo.js delete mode 100644 apps/meteor/private/moment-locales/es-do.js delete mode 100644 apps/meteor/private/moment-locales/es.js delete mode 100644 apps/meteor/private/moment-locales/et.js delete mode 100644 apps/meteor/private/moment-locales/eu.js delete mode 100644 apps/meteor/private/moment-locales/fa.js delete mode 100644 apps/meteor/private/moment-locales/fi.js delete mode 100644 apps/meteor/private/moment-locales/fo.js delete mode 100644 apps/meteor/private/moment-locales/fr-ca.js delete mode 100644 apps/meteor/private/moment-locales/fr-ch.js delete mode 100644 apps/meteor/private/moment-locales/fr.js delete mode 100644 apps/meteor/private/moment-locales/fy.js delete mode 100644 apps/meteor/private/moment-locales/gd.js delete mode 100644 apps/meteor/private/moment-locales/gl.js delete mode 100644 apps/meteor/private/moment-locales/he.js delete mode 100644 apps/meteor/private/moment-locales/hi.js delete mode 100644 apps/meteor/private/moment-locales/hr.js delete mode 100644 apps/meteor/private/moment-locales/hu.js delete mode 100644 apps/meteor/private/moment-locales/hy-am.js delete mode 100644 apps/meteor/private/moment-locales/id.js delete mode 100644 apps/meteor/private/moment-locales/is.js delete mode 100644 apps/meteor/private/moment-locales/it.js delete mode 100644 apps/meteor/private/moment-locales/ja.js delete mode 100644 apps/meteor/private/moment-locales/jv.js delete mode 100644 apps/meteor/private/moment-locales/ka.js delete mode 100644 apps/meteor/private/moment-locales/kk.js delete mode 100644 apps/meteor/private/moment-locales/km.js delete mode 100644 apps/meteor/private/moment-locales/ko.js delete mode 100644 apps/meteor/private/moment-locales/ky.js delete mode 100644 apps/meteor/private/moment-locales/lb.js delete mode 100644 apps/meteor/private/moment-locales/lo.js delete mode 100644 apps/meteor/private/moment-locales/lt.js delete mode 100644 apps/meteor/private/moment-locales/lv.js delete mode 100644 apps/meteor/private/moment-locales/me.js delete mode 100644 apps/meteor/private/moment-locales/mk.js delete mode 100644 apps/meteor/private/moment-locales/ml.js delete mode 100644 apps/meteor/private/moment-locales/mr.js delete mode 100644 apps/meteor/private/moment-locales/ms-my.js delete mode 100644 apps/meteor/private/moment-locales/ms.js delete mode 100644 apps/meteor/private/moment-locales/my.js delete mode 100644 apps/meteor/private/moment-locales/nb.js delete mode 100644 apps/meteor/private/moment-locales/ne.js delete mode 100644 apps/meteor/private/moment-locales/nl.js delete mode 100644 apps/meteor/private/moment-locales/nn.js delete mode 100644 apps/meteor/private/moment-locales/pa-in.js delete mode 100644 apps/meteor/private/moment-locales/pl.js delete mode 100644 apps/meteor/private/moment-locales/pt-br.js delete mode 100644 apps/meteor/private/moment-locales/pt.js delete mode 100644 apps/meteor/private/moment-locales/ro.js delete mode 100644 apps/meteor/private/moment-locales/ru.js delete mode 100644 apps/meteor/private/moment-locales/se.js delete mode 100644 apps/meteor/private/moment-locales/si.js delete mode 100644 apps/meteor/private/moment-locales/sk.js delete mode 100644 apps/meteor/private/moment-locales/sl.js delete mode 100644 apps/meteor/private/moment-locales/sq.js delete mode 100644 apps/meteor/private/moment-locales/sr-cyrl.js delete mode 100644 apps/meteor/private/moment-locales/sr.js delete mode 100644 apps/meteor/private/moment-locales/ss.js delete mode 100644 apps/meteor/private/moment-locales/sv.js delete mode 100644 apps/meteor/private/moment-locales/sw.js delete mode 100644 apps/meteor/private/moment-locales/ta.js delete mode 100644 apps/meteor/private/moment-locales/te.js delete mode 100644 apps/meteor/private/moment-locales/th.js delete mode 100644 apps/meteor/private/moment-locales/tl-ph.js delete mode 100644 apps/meteor/private/moment-locales/tlh.js delete mode 100644 apps/meteor/private/moment-locales/tr.js delete mode 100644 apps/meteor/private/moment-locales/tzl.js delete mode 100644 apps/meteor/private/moment-locales/tzm-latn.js delete mode 100644 apps/meteor/private/moment-locales/tzm.js delete mode 100644 apps/meteor/private/moment-locales/uk.js delete mode 100644 apps/meteor/private/moment-locales/uz.js delete mode 100644 apps/meteor/private/moment-locales/vi.js delete mode 100644 apps/meteor/private/moment-locales/x-pseudo.js delete mode 100644 apps/meteor/private/moment-locales/zh-cn.js delete mode 100644 apps/meteor/private/moment-locales/zh-tw.js delete mode 100644 apps/meteor/private/moment-locales/zh.js diff --git a/.changeset/heavy-baboons-laugh.md b/.changeset/heavy-baboons-laugh.md new file mode 100644 index 000000000000..5c32965dcf62 --- /dev/null +++ b/.changeset/heavy-baboons-laugh.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +User information crashing for some locales diff --git a/apps/meteor/client/hooks/useTimeAgo.ts b/apps/meteor/client/hooks/useTimeAgo.ts index 81c5f732d042..2b661ae89cf3 100644 --- a/apps/meteor/client/hooks/useTimeAgo.ts +++ b/apps/meteor/client/hooks/useTimeAgo.ts @@ -8,16 +8,17 @@ const dayFormat = ['h:mm A', 'H:mm'] as const; export const useTimeAgo = (): ((time: Date | number | string) => string) => { const clockMode = useUserPreference<1 | 2>('clockMode'); - const timeFormat = useSetting('Message_TimeFormat') as string; + const timeFormat = useSetting('Message_TimeFormat', 'LT'); const format = clockMode !== undefined ? dayFormat[clockMode - 1] : timeFormat; return useCallback( - (time) => - moment(time).calendar(null, { + (time) => { + return moment(time).calendar(null, { sameDay: format, - lastDay: moment().localeData().calendar('lastDay').replace('LT', format), + lastDay: moment().calendar('lastDay').replace('LT', format), lastWeek: `dddd ${format}`, sameElse: 'LL', - }), + }); + }, [format], ); }; diff --git a/apps/meteor/private/moment-locales b/apps/meteor/private/moment-locales new file mode 120000 index 000000000000..793f634be7ea --- /dev/null +++ b/apps/meteor/private/moment-locales @@ -0,0 +1 @@ +../node_modules/moment/locale \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/af.js b/apps/meteor/private/moment-locales/af.js deleted file mode 100644 index d1a0ddae9131..000000000000 --- a/apps/meteor/private/moment-locales/af.js +++ /dev/null @@ -1,73 +0,0 @@ -//! moment.js locale configuration -//! locale : Afrikaans [af] -//! author : Werner Mollentze : https://github.com/wernerm - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var af = moment.defineLocale('af', { - months : 'Januarie_Februarie_Maart_April_Mei_Junie_Julie_Augustus_September_Oktober_November_Desember'.split('_'), - monthsShort : 'Jan_Feb_Mrt_Apr_Mei_Jun_Jul_Aug_Sep_Okt_Nov_Des'.split('_'), - weekdays : 'Sondag_Maandag_Dinsdag_Woensdag_Donderdag_Vrydag_Saterdag'.split('_'), - weekdaysShort : 'Son_Maa_Din_Woe_Don_Vry_Sat'.split('_'), - weekdaysMin : 'So_Ma_Di_Wo_Do_Vr_Sa'.split('_'), - meridiemParse: /vm|nm/i, - isPM : function (input) { - return /^nm$/i.test(input); - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 12) { - return isLower ? 'vm' : 'VM'; - } else { - return isLower ? 'nm' : 'NM'; - } - }, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Vandag om] LT', - nextDay : '[Môre om] LT', - nextWeek : 'dddd [om] LT', - lastDay : '[Gister om] LT', - lastWeek : '[Laas] dddd [om] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'oor %s', - past : '%s gelede', - s : '\'n paar sekondes', - m : '\'n minuut', - mm : '%d minute', - h : '\'n uur', - hh : '%d ure', - d : '\'n dag', - dd : '%d dae', - M : '\'n maand', - MM : '%d maande', - y : '\'n jaar', - yy : '%d jaar' - }, - ordinalParse: /\d{1,2}(ste|de)/, - ordinal : function (number) { - return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); // Thanks to Joris Röling : https://github.com/jjupiter - }, - week : { - dow : 1, // Maandag is die eerste dag van die week. - doy : 4 // Die week wat die 4de Januarie bevat is die eerste week van die jaar. - } - }); - - return af; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ar-ma.js b/apps/meteor/private/moment-locales/ar-ma.js deleted file mode 100644 index b12a7b1679e9..000000000000 --- a/apps/meteor/private/moment-locales/ar-ma.js +++ /dev/null @@ -1,60 +0,0 @@ -//! moment.js locale configuration -//! locale : Arabic (Morocco) [ar-ma] -//! author : ElFadili Yassine : https://github.com/ElFadiliY -//! author : Abdel Said : https://github.com/abdelsaid - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var ar_ma = moment.defineLocale('ar-ma', { - months : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), - monthsShort : 'يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر'.split('_'), - weekdays : 'الأحد_الإتنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), - weekdaysShort : 'احد_اتنين_ثلاثاء_اربعاء_خميس_جمعة_سبت'.split('_'), - weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[اليوم على الساعة] LT', - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'في %s', - past : 'منذ %s', - s : 'ثوان', - m : 'دقيقة', - mm : '%d دقائق', - h : 'ساعة', - hh : '%d ساعات', - d : 'يوم', - dd : '%d أيام', - M : 'شهر', - MM : '%d أشهر', - y : 'سنة', - yy : '%d سنوات' - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); - - return ar_ma; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ar-sa.js b/apps/meteor/private/moment-locales/ar-sa.js deleted file mode 100644 index 430a184c18fe..000000000000 --- a/apps/meteor/private/moment-locales/ar-sa.js +++ /dev/null @@ -1,104 +0,0 @@ -//! moment.js locale configuration -//! locale : Arabic (Saudi Arabia) [ar-sa] -//! author : Suhail Alkowaileet : https://github.com/xsoh - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var symbolMap = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠' - }, numberMap = { - '١': '1', - '٢': '2', - '٣': '3', - '٤': '4', - '٥': '5', - '٦': '6', - '٧': '7', - '٨': '8', - '٩': '9', - '٠': '0' - }; - - var ar_sa = moment.defineLocale('ar-sa', { - months : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), - monthsShort : 'يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), - weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), - weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), - weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - meridiemParse: /ص|م/, - isPM : function (input) { - return 'م' === input; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'ص'; - } else { - return 'م'; - } - }, - calendar : { - sameDay: '[اليوم على الساعة] LT', - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'في %s', - past : 'منذ %s', - s : 'ثوان', - m : 'دقيقة', - mm : '%d دقائق', - h : 'ساعة', - hh : '%d ساعات', - d : 'يوم', - dd : '%d أيام', - M : 'شهر', - MM : '%d أشهر', - y : 'سنة', - yy : '%d سنوات' - }, - preparse: function (string) { - return string.replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { - return numberMap[match]; - }).replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }).replace(/,/g, '،'); - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); - - return ar_sa; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ar-tn.js b/apps/meteor/private/moment-locales/ar-tn.js deleted file mode 100644 index 321d7625d943..000000000000 --- a/apps/meteor/private/moment-locales/ar-tn.js +++ /dev/null @@ -1,58 +0,0 @@ -//! moment.js locale configuration -//! locale : Arabic (Tunisia) [ar-tn] - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var ar_tn = moment.defineLocale('ar-tn', { - months: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), - monthsShort: 'جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر'.split('_'), - weekdays: 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), - weekdaysShort: 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), - weekdaysMin: 'ح_ن_ث_ر_خ_ج_س'.split('_'), - weekdaysParseExact : true, - longDateFormat: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'DD/MM/YYYY', - LL: 'D MMMM YYYY', - LLL: 'D MMMM YYYY HH:mm', - LLLL: 'dddd D MMMM YYYY HH:mm' - }, - calendar: { - sameDay: '[اليوم على الساعة] LT', - nextDay: '[غدا على الساعة] LT', - nextWeek: 'dddd [على الساعة] LT', - lastDay: '[أمس على الساعة] LT', - lastWeek: 'dddd [على الساعة] LT', - sameElse: 'L' - }, - relativeTime: { - future: 'في %s', - past: 'منذ %s', - s: 'ثوان', - m: 'دقيقة', - mm: '%d دقائق', - h: 'ساعة', - hh: '%d ساعات', - d: 'يوم', - dd: '%d أيام', - M: 'شهر', - MM: '%d أشهر', - y: 'سنة', - yy: '%d سنوات' - }, - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return ar_tn; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ar.js b/apps/meteor/private/moment-locales/ar.js deleted file mode 100644 index 6e727729ffad..000000000000 --- a/apps/meteor/private/moment-locales/ar.js +++ /dev/null @@ -1,137 +0,0 @@ -//! moment.js locale configuration -//! locale : Arabic [ar] -//! author : Abdel Said: https://github.com/abdelsaid -//! changes in months, weekdays: Ahmed Elkhatib -//! Native plural forms: forabi https://github.com/forabi - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var symbolMap = { - '1': '١', - '2': '٢', - '3': '٣', - '4': '٤', - '5': '٥', - '6': '٦', - '7': '٧', - '8': '٨', - '9': '٩', - '0': '٠' - }, numberMap = { - '١': '1', - '٢': '2', - '٣': '3', - '٤': '4', - '٥': '5', - '٦': '6', - '٧': '7', - '٨': '8', - '٩': '9', - '٠': '0' - }, pluralForm = function (n) { - return n === 0 ? 0 : n === 1 ? 1 : n === 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5; - }, plurals = { - s : ['أقل من ثانية', 'ثانية واحدة', ['ثانيتان', 'ثانيتين'], '%d ثوان', '%d ثانية', '%d ثانية'], - m : ['أقل من دقيقة', 'دقيقة واحدة', ['دقيقتان', 'دقيقتين'], '%d دقائق', '%d دقيقة', '%d دقيقة'], - h : ['أقل من ساعة', 'ساعة واحدة', ['ساعتان', 'ساعتين'], '%d ساعات', '%d ساعة', '%d ساعة'], - d : ['أقل من يوم', 'يوم واحد', ['يومان', 'يومين'], '%d أيام', '%d يومًا', '%d يوم'], - M : ['أقل من شهر', 'شهر واحد', ['شهران', 'شهرين'], '%d أشهر', '%d شهرا', '%d شهر'], - y : ['أقل من عام', 'عام واحد', ['عامان', 'عامين'], '%d أعوام', '%d عامًا', '%d عام'] - }, pluralize = function (u) { - return function (number, withoutSuffix, string, isFuture) { - var f = pluralForm(number), - str = plurals[u][pluralForm(number)]; - if (f === 2) { - str = str[withoutSuffix ? 0 : 1]; - } - return str.replace(/%d/i, number); - }; - }, months = [ - 'كانون الثاني يناير', - 'شباط فبراير', - 'آذار مارس', - 'نيسان أبريل', - 'أيار مايو', - 'حزيران يونيو', - 'تموز يوليو', - 'آب أغسطس', - 'أيلول سبتمبر', - 'تشرين الأول أكتوبر', - 'تشرين الثاني نوفمبر', - 'كانون الأول ديسمبر' - ]; - - var ar = moment.defineLocale('ar', { - months : months, - monthsShort : months, - weekdays : 'الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت'.split('_'), - weekdaysShort : 'أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت'.split('_'), - weekdaysMin : 'ح_ن_ث_ر_خ_ج_س'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'D/\u200FM/\u200FYYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - meridiemParse: /ص|م/, - isPM : function (input) { - return 'م' === input; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'ص'; - } else { - return 'م'; - } - }, - calendar : { - sameDay: '[اليوم عند الساعة] LT', - nextDay: '[غدًا عند الساعة] LT', - nextWeek: 'dddd [عند الساعة] LT', - lastDay: '[أمس عند الساعة] LT', - lastWeek: 'dddd [عند الساعة] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'بعد %s', - past : 'منذ %s', - s : pluralize('s'), - m : pluralize('m'), - mm : pluralize('m'), - h : pluralize('h'), - hh : pluralize('h'), - d : pluralize('d'), - dd : pluralize('d'), - M : pluralize('M'), - MM : pluralize('M'), - y : pluralize('y'), - yy : pluralize('y') - }, - preparse: function (string) { - return string.replace(/\u200f/g, '').replace(/[١٢٣٤٥٦٧٨٩٠]/g, function (match) { - return numberMap[match]; - }).replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }).replace(/,/g, '،'); - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); - - return ar; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/az.js b/apps/meteor/private/moment-locales/az.js deleted file mode 100644 index 5400ed47f2e3..000000000000 --- a/apps/meteor/private/moment-locales/az.js +++ /dev/null @@ -1,105 +0,0 @@ -//! moment.js locale configuration -//! locale : Azerbaijani [az] -//! author : topchiyev : https://github.com/topchiyev - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var suffixes = { - 1: '-inci', - 5: '-inci', - 8: '-inci', - 70: '-inci', - 80: '-inci', - 2: '-nci', - 7: '-nci', - 20: '-nci', - 50: '-nci', - 3: '-üncü', - 4: '-üncü', - 100: '-üncü', - 6: '-ncı', - 9: '-uncu', - 10: '-uncu', - 30: '-uncu', - 60: '-ıncı', - 90: '-ıncı' - }; - - var az = moment.defineLocale('az', { - months : 'yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr'.split('_'), - monthsShort : 'yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek'.split('_'), - weekdays : 'Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə'.split('_'), - weekdaysShort : 'Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən'.split('_'), - weekdaysMin : 'Bz_BE_ÇA_Çə_CA_Cü_Şə'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[bugün saat] LT', - nextDay : '[sabah saat] LT', - nextWeek : '[gələn həftə] dddd [saat] LT', - lastDay : '[dünən] LT', - lastWeek : '[keçən həftə] dddd [saat] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s sonra', - past : '%s əvvəl', - s : 'birneçə saniyyə', - m : 'bir dəqiqə', - mm : '%d dəqiqə', - h : 'bir saat', - hh : '%d saat', - d : 'bir gün', - dd : '%d gün', - M : 'bir ay', - MM : '%d ay', - y : 'bir il', - yy : '%d il' - }, - meridiemParse: /gecə|səhər|gündüz|axşam/, - isPM : function (input) { - return /^(gündüz|axşam)$/.test(input); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'gecə'; - } else if (hour < 12) { - return 'səhər'; - } else if (hour < 17) { - return 'gündüz'; - } else { - return 'axşam'; - } - }, - ordinalParse: /\d{1,2}-(ıncı|inci|nci|üncü|ncı|uncu)/, - ordinal : function (number) { - if (number === 0) { // special case for zero - return number + '-ıncı'; - } - var a = number % 10, - b = number % 100 - a, - c = number >= 100 ? 100 : null; - return number + (suffixes[a] || suffixes[b] || suffixes[c]); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return az; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/be.js b/apps/meteor/private/moment-locales/be.js deleted file mode 100644 index a76157ccdf9d..000000000000 --- a/apps/meteor/private/moment-locales/be.js +++ /dev/null @@ -1,134 +0,0 @@ -//! moment.js locale configuration -//! locale : Belarusian [be] -//! author : Dmitry Demidov : https://github.com/demidov91 -//! author: Praleska: http://praleska.pro/ -//! Author : Menelion Elensúle : https://github.com/Oire - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - function plural(word, num) { - var forms = word.split('_'); - return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); - } - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'mm': withoutSuffix ? 'хвіліна_хвіліны_хвілін' : 'хвіліну_хвіліны_хвілін', - 'hh': withoutSuffix ? 'гадзіна_гадзіны_гадзін' : 'гадзіну_гадзіны_гадзін', - 'dd': 'дзень_дні_дзён', - 'MM': 'месяц_месяцы_месяцаў', - 'yy': 'год_гады_гадоў' - }; - if (key === 'm') { - return withoutSuffix ? 'хвіліна' : 'хвіліну'; - } - else if (key === 'h') { - return withoutSuffix ? 'гадзіна' : 'гадзіну'; - } - else { - return number + ' ' + plural(format[key], +number); - } - } - - var be = moment.defineLocale('be', { - months : { - format: 'студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня'.split('_'), - standalone: 'студзень_люты_сакавік_красавік_травень_чэрвень_ліпень_жнівень_верасень_кастрычнік_лістапад_снежань'.split('_') - }, - monthsShort : 'студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж'.split('_'), - weekdays : { - format: 'нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу'.split('_'), - standalone: 'нядзеля_панядзелак_аўторак_серада_чацвер_пятніца_субота'.split('_'), - isFormat: /\[ ?[Вв] ?(?:мінулую|наступную)? ?\] ?dddd/ - }, - weekdaysShort : 'нд_пн_ат_ср_чц_пт_сб'.split('_'), - weekdaysMin : 'нд_пн_ат_ср_чц_пт_сб'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY г.', - LLL : 'D MMMM YYYY г., HH:mm', - LLLL : 'dddd, D MMMM YYYY г., HH:mm' - }, - calendar : { - sameDay: '[Сёння ў] LT', - nextDay: '[Заўтра ў] LT', - lastDay: '[Учора ў] LT', - nextWeek: function () { - return '[У] dddd [ў] LT'; - }, - lastWeek: function () { - switch (this.day()) { - case 0: - case 3: - case 5: - case 6: - return '[У мінулую] dddd [ў] LT'; - case 1: - case 2: - case 4: - return '[У мінулы] dddd [ў] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : 'праз %s', - past : '%s таму', - s : 'некалькі секунд', - m : relativeTimeWithPlural, - mm : relativeTimeWithPlural, - h : relativeTimeWithPlural, - hh : relativeTimeWithPlural, - d : 'дзень', - dd : relativeTimeWithPlural, - M : 'месяц', - MM : relativeTimeWithPlural, - y : 'год', - yy : relativeTimeWithPlural - }, - meridiemParse: /ночы|раніцы|дня|вечара/, - isPM : function (input) { - return /^(дня|вечара)$/.test(input); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'ночы'; - } else if (hour < 12) { - return 'раніцы'; - } else if (hour < 17) { - return 'дня'; - } else { - return 'вечара'; - } - }, - ordinalParse: /\d{1,2}-(і|ы|га)/, - ordinal: function (number, period) { - switch (period) { - case 'M': - case 'd': - case 'DDD': - case 'w': - case 'W': - return (number % 10 === 2 || number % 10 === 3) && (number % 100 !== 12 && number % 100 !== 13) ? number + '-і' : number + '-ы'; - case 'D': - return number + '-га'; - default: - return number; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return be; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/bg.js b/apps/meteor/private/moment-locales/bg.js deleted file mode 100644 index deedab8cdaa0..000000000000 --- a/apps/meteor/private/moment-locales/bg.js +++ /dev/null @@ -1,90 +0,0 @@ -//! moment.js locale configuration -//! locale : Bulgarian [bg] -//! author : Krasen Borisov : https://github.com/kraz - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var bg = moment.defineLocale('bg', { - months : 'януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември'.split('_'), - monthsShort : 'янр_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек'.split('_'), - weekdays : 'неделя_понеделник_вторник_сряда_четвъртък_петък_събота'.split('_'), - weekdaysShort : 'нед_пон_вто_сря_чет_пет_съб'.split('_'), - weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'D.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY H:mm', - LLLL : 'dddd, D MMMM YYYY H:mm' - }, - calendar : { - sameDay : '[Днес в] LT', - nextDay : '[Утре в] LT', - nextWeek : 'dddd [в] LT', - lastDay : '[Вчера в] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - case 6: - return '[В изминалата] dddd [в] LT'; - case 1: - case 2: - case 4: - case 5: - return '[В изминалия] dddd [в] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : 'след %s', - past : 'преди %s', - s : 'няколко секунди', - m : 'минута', - mm : '%d минути', - h : 'час', - hh : '%d часа', - d : 'ден', - dd : '%d дни', - M : 'месец', - MM : '%d месеца', - y : 'година', - yy : '%d години' - }, - ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/, - ordinal : function (number) { - var lastDigit = number % 10, - last2Digits = number % 100; - if (number === 0) { - return number + '-ев'; - } else if (last2Digits === 0) { - return number + '-ен'; - } else if (last2Digits > 10 && last2Digits < 20) { - return number + '-ти'; - } else if (lastDigit === 1) { - return number + '-ви'; - } else if (lastDigit === 2) { - return number + '-ри'; - } else if (lastDigit === 7 || lastDigit === 8) { - return number + '-ми'; - } else { - return number + '-ти'; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return bg; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/bn.js b/apps/meteor/private/moment-locales/bn.js deleted file mode 100644 index 576a9781219c..000000000000 --- a/apps/meteor/private/moment-locales/bn.js +++ /dev/null @@ -1,119 +0,0 @@ -//! moment.js locale configuration -//! locale : Bengali [bn] -//! author : Kaushik Gandhi : https://github.com/kaushikgandhi - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var symbolMap = { - '1': '১', - '2': '২', - '3': '৩', - '4': '৪', - '5': '৫', - '6': '৬', - '7': '৭', - '8': '৮', - '9': '৯', - '0': '০' - }, - numberMap = { - '১': '1', - '২': '2', - '৩': '3', - '৪': '4', - '৫': '5', - '৬': '6', - '৭': '7', - '৮': '8', - '৯': '9', - '০': '0' - }; - - var bn = moment.defineLocale('bn', { - months : 'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'), - monthsShort : 'জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্'.split('_'), - weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রবার_শনিবার'.split('_'), - weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্র_শনি'.split('_'), - weekdaysMin : 'রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি'.split('_'), - longDateFormat : { - LT : 'A h:mm সময়', - LTS : 'A h:mm:ss সময়', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm সময়', - LLLL : 'dddd, D MMMM YYYY, A h:mm সময়' - }, - calendar : { - sameDay : '[আজ] LT', - nextDay : '[আগামীকাল] LT', - nextWeek : 'dddd, LT', - lastDay : '[গতকাল] LT', - lastWeek : '[গত] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s পরে', - past : '%s আগে', - s : 'কয়েক সেকেন্ড', - m : 'এক মিনিট', - mm : '%d মিনিট', - h : 'এক ঘন্টা', - hh : '%d ঘন্টা', - d : 'এক দিন', - dd : '%d দিন', - M : 'এক মাস', - MM : '%d মাস', - y : 'এক বছর', - yy : '%d বছর' - }, - preparse: function (string) { - return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiemParse: /রাত|সকাল|দুপুর|বিকাল|রাত/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if ((meridiem === 'রাত' && hour >= 4) || - (meridiem === 'দুপুর' && hour < 5) || - meridiem === 'বিকাল') { - return hour + 12; - } else { - return hour; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'রাত'; - } else if (hour < 10) { - return 'সকাল'; - } else if (hour < 17) { - return 'দুপুর'; - } else if (hour < 20) { - return 'বিকাল'; - } else { - return 'রাত'; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); - - return bn; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/bo.js b/apps/meteor/private/moment-locales/bo.js deleted file mode 100644 index 3f6fe1936373..000000000000 --- a/apps/meteor/private/moment-locales/bo.js +++ /dev/null @@ -1,119 +0,0 @@ -//! moment.js locale configuration -//! locale : Tibetan [bo] -//! author : Thupten N. Chakrishar : https://github.com/vajradog - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var symbolMap = { - '1': '༡', - '2': '༢', - '3': '༣', - '4': '༤', - '5': '༥', - '6': '༦', - '7': '༧', - '8': '༨', - '9': '༩', - '0': '༠' - }, - numberMap = { - '༡': '1', - '༢': '2', - '༣': '3', - '༤': '4', - '༥': '5', - '༦': '6', - '༧': '7', - '༨': '8', - '༩': '9', - '༠': '0' - }; - - var bo = moment.defineLocale('bo', { - months : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'), - monthsShort : 'ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ'.split('_'), - weekdays : 'གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་'.split('_'), - weekdaysShort : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'), - weekdaysMin : 'ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་'.split('_'), - longDateFormat : { - LT : 'A h:mm', - LTS : 'A h:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm', - LLLL : 'dddd, D MMMM YYYY, A h:mm' - }, - calendar : { - sameDay : '[དི་རིང] LT', - nextDay : '[སང་ཉིན] LT', - nextWeek : '[བདུན་ཕྲག་རྗེས་མ], LT', - lastDay : '[ཁ་སང] LT', - lastWeek : '[བདུན་ཕྲག་མཐའ་མ] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s ལ་', - past : '%s སྔན་ལ', - s : 'ལམ་སང', - m : 'སྐར་མ་གཅིག', - mm : '%d སྐར་མ', - h : 'ཆུ་ཚོད་གཅིག', - hh : '%d ཆུ་ཚོད', - d : 'ཉིན་གཅིག', - dd : '%d ཉིན་', - M : 'ཟླ་བ་གཅིག', - MM : '%d ཟླ་བ', - y : 'ལོ་གཅིག', - yy : '%d ལོ' - }, - preparse: function (string) { - return string.replace(/[༡༢༣༤༥༦༧༨༩༠]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiemParse: /མཚན་མོ|ཞོགས་ཀས|ཉིན་གུང|དགོང་དག|མཚན་མོ/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if ((meridiem === 'མཚན་མོ' && hour >= 4) || - (meridiem === 'ཉིན་གུང' && hour < 5) || - meridiem === 'དགོང་དག') { - return hour + 12; - } else { - return hour; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'མཚན་མོ'; - } else if (hour < 10) { - return 'ཞོགས་ཀས'; - } else if (hour < 17) { - return 'ཉིན་གུང'; - } else if (hour < 20) { - return 'དགོང་དག'; - } else { - return 'མཚན་མོ'; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); - - return bo; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/br.js b/apps/meteor/private/moment-locales/br.js deleted file mode 100644 index ca290f3c87f9..000000000000 --- a/apps/meteor/private/moment-locales/br.js +++ /dev/null @@ -1,108 +0,0 @@ -//! moment.js locale configuration -//! locale : Breton [br] -//! author : Jean-Baptiste Le Duigou : https://github.com/jbleduigou - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - function relativeTimeWithMutation(number, withoutSuffix, key) { - var format = { - 'mm': 'munutenn', - 'MM': 'miz', - 'dd': 'devezh' - }; - return number + ' ' + mutation(format[key], number); - } - function specialMutationForYears(number) { - switch (lastNumber(number)) { - case 1: - case 3: - case 4: - case 5: - case 9: - return number + ' bloaz'; - default: - return number + ' vloaz'; - } - } - function lastNumber(number) { - if (number > 9) { - return lastNumber(number % 10); - } - return number; - } - function mutation(text, number) { - if (number === 2) { - return softMutation(text); - } - return text; - } - function softMutation(text) { - var mutationTable = { - 'm': 'v', - 'b': 'v', - 'd': 'z' - }; - if (mutationTable[text.charAt(0)] === undefined) { - return text; - } - return mutationTable[text.charAt(0)] + text.substring(1); - } - - var br = moment.defineLocale('br', { - months : 'Genver_C\'hwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu'.split('_'), - monthsShort : 'Gen_C\'hwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker'.split('_'), - weekdays : 'Sul_Lun_Meurzh_Merc\'her_Yaou_Gwener_Sadorn'.split('_'), - weekdaysShort : 'Sul_Lun_Meu_Mer_Yao_Gwe_Sad'.split('_'), - weekdaysMin : 'Su_Lu_Me_Mer_Ya_Gw_Sa'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'h[e]mm A', - LTS : 'h[e]mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D [a viz] MMMM YYYY', - LLL : 'D [a viz] MMMM YYYY h[e]mm A', - LLLL : 'dddd, D [a viz] MMMM YYYY h[e]mm A' - }, - calendar : { - sameDay : '[Hiziv da] LT', - nextDay : '[Warc\'hoazh da] LT', - nextWeek : 'dddd [da] LT', - lastDay : '[Dec\'h da] LT', - lastWeek : 'dddd [paset da] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'a-benn %s', - past : '%s \'zo', - s : 'un nebeud segondennoù', - m : 'ur vunutenn', - mm : relativeTimeWithMutation, - h : 'un eur', - hh : '%d eur', - d : 'un devezh', - dd : relativeTimeWithMutation, - M : 'ur miz', - MM : relativeTimeWithMutation, - y : 'ur bloaz', - yy : specialMutationForYears - }, - ordinalParse: /\d{1,2}(añ|vet)/, - ordinal : function (number) { - var output = (number === 1) ? 'añ' : 'vet'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return br; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/bs.js b/apps/meteor/private/moment-locales/bs.js deleted file mode 100644 index 5bf3e60e055c..000000000000 --- a/apps/meteor/private/moment-locales/bs.js +++ /dev/null @@ -1,143 +0,0 @@ -//! moment.js locale configuration -//! locale : Bosnian [bs] -//! author : Nedim Cholich : https://github.com/frontyard -//! based on (hr) translation by Bojan Marković - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - function translate(number, withoutSuffix, key) { - var result = number + ' '; - switch (key) { - case 'm': - return withoutSuffix ? 'jedna minuta' : 'jedne minute'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minuta'; - } - return result; - case 'h': - return withoutSuffix ? 'jedan sat' : 'jednog sata'; - case 'hh': - if (number === 1) { - result += 'sat'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'sata'; - } else { - result += 'sati'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dana'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mjesec'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'mjeseca'; - } else { - result += 'mjeseci'; - } - return result; - case 'yy': - if (number === 1) { - result += 'godina'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'godine'; - } else { - result += 'godina'; - } - return result; - } - } - - var bs = moment.defineLocale('bs', { - months : 'januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar'.split('_'), - monthsShort : 'jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.'.split('_'), - monthsParseExact: true, - weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), - weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), - weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD. MM. YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY H:mm', - LLLL : 'dddd, D. MMMM YYYY H:mm' - }, - calendar : { - sameDay : '[danas u] LT', - nextDay : '[sutra u] LT', - nextWeek : function () { - switch (this.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[jučer u] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prošli] dddd [u] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : 'za %s', - past : 'prije %s', - s : 'par sekundi', - m : translate, - mm : translate, - h : translate, - hh : translate, - d : 'dan', - dd : translate, - M : 'mjesec', - MM : translate, - y : 'godinu', - yy : translate - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return bs; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ca.js b/apps/meteor/private/moment-locales/ca.js deleted file mode 100644 index 7882800a24e3..000000000000 --- a/apps/meteor/private/moment-locales/ca.js +++ /dev/null @@ -1,81 +0,0 @@ -//! moment.js locale configuration -//! locale : Catalan [ca] -//! author : Juan G. Hurtado : https://github.com/juanghurtado - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var ca = moment.defineLocale('ca', { - months : 'gener_febrer_març_abril_maig_juny_juliol_agost_setembre_octubre_novembre_desembre'.split('_'), - monthsShort : 'gen._febr._mar._abr._mai._jun._jul._ag._set._oct._nov._des.'.split('_'), - monthsParseExact : true, - weekdays : 'diumenge_dilluns_dimarts_dimecres_dijous_divendres_dissabte'.split('_'), - weekdaysShort : 'dg._dl._dt._dc._dj._dv._ds.'.split('_'), - weekdaysMin : 'Dg_Dl_Dt_Dc_Dj_Dv_Ds'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY H:mm', - LLLL : 'dddd D MMMM YYYY H:mm' - }, - calendar : { - sameDay : function () { - return '[avui a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - nextDay : function () { - return '[demà a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - nextWeek : function () { - return 'dddd [a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - lastDay : function () { - return '[ahir a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - lastWeek : function () { - return '[el] dddd [passat a ' + ((this.hours() !== 1) ? 'les' : 'la') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : 'en %s', - past : 'fa %s', - s : 'uns segons', - m : 'un minut', - mm : '%d minuts', - h : 'una hora', - hh : '%d hores', - d : 'un dia', - dd : '%d dies', - M : 'un mes', - MM : '%d mesos', - y : 'un any', - yy : '%d anys' - }, - ordinalParse: /\d{1,2}(r|n|t|è|a)/, - ordinal : function (number, period) { - var output = (number === 1) ? 'r' : - (number === 2) ? 'n' : - (number === 3) ? 'r' : - (number === 4) ? 't' : 'è'; - if (period === 'w' || period === 'W') { - output = 'a'; - } - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return ca; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/cs.js b/apps/meteor/private/moment-locales/cs.js deleted file mode 100644 index 129e936b14b2..000000000000 --- a/apps/meteor/private/moment-locales/cs.js +++ /dev/null @@ -1,172 +0,0 @@ -//! moment.js locale configuration -//! locale : Czech [cs] -//! author : petrbela : https://github.com/petrbela - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var months = 'leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec'.split('_'), - monthsShort = 'led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro'.split('_'); - function plural(n) { - return (n > 1) && (n < 5) && (~~(n / 10) !== 1); - } - function translate(number, withoutSuffix, key, isFuture) { - var result = number + ' '; - switch (key) { - case 's': // a few seconds / in a few seconds / a few seconds ago - return (withoutSuffix || isFuture) ? 'pár sekund' : 'pár sekundami'; - case 'm': // a minute / in a minute / a minute ago - return withoutSuffix ? 'minuta' : (isFuture ? 'minutu' : 'minutou'); - case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'minuty' : 'minut'); - } else { - return result + 'minutami'; - } - break; - case 'h': // an hour / in an hour / an hour ago - return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou'); - case 'hh': // 9 hours / in 9 hours / 9 hours ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'hodiny' : 'hodin'); - } else { - return result + 'hodinami'; - } - break; - case 'd': // a day / in a day / a day ago - return (withoutSuffix || isFuture) ? 'den' : 'dnem'; - case 'dd': // 9 days / in 9 days / 9 days ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'dny' : 'dní'); - } else { - return result + 'dny'; - } - break; - case 'M': // a month / in a month / a month ago - return (withoutSuffix || isFuture) ? 'měsíc' : 'měsícem'; - case 'MM': // 9 months / in 9 months / 9 months ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'měsíce' : 'měsíců'); - } else { - return result + 'měsíci'; - } - break; - case 'y': // a year / in a year / a year ago - return (withoutSuffix || isFuture) ? 'rok' : 'rokem'; - case 'yy': // 9 years / in 9 years / 9 years ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'roky' : 'let'); - } else { - return result + 'lety'; - } - break; - } - } - - var cs = moment.defineLocale('cs', { - months : months, - monthsShort : monthsShort, - monthsParse : (function (months, monthsShort) { - var i, _monthsParse = []; - for (i = 0; i < 12; i++) { - // use custom parser to solve problem with July (červenec) - _monthsParse[i] = new RegExp('^' + months[i] + '$|^' + monthsShort[i] + '$', 'i'); - } - return _monthsParse; - }(months, monthsShort)), - shortMonthsParse : (function (monthsShort) { - var i, _shortMonthsParse = []; - for (i = 0; i < 12; i++) { - _shortMonthsParse[i] = new RegExp('^' + monthsShort[i] + '$', 'i'); - } - return _shortMonthsParse; - }(monthsShort)), - longMonthsParse : (function (months) { - var i, _longMonthsParse = []; - for (i = 0; i < 12; i++) { - _longMonthsParse[i] = new RegExp('^' + months[i] + '$', 'i'); - } - return _longMonthsParse; - }(months)), - weekdays : 'neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota'.split('_'), - weekdaysShort : 'ne_po_út_st_čt_pá_so'.split('_'), - weekdaysMin : 'ne_po_út_st_čt_pá_so'.split('_'), - longDateFormat : { - LT: 'H:mm', - LTS : 'H:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY H:mm', - LLLL : 'dddd D. MMMM YYYY H:mm', - l : 'D. M. YYYY' - }, - calendar : { - sameDay: '[dnes v] LT', - nextDay: '[zítra v] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[v neděli v] LT'; - case 1: - case 2: - return '[v] dddd [v] LT'; - case 3: - return '[ve středu v] LT'; - case 4: - return '[ve čtvrtek v] LT'; - case 5: - return '[v pátek v] LT'; - case 6: - return '[v sobotu v] LT'; - } - }, - lastDay: '[včera v] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[minulou neděli v] LT'; - case 1: - case 2: - return '[minulé] dddd [v] LT'; - case 3: - return '[minulou středu v] LT'; - case 4: - case 5: - return '[minulý] dddd [v] LT'; - case 6: - return '[minulou sobotu v] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : 'za %s', - past : 'před %s', - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinalParse : /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return cs; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/cv.js b/apps/meteor/private/moment-locales/cv.js deleted file mode 100644 index 60bf21389636..000000000000 --- a/apps/meteor/private/moment-locales/cv.js +++ /dev/null @@ -1,63 +0,0 @@ -//! moment.js locale configuration -//! locale : Chuvash [cv] -//! author : Anatoly Mironov : https://github.com/mirontoli - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var cv = moment.defineLocale('cv', { - months : 'кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав'.split('_'), - monthsShort : 'кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш'.split('_'), - weekdays : 'вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун'.split('_'), - weekdaysShort : 'выр_тун_ытл_юн_кӗҫ_эрн_шӑм'.split('_'), - weekdaysMin : 'вр_тн_ыт_юн_кҫ_эр_шм'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD-MM-YYYY', - LL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]', - LLL : 'YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm', - LLLL : 'dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm' - }, - calendar : { - sameDay: '[Паян] LT [сехетре]', - nextDay: '[Ыран] LT [сехетре]', - lastDay: '[Ӗнер] LT [сехетре]', - nextWeek: '[Ҫитес] dddd LT [сехетре]', - lastWeek: '[Иртнӗ] dddd LT [сехетре]', - sameElse: 'L' - }, - relativeTime : { - future : function (output) { - var affix = /сехет$/i.exec(output) ? 'рен' : /ҫул$/i.exec(output) ? 'тан' : 'ран'; - return output + affix; - }, - past : '%s каялла', - s : 'пӗр-ик ҫеккунт', - m : 'пӗр минут', - mm : '%d минут', - h : 'пӗр сехет', - hh : '%d сехет', - d : 'пӗр кун', - dd : '%d кун', - M : 'пӗр уйӑх', - MM : '%d уйӑх', - y : 'пӗр ҫул', - yy : '%d ҫул' - }, - ordinalParse: /\d{1,2}-мӗш/, - ordinal : '%d-мӗш', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return cv; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/cy.js b/apps/meteor/private/moment-locales/cy.js deleted file mode 100644 index 9a43529cbe07..000000000000 --- a/apps/meteor/private/moment-locales/cy.js +++ /dev/null @@ -1,80 +0,0 @@ -//! moment.js locale configuration -//! locale : Welsh [cy] -//! author : Robert Allen - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var cy = moment.defineLocale('cy', { - months: 'Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr'.split('_'), - monthsShort: 'Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag'.split('_'), - weekdays: 'Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn'.split('_'), - weekdaysShort: 'Sul_Llun_Maw_Mer_Iau_Gwe_Sad'.split('_'), - weekdaysMin: 'Su_Ll_Ma_Me_Ia_Gw_Sa'.split('_'), - weekdaysParseExact : true, - // time formats are the same as en-gb - longDateFormat: { - LT: 'HH:mm', - LTS : 'HH:mm:ss', - L: 'DD/MM/YYYY', - LL: 'D MMMM YYYY', - LLL: 'D MMMM YYYY HH:mm', - LLLL: 'dddd, D MMMM YYYY HH:mm' - }, - calendar: { - sameDay: '[Heddiw am] LT', - nextDay: '[Yfory am] LT', - nextWeek: 'dddd [am] LT', - lastDay: '[Ddoe am] LT', - lastWeek: 'dddd [diwethaf am] LT', - sameElse: 'L' - }, - relativeTime: { - future: 'mewn %s', - past: '%s yn ôl', - s: 'ychydig eiliadau', - m: 'munud', - mm: '%d munud', - h: 'awr', - hh: '%d awr', - d: 'diwrnod', - dd: '%d diwrnod', - M: 'mis', - MM: '%d mis', - y: 'blwyddyn', - yy: '%d flynedd' - }, - ordinalParse: /\d{1,2}(fed|ain|af|il|ydd|ed|eg)/, - // traditional ordinal numbers above 31 are not commonly used in colloquial Welsh - ordinal: function (number) { - var b = number, - output = '', - lookup = [ - '', 'af', 'il', 'ydd', 'ydd', 'ed', 'ed', 'ed', 'fed', 'fed', 'fed', // 1af to 10fed - 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'eg', 'fed', 'eg', 'fed' // 11eg to 20fed - ]; - if (b > 20) { - if (b === 40 || b === 50 || b === 60 || b === 80 || b === 100) { - output = 'fed'; // not 30ain, 70ain or 90ain - } else { - output = 'ain'; - } - } else if (b > 0) { - output = lookup[b]; - } - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return cy; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/da.js b/apps/meteor/private/moment-locales/da.js deleted file mode 100644 index d5cbbdb345d5..000000000000 --- a/apps/meteor/private/moment-locales/da.js +++ /dev/null @@ -1,60 +0,0 @@ -//! moment.js locale configuration -//! locale : Danish [da] -//! author : Ulrik Nielsen : https://github.com/mrbase - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var da = moment.defineLocale('da', { - months : 'januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december'.split('_'), - monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), - weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), - weekdaysShort : 'søn_man_tir_ons_tor_fre_lør'.split('_'), - weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY HH:mm', - LLLL : 'dddd [d.] D. MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[I dag kl.] LT', - nextDay : '[I morgen kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[I går kl.] LT', - lastWeek : '[sidste] dddd [kl] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'om %s', - past : '%s siden', - s : 'få sekunder', - m : 'et minut', - mm : '%d minutter', - h : 'en time', - hh : '%d timer', - d : 'en dag', - dd : '%d dage', - M : 'en måned', - MM : '%d måneder', - y : 'et år', - yy : '%d år' - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return da; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/de-at.js b/apps/meteor/private/moment-locales/de-at.js deleted file mode 100644 index d1fd398598c2..000000000000 --- a/apps/meteor/private/moment-locales/de-at.js +++ /dev/null @@ -1,79 +0,0 @@ -//! moment.js locale configuration -//! locale : German (Austria) [de-at] -//! author : lluchs : https://github.com/lluchs -//! author: Menelion Elensúle: https://github.com/Oire -//! author : Martin Groller : https://github.com/MadMG -//! author : Mikolaj Dadela : https://github.com/mik01aj - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 'm': ['eine Minute', 'einer Minute'], - 'h': ['eine Stunde', 'einer Stunde'], - 'd': ['ein Tag', 'einem Tag'], - 'dd': [number + ' Tage', number + ' Tagen'], - 'M': ['ein Monat', 'einem Monat'], - 'MM': [number + ' Monate', number + ' Monaten'], - 'y': ['ein Jahr', 'einem Jahr'], - 'yy': [number + ' Jahre', number + ' Jahren'] - }; - return withoutSuffix ? format[key][0] : format[key][1]; - } - - var de_at = moment.defineLocale('de-at', { - months : 'Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), - monthsShort : 'Jän._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'), - monthsParseExact : true, - weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'), - weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'), - weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY HH:mm', - LLLL : 'dddd, D. MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[heute um] LT [Uhr]', - sameElse: 'L', - nextDay: '[morgen um] LT [Uhr]', - nextWeek: 'dddd [um] LT [Uhr]', - lastDay: '[gestern um] LT [Uhr]', - lastWeek: '[letzten] dddd [um] LT [Uhr]' - }, - relativeTime : { - future : 'in %s', - past : 'vor %s', - s : 'ein paar Sekunden', - m : processRelativeTime, - mm : '%d Minuten', - h : processRelativeTime, - hh : '%d Stunden', - d : processRelativeTime, - dd : processRelativeTime, - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return de_at; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/de.js b/apps/meteor/private/moment-locales/de.js deleted file mode 100644 index 203dac910183..000000000000 --- a/apps/meteor/private/moment-locales/de.js +++ /dev/null @@ -1,78 +0,0 @@ -//! moment.js locale configuration -//! locale : German [de] -//! author : lluchs : https://github.com/lluchs -//! author: Menelion Elensúle: https://github.com/Oire -//! author : Mikolaj Dadela : https://github.com/mik01aj - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 'm': ['eine Minute', 'einer Minute'], - 'h': ['eine Stunde', 'einer Stunde'], - 'd': ['ein Tag', 'einem Tag'], - 'dd': [number + ' Tage', number + ' Tagen'], - 'M': ['ein Monat', 'einem Monat'], - 'MM': [number + ' Monate', number + ' Monaten'], - 'y': ['ein Jahr', 'einem Jahr'], - 'yy': [number + ' Jahre', number + ' Jahren'] - }; - return withoutSuffix ? format[key][0] : format[key][1]; - } - - var de = moment.defineLocale('de', { - months : 'Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), - monthsShort : 'Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'), - monthsParseExact : true, - weekdays : 'Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag'.split('_'), - weekdaysShort : 'So._Mo._Di._Mi._Do._Fr._Sa.'.split('_'), - weekdaysMin : 'So_Mo_Di_Mi_Do_Fr_Sa'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY HH:mm', - LLLL : 'dddd, D. MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[heute um] LT [Uhr]', - sameElse: 'L', - nextDay: '[morgen um] LT [Uhr]', - nextWeek: 'dddd [um] LT [Uhr]', - lastDay: '[gestern um] LT [Uhr]', - lastWeek: '[letzten] dddd [um] LT [Uhr]' - }, - relativeTime : { - future : 'in %s', - past : 'vor %s', - s : 'ein paar Sekunden', - m : processRelativeTime, - mm : '%d Minuten', - h : processRelativeTime, - hh : '%d Stunden', - d : processRelativeTime, - dd : processRelativeTime, - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return de; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/dv.js b/apps/meteor/private/moment-locales/dv.js deleted file mode 100644 index 911b89d5dc35..000000000000 --- a/apps/meteor/private/moment-locales/dv.js +++ /dev/null @@ -1,99 +0,0 @@ -//! moment.js locale configuration -//! locale : Maldivian [dv] -//! author : Jawish Hameed : https://github.com/jawish - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var months = [ - 'ޖެނުއަރީ', - 'ފެބްރުއަރީ', - 'މާރިޗު', - 'އޭޕްރީލު', - 'މޭ', - 'ޖޫން', - 'ޖުލައި', - 'އޯގަސްޓު', - 'ސެޕްޓެމްބަރު', - 'އޮކްޓޯބަރު', - 'ނޮވެމްބަރު', - 'ޑިސެމްބަރު' - ], weekdays = [ - 'އާދިއްތަ', - 'ހޯމަ', - 'އަންގާރަ', - 'ބުދަ', - 'ބުރާސްފަތި', - 'ހުކުރު', - 'ހޮނިހިރު' - ]; - - var dv = moment.defineLocale('dv', { - months : months, - monthsShort : months, - weekdays : weekdays, - weekdaysShort : weekdays, - weekdaysMin : 'އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި'.split('_'), - longDateFormat : { - - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'D/M/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - meridiemParse: /މކ|މފ/, - isPM : function (input) { - return 'މފ' === input; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'މކ'; - } else { - return 'މފ'; - } - }, - calendar : { - sameDay : '[މިއަދު] LT', - nextDay : '[މާދަމާ] LT', - nextWeek : 'dddd LT', - lastDay : '[އިއްޔެ] LT', - lastWeek : '[ފާއިތުވި] dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : 'ތެރޭގައި %s', - past : 'ކުރިން %s', - s : 'ސިކުންތުކޮޅެއް', - m : 'މިނިޓެއް', - mm : 'މިނިޓު %d', - h : 'ގަޑިއިރެއް', - hh : 'ގަޑިއިރު %d', - d : 'ދުވަހެއް', - dd : 'ދުވަސް %d', - M : 'މަހެއް', - MM : 'މަސް %d', - y : 'އަހަރެއް', - yy : 'އަހަރު %d' - }, - preparse: function (string) { - return string.replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/,/g, '،'); - }, - week : { - dow : 7, // Sunday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); - - return dv; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/el.js b/apps/meteor/private/moment-locales/el.js deleted file mode 100644 index 588cb235c89c..000000000000 --- a/apps/meteor/private/moment-locales/el.js +++ /dev/null @@ -1,98 +0,0 @@ -//! moment.js locale configuration -//! locale : Greek [el] -//! author : Aggelos Karalias : https://github.com/mehiel - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - function isFunction(input) { - return input instanceof Function || Object.prototype.toString.call(input) === '[object Function]'; - } - - - var el = moment.defineLocale('el', { - monthsNominativeEl : 'Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος'.split('_'), - monthsGenitiveEl : 'Ιανουαρίου_Φεβρουαρίου_Μαρτίου_Απριλίου_Μαΐου_Ιουνίου_Ιουλίου_Αυγούστου_Σεπτεμβρίου_Οκτωβρίου_Νοεμβρίου_Δεκεμβρίου'.split('_'), - months : function (momentToFormat, format) { - if (/D/.test(format.substring(0, format.indexOf('MMMM')))) { // if there is a day number before 'MMMM' - return this._monthsGenitiveEl[momentToFormat.month()]; - } else { - return this._monthsNominativeEl[momentToFormat.month()]; - } - }, - monthsShort : 'Ιαν_Φεβ_Μαρ_Απρ_Μαϊ_Ιουν_Ιουλ_Αυγ_Σεπ_Οκτ_Νοε_Δεκ'.split('_'), - weekdays : 'Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο'.split('_'), - weekdaysShort : 'Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ'.split('_'), - weekdaysMin : 'Κυ_Δε_Τρ_Τε_Πε_Πα_Σα'.split('_'), - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'μμ' : 'ΜΜ'; - } else { - return isLower ? 'πμ' : 'ΠΜ'; - } - }, - isPM : function (input) { - return ((input + '').toLowerCase()[0] === 'μ'); - }, - meridiemParse : /[ΠΜ]\.?Μ?\.?/i, - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY h:mm A', - LLLL : 'dddd, D MMMM YYYY h:mm A' - }, - calendarEl : { - sameDay : '[Σήμερα {}] LT', - nextDay : '[Αύριο {}] LT', - nextWeek : 'dddd [{}] LT', - lastDay : '[Χθες {}] LT', - lastWeek : function () { - switch (this.day()) { - case 6: - return '[το προηγούμενο] dddd [{}] LT'; - default: - return '[την προηγούμενη] dddd [{}] LT'; - } - }, - sameElse : 'L' - }, - calendar : function (key, mom) { - var output = this._calendarEl[key], - hours = mom && mom.hours(); - if (isFunction(output)) { - output = output.apply(mom); - } - return output.replace('{}', (hours % 12 === 1 ? 'στη' : 'στις')); - }, - relativeTime : { - future : 'σε %s', - past : '%s πριν', - s : 'λίγα δευτερόλεπτα', - m : 'ένα λεπτό', - mm : '%d λεπτά', - h : 'μία ώρα', - hh : '%d ώρες', - d : 'μία μέρα', - dd : '%d μέρες', - M : 'ένας μήνας', - MM : '%d μήνες', - y : 'ένας χρόνος', - yy : '%d χρόνια' - }, - ordinalParse: /\d{1,2}η/, - ordinal: '%dη', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4st is the first week of the year. - } - }); - - return el; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/en-au.js b/apps/meteor/private/moment-locales/en-au.js deleted file mode 100644 index 92a2a636a5ff..000000000000 --- a/apps/meteor/private/moment-locales/en-au.js +++ /dev/null @@ -1,66 +0,0 @@ -//! moment.js locale configuration -//! locale : English (Australia) [en-au] - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var en_au = moment.defineLocale('en-au', { - months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), - weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY h:mm A', - LLLL : 'dddd, D MMMM YYYY h:mm A' - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }, - ordinalParse: /\d{1,2}(st|nd|rd|th)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return en_au; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/en-ca.js b/apps/meteor/private/moment-locales/en-ca.js deleted file mode 100644 index 9ac521f9e93c..000000000000 --- a/apps/meteor/private/moment-locales/en-ca.js +++ /dev/null @@ -1,63 +0,0 @@ -//! moment.js locale configuration -//! locale : English (Canada) [en-ca] -//! author : Jonathan Abourbih : https://github.com/jonbca - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var en_ca = moment.defineLocale('en-ca', { - months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), - weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'YYYY-MM-DD', - LL : 'MMMM D, YYYY', - LLL : 'MMMM D, YYYY h:mm A', - LLLL : 'dddd, MMMM D, YYYY h:mm A' - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }, - ordinalParse: /\d{1,2}(st|nd|rd|th)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - } - }); - - return en_ca; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/en-gb.js b/apps/meteor/private/moment-locales/en-gb.js deleted file mode 100644 index 843d2e585fdb..000000000000 --- a/apps/meteor/private/moment-locales/en-gb.js +++ /dev/null @@ -1,67 +0,0 @@ -//! moment.js locale configuration -//! locale : English (United Kingdom) [en-gb] -//! author : Chris Gedrim : https://github.com/chrisgedrim - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var en_gb = moment.defineLocale('en-gb', { - months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), - weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }, - ordinalParse: /\d{1,2}(st|nd|rd|th)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return en_gb; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/en-ie.js b/apps/meteor/private/moment-locales/en-ie.js deleted file mode 100644 index e2da7b087e77..000000000000 --- a/apps/meteor/private/moment-locales/en-ie.js +++ /dev/null @@ -1,67 +0,0 @@ -//! moment.js locale configuration -//! locale : English (Ireland) [en-ie] -//! author : Chris Cartlidge : https://github.com/chriscartlidge - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var en_ie = moment.defineLocale('en-ie', { - months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), - weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD-MM-YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }, - ordinalParse: /\d{1,2}(st|nd|rd|th)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return en_ie; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/en-nz.js b/apps/meteor/private/moment-locales/en-nz.js deleted file mode 100644 index 70465e8d36e0..000000000000 --- a/apps/meteor/private/moment-locales/en-nz.js +++ /dev/null @@ -1,66 +0,0 @@ -//! moment.js locale configuration -//! locale : English (New Zealand) [en-nz] - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var en_nz = moment.defineLocale('en-nz', { - months : 'January_February_March_April_May_June_July_August_September_October_November_December'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec'.split('_'), - weekdays : 'Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday'.split('_'), - weekdaysShort : 'Sun_Mon_Tue_Wed_Thu_Fri_Sat'.split('_'), - weekdaysMin : 'Su_Mo_Tu_We_Th_Fr_Sa'.split('_'), - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY h:mm A', - LLLL : 'dddd, D MMMM YYYY h:mm A' - }, - calendar : { - sameDay : '[Today at] LT', - nextDay : '[Tomorrow at] LT', - nextWeek : 'dddd [at] LT', - lastDay : '[Yesterday at] LT', - lastWeek : '[Last] dddd [at] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'in %s', - past : '%s ago', - s : 'a few seconds', - m : 'a minute', - mm : '%d minutes', - h : 'an hour', - hh : '%d hours', - d : 'a day', - dd : '%d days', - M : 'a month', - MM : '%d months', - y : 'a year', - yy : '%d years' - }, - ordinalParse: /\d{1,2}(st|nd|rd|th)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return en_nz; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/eo.js b/apps/meteor/private/moment-locales/eo.js deleted file mode 100644 index 5b21f8242018..000000000000 --- a/apps/meteor/private/moment-locales/eo.js +++ /dev/null @@ -1,73 +0,0 @@ -//! moment.js locale configuration -//! locale : Esperanto [eo] -//! author : Colin Dean : https://github.com/colindean -//! komento: Mi estas malcerta se mi korekte traktis akuzativojn en tiu traduko. -//! Se ne, bonvolu korekti kaj avizi min por ke mi povas lerni! - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var eo = moment.defineLocale('eo', { - months : 'januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro'.split('_'), - monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec'.split('_'), - weekdays : 'Dimanĉo_Lundo_Mardo_Merkredo_Ĵaŭdo_Vendredo_Sabato'.split('_'), - weekdaysShort : 'Dim_Lun_Mard_Merk_Ĵaŭ_Ven_Sab'.split('_'), - weekdaysMin : 'Di_Lu_Ma_Me_Ĵa_Ve_Sa'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY-MM-DD', - LL : 'D[-an de] MMMM, YYYY', - LLL : 'D[-an de] MMMM, YYYY HH:mm', - LLLL : 'dddd, [la] D[-an de] MMMM, YYYY HH:mm' - }, - meridiemParse: /[ap]\.t\.m/i, - isPM: function (input) { - return input.charAt(0).toLowerCase() === 'p'; - }, - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'p.t.m.' : 'P.T.M.'; - } else { - return isLower ? 'a.t.m.' : 'A.T.M.'; - } - }, - calendar : { - sameDay : '[Hodiaŭ je] LT', - nextDay : '[Morgaŭ je] LT', - nextWeek : 'dddd [je] LT', - lastDay : '[Hieraŭ je] LT', - lastWeek : '[pasinta] dddd [je] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'je %s', - past : 'antaŭ %s', - s : 'sekundoj', - m : 'minuto', - mm : '%d minutoj', - h : 'horo', - hh : '%d horoj', - d : 'tago',//ne 'diurno', ĉar estas uzita por proksimumo - dd : '%d tagoj', - M : 'monato', - MM : '%d monatoj', - y : 'jaro', - yy : '%d jaroj' - }, - ordinalParse: /\d{1,2}a/, - ordinal : '%da', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return eo; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/es-do.js b/apps/meteor/private/moment-locales/es-do.js deleted file mode 100644 index 2c460534b450..000000000000 --- a/apps/meteor/private/moment-locales/es-do.js +++ /dev/null @@ -1,80 +0,0 @@ -//! moment.js locale configuration -//! locale : Spanish (Dominican Republic) [es-do] - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), - monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); - - var es_do = moment.defineLocale('es-do', { - months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), - monthsShort : function (m, format) { - if (/-MMM-/.test(format)) { - return monthsShort[m.month()]; - } else { - return monthsShortDot[m.month()]; - } - }, - monthsParseExact : true, - weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), - weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), - weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D [de] MMMM [de] YYYY', - LLL : 'D [de] MMMM [de] YYYY h:mm A', - LLLL : 'dddd, D [de] MMMM [de] YYYY h:mm A' - }, - calendar : { - sameDay : function () { - return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextDay : function () { - return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextWeek : function () { - return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastDay : function () { - return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastWeek : function () { - return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : 'en %s', - past : 'hace %s', - s : 'unos segundos', - m : 'un minuto', - mm : '%d minutos', - h : 'una hora', - hh : '%d horas', - d : 'un día', - dd : '%d días', - M : 'un mes', - MM : '%d meses', - y : 'un año', - yy : '%d años' - }, - ordinalParse : /\d{1,2}º/, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return es_do; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/es.js b/apps/meteor/private/moment-locales/es.js deleted file mode 100644 index cd819056e588..000000000000 --- a/apps/meteor/private/moment-locales/es.js +++ /dev/null @@ -1,81 +0,0 @@ -//! moment.js locale configuration -//! locale : Spanish [es] -//! author : Julio Napurí : https://github.com/julionc - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var monthsShortDot = 'ene._feb._mar._abr._may._jun._jul._ago._sep._oct._nov._dic.'.split('_'), - monthsShort = 'ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic'.split('_'); - - var es = moment.defineLocale('es', { - months : 'enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre'.split('_'), - monthsShort : function (m, format) { - if (/-MMM-/.test(format)) { - return monthsShort[m.month()]; - } else { - return monthsShortDot[m.month()]; - } - }, - monthsParseExact : true, - weekdays : 'domingo_lunes_martes_miércoles_jueves_viernes_sábado'.split('_'), - weekdaysShort : 'dom._lun._mar._mié._jue._vie._sáb.'.split('_'), - weekdaysMin : 'do_lu_ma_mi_ju_vi_sá'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D [de] MMMM [de] YYYY', - LLL : 'D [de] MMMM [de] YYYY H:mm', - LLLL : 'dddd, D [de] MMMM [de] YYYY H:mm' - }, - calendar : { - sameDay : function () { - return '[hoy a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextDay : function () { - return '[mañana a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - nextWeek : function () { - return 'dddd [a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastDay : function () { - return '[ayer a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - lastWeek : function () { - return '[el] dddd [pasado a la' + ((this.hours() !== 1) ? 's' : '') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : 'en %s', - past : 'hace %s', - s : 'unos segundos', - m : 'un minuto', - mm : '%d minutos', - h : 'una hora', - hh : '%d horas', - d : 'un día', - dd : '%d días', - M : 'un mes', - MM : '%d meses', - y : 'un año', - yy : '%d años' - }, - ordinalParse : /\d{1,2}º/, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return es; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/et.js b/apps/meteor/private/moment-locales/et.js deleted file mode 100644 index 97fd945add4d..000000000000 --- a/apps/meteor/private/moment-locales/et.js +++ /dev/null @@ -1,80 +0,0 @@ -//! moment.js locale configuration -//! locale : Estonian [et] -//! author : Henry Kehlmann : https://github.com/madhenry -//! improvements : Illimar Tambek : https://github.com/ragulka - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 's' : ['mõne sekundi', 'mõni sekund', 'paar sekundit'], - 'm' : ['ühe minuti', 'üks minut'], - 'mm': [number + ' minuti', number + ' minutit'], - 'h' : ['ühe tunni', 'tund aega', 'üks tund'], - 'hh': [number + ' tunni', number + ' tundi'], - 'd' : ['ühe päeva', 'üks päev'], - 'M' : ['kuu aja', 'kuu aega', 'üks kuu'], - 'MM': [number + ' kuu', number + ' kuud'], - 'y' : ['ühe aasta', 'aasta', 'üks aasta'], - 'yy': [number + ' aasta', number + ' aastat'] - }; - if (withoutSuffix) { - return format[key][2] ? format[key][2] : format[key][1]; - } - return isFuture ? format[key][0] : format[key][1]; - } - - var et = moment.defineLocale('et', { - months : 'jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember'.split('_'), - monthsShort : 'jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets'.split('_'), - weekdays : 'pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev'.split('_'), - weekdaysShort : 'P_E_T_K_N_R_L'.split('_'), - weekdaysMin : 'P_E_T_K_N_R_L'.split('_'), - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY H:mm', - LLLL : 'dddd, D. MMMM YYYY H:mm' - }, - calendar : { - sameDay : '[Täna,] LT', - nextDay : '[Homme,] LT', - nextWeek : '[Järgmine] dddd LT', - lastDay : '[Eile,] LT', - lastWeek : '[Eelmine] dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s pärast', - past : '%s tagasi', - s : processRelativeTime, - m : processRelativeTime, - mm : processRelativeTime, - h : processRelativeTime, - hh : processRelativeTime, - d : processRelativeTime, - dd : '%d päeva', - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return et; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/eu.js b/apps/meteor/private/moment-locales/eu.js deleted file mode 100644 index 15d7dd3e6859..000000000000 --- a/apps/meteor/private/moment-locales/eu.js +++ /dev/null @@ -1,66 +0,0 @@ -//! moment.js locale configuration -//! locale : Basque [eu] -//! author : Eneko Illarramendi : https://github.com/eillarra - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var eu = moment.defineLocale('eu', { - months : 'urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua'.split('_'), - monthsShort : 'urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.'.split('_'), - monthsParseExact : true, - weekdays : 'igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata'.split('_'), - weekdaysShort : 'ig._al._ar._az._og._ol._lr.'.split('_'), - weekdaysMin : 'ig_al_ar_az_og_ol_lr'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY-MM-DD', - LL : 'YYYY[ko] MMMM[ren] D[a]', - LLL : 'YYYY[ko] MMMM[ren] D[a] HH:mm', - LLLL : 'dddd, YYYY[ko] MMMM[ren] D[a] HH:mm', - l : 'YYYY-M-D', - ll : 'YYYY[ko] MMM D[a]', - lll : 'YYYY[ko] MMM D[a] HH:mm', - llll : 'ddd, YYYY[ko] MMM D[a] HH:mm' - }, - calendar : { - sameDay : '[gaur] LT[etan]', - nextDay : '[bihar] LT[etan]', - nextWeek : 'dddd LT[etan]', - lastDay : '[atzo] LT[etan]', - lastWeek : '[aurreko] dddd LT[etan]', - sameElse : 'L' - }, - relativeTime : { - future : '%s barru', - past : 'duela %s', - s : 'segundo batzuk', - m : 'minutu bat', - mm : '%d minutu', - h : 'ordu bat', - hh : '%d ordu', - d : 'egun bat', - dd : '%d egun', - M : 'hilabete bat', - MM : '%d hilabete', - y : 'urte bat', - yy : '%d urte' - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return eu; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/fa.js b/apps/meteor/private/moment-locales/fa.js deleted file mode 100644 index 535174bebbd1..000000000000 --- a/apps/meteor/private/moment-locales/fa.js +++ /dev/null @@ -1,106 +0,0 @@ -//! moment.js locale configuration -//! locale : Persian [fa] -//! author : Ebrahim Byagowi : https://github.com/ebraminio - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var symbolMap = { - '1': '۱', - '2': '۲', - '3': '۳', - '4': '۴', - '5': '۵', - '6': '۶', - '7': '۷', - '8': '۸', - '9': '۹', - '0': '۰' - }, numberMap = { - '۱': '1', - '۲': '2', - '۳': '3', - '۴': '4', - '۵': '5', - '۶': '6', - '۷': '7', - '۸': '8', - '۹': '9', - '۰': '0' - }; - - var fa = moment.defineLocale('fa', { - months : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), - monthsShort : 'ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر'.split('_'), - weekdays : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'), - weekdaysShort : 'یک\u200cشنبه_دوشنبه_سه\u200cشنبه_چهارشنبه_پنج\u200cشنبه_جمعه_شنبه'.split('_'), - weekdaysMin : 'ی_د_س_چ_پ_ج_ش'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - meridiemParse: /قبل از ظهر|بعد از ظهر/, - isPM: function (input) { - return /بعد از ظهر/.test(input); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'قبل از ظهر'; - } else { - return 'بعد از ظهر'; - } - }, - calendar : { - sameDay : '[امروز ساعت] LT', - nextDay : '[فردا ساعت] LT', - nextWeek : 'dddd [ساعت] LT', - lastDay : '[دیروز ساعت] LT', - lastWeek : 'dddd [پیش] [ساعت] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'در %s', - past : '%s پیش', - s : 'چندین ثانیه', - m : 'یک دقیقه', - mm : '%d دقیقه', - h : 'یک ساعت', - hh : '%d ساعت', - d : 'یک روز', - dd : '%d روز', - M : 'یک ماه', - MM : '%d ماه', - y : 'یک سال', - yy : '%d سال' - }, - preparse: function (string) { - return string.replace(/[۰-۹]/g, function (match) { - return numberMap[match]; - }).replace(/،/g, ','); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }).replace(/,/g, '،'); - }, - ordinalParse: /\d{1,2}م/, - ordinal : '%dم', - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); - - return fa; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/fi.js b/apps/meteor/private/moment-locales/fi.js deleted file mode 100644 index ee93848c7d45..000000000000 --- a/apps/meteor/private/moment-locales/fi.js +++ /dev/null @@ -1,107 +0,0 @@ -//! moment.js locale configuration -//! locale : Finnish [fi] -//! author : Tarmo Aidantausta : https://github.com/bleadof - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var numbersPast = 'nolla yksi kaksi kolme neljä viisi kuusi seitsemän kahdeksan yhdeksän'.split(' '), - numbersFuture = [ - 'nolla', 'yhden', 'kahden', 'kolmen', 'neljän', 'viiden', 'kuuden', - numbersPast[7], numbersPast[8], numbersPast[9] - ]; - function translate(number, withoutSuffix, key, isFuture) { - var result = ''; - switch (key) { - case 's': - return isFuture ? 'muutaman sekunnin' : 'muutama sekunti'; - case 'm': - return isFuture ? 'minuutin' : 'minuutti'; - case 'mm': - result = isFuture ? 'minuutin' : 'minuuttia'; - break; - case 'h': - return isFuture ? 'tunnin' : 'tunti'; - case 'hh': - result = isFuture ? 'tunnin' : 'tuntia'; - break; - case 'd': - return isFuture ? 'päivän' : 'päivä'; - case 'dd': - result = isFuture ? 'päivän' : 'päivää'; - break; - case 'M': - return isFuture ? 'kuukauden' : 'kuukausi'; - case 'MM': - result = isFuture ? 'kuukauden' : 'kuukautta'; - break; - case 'y': - return isFuture ? 'vuoden' : 'vuosi'; - case 'yy': - result = isFuture ? 'vuoden' : 'vuotta'; - break; - } - result = verbalNumber(number, isFuture) + ' ' + result; - return result; - } - function verbalNumber(number, isFuture) { - return number < 10 ? (isFuture ? numbersFuture[number] : numbersPast[number]) : number; - } - - var fi = moment.defineLocale('fi', { - months : 'tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu'.split('_'), - monthsShort : 'tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu'.split('_'), - weekdays : 'sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai'.split('_'), - weekdaysShort : 'su_ma_ti_ke_to_pe_la'.split('_'), - weekdaysMin : 'su_ma_ti_ke_to_pe_la'.split('_'), - longDateFormat : { - LT : 'HH.mm', - LTS : 'HH.mm.ss', - L : 'DD.MM.YYYY', - LL : 'Do MMMM[ta] YYYY', - LLL : 'Do MMMM[ta] YYYY, [klo] HH.mm', - LLLL : 'dddd, Do MMMM[ta] YYYY, [klo] HH.mm', - l : 'D.M.YYYY', - ll : 'Do MMM YYYY', - lll : 'Do MMM YYYY, [klo] HH.mm', - llll : 'ddd, Do MMM YYYY, [klo] HH.mm' - }, - calendar : { - sameDay : '[tänään] [klo] LT', - nextDay : '[huomenna] [klo] LT', - nextWeek : 'dddd [klo] LT', - lastDay : '[eilen] [klo] LT', - lastWeek : '[viime] dddd[na] [klo] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s päästä', - past : '%s sitten', - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return fi; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/fo.js b/apps/meteor/private/moment-locales/fo.js deleted file mode 100644 index 93567e447091..000000000000 --- a/apps/meteor/private/moment-locales/fo.js +++ /dev/null @@ -1,60 +0,0 @@ -//! moment.js locale configuration -//! locale : Faroese [fo] -//! author : Ragnar Johannesen : https://github.com/ragnar123 - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var fo = moment.defineLocale('fo', { - months : 'januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember'.split('_'), - monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), - weekdays : 'sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur'.split('_'), - weekdaysShort : 'sun_mán_týs_mik_hós_frí_ley'.split('_'), - weekdaysMin : 'su_má_tý_mi_hó_fr_le'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D. MMMM, YYYY HH:mm' - }, - calendar : { - sameDay : '[Í dag kl.] LT', - nextDay : '[Í morgin kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[Í gjár kl.] LT', - lastWeek : '[síðstu] dddd [kl] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'um %s', - past : '%s síðani', - s : 'fá sekund', - m : 'ein minutt', - mm : '%d minuttir', - h : 'ein tími', - hh : '%d tímar', - d : 'ein dagur', - dd : '%d dagar', - M : 'ein mánaði', - MM : '%d mánaðir', - y : 'eitt ár', - yy : '%d ár' - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return fo; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/fr-ca.js b/apps/meteor/private/moment-locales/fr-ca.js deleted file mode 100644 index 6ec487bd4a7c..000000000000 --- a/apps/meteor/private/moment-locales/fr-ca.js +++ /dev/null @@ -1,60 +0,0 @@ -//! moment.js locale configuration -//! locale : French (Canada) [fr-ca] -//! author : Jonathan Abourbih : https://github.com/jonbca - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var fr_ca = moment.defineLocale('fr-ca', { - months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), - monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), - monthsParseExact : true, - weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), - weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), - weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY-MM-DD', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[Aujourd\'hui à] LT', - nextDay: '[Demain à] LT', - nextWeek: 'dddd [à] LT', - lastDay: '[Hier à] LT', - lastWeek: 'dddd [dernier à] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'dans %s', - past : 'il y a %s', - s : 'quelques secondes', - m : 'une minute', - mm : '%d minutes', - h : 'une heure', - hh : '%d heures', - d : 'un jour', - dd : '%d jours', - M : 'un mois', - MM : '%d mois', - y : 'un an', - yy : '%d ans' - }, - ordinalParse: /\d{1,2}(er|e)/, - ordinal : function (number) { - return number + (number === 1 ? 'er' : 'e'); - } - }); - - return fr_ca; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/fr-ch.js b/apps/meteor/private/moment-locales/fr-ch.js deleted file mode 100644 index 5a31996a9ad3..000000000000 --- a/apps/meteor/private/moment-locales/fr-ch.js +++ /dev/null @@ -1,64 +0,0 @@ -//! moment.js locale configuration -//! locale : French (Switzerland) [fr-ch] -//! author : Gaspard Bucher : https://github.com/gaspard - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var fr_ch = moment.defineLocale('fr-ch', { - months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), - monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), - monthsParseExact : true, - weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), - weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), - weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[Aujourd\'hui à] LT', - nextDay: '[Demain à] LT', - nextWeek: 'dddd [à] LT', - lastDay: '[Hier à] LT', - lastWeek: 'dddd [dernier à] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'dans %s', - past : 'il y a %s', - s : 'quelques secondes', - m : 'une minute', - mm : '%d minutes', - h : 'une heure', - hh : '%d heures', - d : 'un jour', - dd : '%d jours', - M : 'un mois', - MM : '%d mois', - y : 'un an', - yy : '%d ans' - }, - ordinalParse: /\d{1,2}(er|e)/, - ordinal : function (number) { - return number + (number === 1 ? 'er' : 'e'); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return fr_ch; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/fr.js b/apps/meteor/private/moment-locales/fr.js deleted file mode 100644 index 90662e2cc8d1..000000000000 --- a/apps/meteor/private/moment-locales/fr.js +++ /dev/null @@ -1,64 +0,0 @@ -//! moment.js locale configuration -//! locale : French [fr] -//! author : John Fischer : https://github.com/jfroffice - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var fr = moment.defineLocale('fr', { - months : 'janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre'.split('_'), - monthsShort : 'janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.'.split('_'), - monthsParseExact : true, - weekdays : 'dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi'.split('_'), - weekdaysShort : 'dim._lun._mar._mer._jeu._ven._sam.'.split('_'), - weekdaysMin : 'Di_Lu_Ma_Me_Je_Ve_Sa'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[Aujourd\'hui à] LT', - nextDay: '[Demain à] LT', - nextWeek: 'dddd [à] LT', - lastDay: '[Hier à] LT', - lastWeek: 'dddd [dernier à] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'dans %s', - past : 'il y a %s', - s : 'quelques secondes', - m : 'une minute', - mm : '%d minutes', - h : 'une heure', - hh : '%d heures', - d : 'un jour', - dd : '%d jours', - M : 'un mois', - MM : '%d mois', - y : 'un an', - yy : '%d ans' - }, - ordinalParse: /\d{1,2}(er|)/, - ordinal : function (number) { - return number + (number === 1 ? 'er' : ''); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return fr; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/fy.js b/apps/meteor/private/moment-locales/fy.js deleted file mode 100644 index dc04ade7e458..000000000000 --- a/apps/meteor/private/moment-locales/fy.js +++ /dev/null @@ -1,73 +0,0 @@ -//! moment.js locale configuration -//! locale : Frisian [fy] -//! author : Robin van der Vliet : https://github.com/robin0van0der0v - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var monthsShortWithDots = 'jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.'.split('_'), - monthsShortWithoutDots = 'jan_feb_mrt_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'); - - var fy = moment.defineLocale('fy', { - months : 'jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber'.split('_'), - monthsShort : function (m, format) { - if (/-MMM-/.test(format)) { - return monthsShortWithoutDots[m.month()]; - } else { - return monthsShortWithDots[m.month()]; - } - }, - monthsParseExact : true, - weekdays : 'snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon'.split('_'), - weekdaysShort : 'si._mo._ti._wo._to._fr._so.'.split('_'), - weekdaysMin : 'Si_Mo_Ti_Wo_To_Fr_So'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD-MM-YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[hjoed om] LT', - nextDay: '[moarn om] LT', - nextWeek: 'dddd [om] LT', - lastDay: '[juster om] LT', - lastWeek: '[ôfrûne] dddd [om] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'oer %s', - past : '%s lyn', - s : 'in pear sekonden', - m : 'ien minút', - mm : '%d minuten', - h : 'ien oere', - hh : '%d oeren', - d : 'ien dei', - dd : '%d dagen', - M : 'ien moanne', - MM : '%d moannen', - y : 'ien jier', - yy : '%d jierren' - }, - ordinalParse: /\d{1,2}(ste|de)/, - ordinal : function (number) { - return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return fy; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/gd.js b/apps/meteor/private/moment-locales/gd.js deleted file mode 100644 index 901cd596d65a..000000000000 --- a/apps/meteor/private/moment-locales/gd.js +++ /dev/null @@ -1,76 +0,0 @@ -//! moment.js locale configuration -//! locale : Scottish Gaelic [gd] -//! author : Jon Ashdown : https://github.com/jonashdown - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var months = [ - 'Am Faoilleach', 'An Gearran', 'Am Màrt', 'An Giblean', 'An Cèitean', 'An t-Ògmhios', 'An t-Iuchar', 'An Lùnastal', 'An t-Sultain', 'An Dàmhair', 'An t-Samhain', 'An Dùbhlachd' - ]; - - var monthsShort = ['Faoi', 'Gear', 'Màrt', 'Gibl', 'Cèit', 'Ògmh', 'Iuch', 'Lùn', 'Sult', 'Dàmh', 'Samh', 'Dùbh']; - - var weekdays = ['Didòmhnaich', 'Diluain', 'Dimàirt', 'Diciadain', 'Diardaoin', 'Dihaoine', 'Disathairne']; - - var weekdaysShort = ['Did', 'Dil', 'Dim', 'Dic', 'Dia', 'Dih', 'Dis']; - - var weekdaysMin = ['Dò', 'Lu', 'Mà', 'Ci', 'Ar', 'Ha', 'Sa']; - - var gd = moment.defineLocale('gd', { - months : months, - monthsShort : monthsShort, - monthsParseExact : true, - weekdays : weekdays, - weekdaysShort : weekdaysShort, - weekdaysMin : weekdaysMin, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[An-diugh aig] LT', - nextDay : '[A-màireach aig] LT', - nextWeek : 'dddd [aig] LT', - lastDay : '[An-dè aig] LT', - lastWeek : 'dddd [seo chaidh] [aig] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'ann an %s', - past : 'bho chionn %s', - s : 'beagan diogan', - m : 'mionaid', - mm : '%d mionaidean', - h : 'uair', - hh : '%d uairean', - d : 'latha', - dd : '%d latha', - M : 'mìos', - MM : '%d mìosan', - y : 'bliadhna', - yy : '%d bliadhna' - }, - ordinalParse : /\d{1,2}(d|na|mh)/, - ordinal : function (number) { - var output = number === 1 ? 'd' : number % 10 === 2 ? 'na' : 'mh'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return gd; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/gl.js b/apps/meteor/private/moment-locales/gl.js deleted file mode 100644 index 9fdc236ae055..000000000000 --- a/apps/meteor/private/moment-locales/gl.js +++ /dev/null @@ -1,77 +0,0 @@ -//! moment.js locale configuration -//! locale : Galician [gl] -//! author : Juan G. Hurtado : https://github.com/juanghurtado - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var gl = moment.defineLocale('gl', { - months : 'Xaneiro_Febreiro_Marzo_Abril_Maio_Xuño_Xullo_Agosto_Setembro_Outubro_Novembro_Decembro'.split('_'), - monthsShort : 'Xan._Feb._Mar._Abr._Mai._Xuñ._Xul._Ago._Set._Out._Nov._Dec.'.split('_'), - monthsParseExact: true, - weekdays : 'Domingo_Luns_Martes_Mércores_Xoves_Venres_Sábado'.split('_'), - weekdaysShort : 'Dom._Lun._Mar._Mér._Xov._Ven._Sáb.'.split('_'), - weekdaysMin : 'Do_Lu_Ma_Mé_Xo_Ve_Sá'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY H:mm', - LLLL : 'dddd D MMMM YYYY H:mm' - }, - calendar : { - sameDay : function () { - return '[hoxe ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT'; - }, - nextDay : function () { - return '[mañá ' + ((this.hours() !== 1) ? 'ás' : 'á') + '] LT'; - }, - nextWeek : function () { - return 'dddd [' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT'; - }, - lastDay : function () { - return '[onte ' + ((this.hours() !== 1) ? 'á' : 'a') + '] LT'; - }, - lastWeek : function () { - return '[o] dddd [pasado ' + ((this.hours() !== 1) ? 'ás' : 'a') + '] LT'; - }, - sameElse : 'L' - }, - relativeTime : { - future : function (str) { - if (str === 'uns segundos') { - return 'nuns segundos'; - } - return 'en ' + str; - }, - past : 'hai %s', - s : 'uns segundos', - m : 'un minuto', - mm : '%d minutos', - h : 'unha hora', - hh : '%d horas', - d : 'un día', - dd : '%d días', - M : 'un mes', - MM : '%d meses', - y : 'un ano', - yy : '%d anos' - }, - ordinalParse : /\d{1,2}º/, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return gl; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/he.js b/apps/meteor/private/moment-locales/he.js deleted file mode 100644 index 6e55a7a24397..000000000000 --- a/apps/meteor/private/moment-locales/he.js +++ /dev/null @@ -1,99 +0,0 @@ -//! moment.js locale configuration -//! locale : Hebrew [he] -//! author : Tomer Cohen : https://github.com/tomer -//! author : Moshe Simantov : https://github.com/DevelopmentIL -//! author : Tal Ater : https://github.com/TalAter - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var he = moment.defineLocale('he', { - months : 'ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר'.split('_'), - monthsShort : 'ינו׳_פבר׳_מרץ_אפר׳_מאי_יוני_יולי_אוג׳_ספט׳_אוק׳_נוב׳_דצמ׳'.split('_'), - weekdays : 'ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת'.split('_'), - weekdaysShort : 'א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳'.split('_'), - weekdaysMin : 'א_ב_ג_ד_ה_ו_ש'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D [ב]MMMM YYYY', - LLL : 'D [ב]MMMM YYYY HH:mm', - LLLL : 'dddd, D [ב]MMMM YYYY HH:mm', - l : 'D/M/YYYY', - ll : 'D MMM YYYY', - lll : 'D MMM YYYY HH:mm', - llll : 'ddd, D MMM YYYY HH:mm' - }, - calendar : { - sameDay : '[היום ב־]LT', - nextDay : '[מחר ב־]LT', - nextWeek : 'dddd [בשעה] LT', - lastDay : '[אתמול ב־]LT', - lastWeek : '[ביום] dddd [האחרון בשעה] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'בעוד %s', - past : 'לפני %s', - s : 'מספר שניות', - m : 'דקה', - mm : '%d דקות', - h : 'שעה', - hh : function (number) { - if (number === 2) { - return 'שעתיים'; - } - return number + ' שעות'; - }, - d : 'יום', - dd : function (number) { - if (number === 2) { - return 'יומיים'; - } - return number + ' ימים'; - }, - M : 'חודש', - MM : function (number) { - if (number === 2) { - return 'חודשיים'; - } - return number + ' חודשים'; - }, - y : 'שנה', - yy : function (number) { - if (number === 2) { - return 'שנתיים'; - } else if (number % 10 === 0 && number !== 10) { - return number + ' שנה'; - } - return number + ' שנים'; - } - }, - meridiemParse: /אחה"צ|לפנה"צ|אחרי הצהריים|לפני הצהריים|לפנות בוקר|בבוקר|בערב/i, - isPM : function (input) { - return /^(אחה"צ|אחרי הצהריים|בערב)$/.test(input); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 5) { - return 'לפנות בוקר'; - } else if (hour < 10) { - return 'בבוקר'; - } else if (hour < 12) { - return isLower ? 'לפנה"צ' : 'לפני הצהריים'; - } else if (hour < 18) { - return isLower ? 'אחה"צ' : 'אחרי הצהריים'; - } else { - return 'בערב'; - } - } - }); - - return he; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/hi.js b/apps/meteor/private/moment-locales/hi.js deleted file mode 100644 index fc597712e267..000000000000 --- a/apps/meteor/private/moment-locales/hi.js +++ /dev/null @@ -1,124 +0,0 @@ -//! moment.js locale configuration -//! locale : Hindi [hi] -//! author : Mayank Singhal : https://github.com/mayanksinghal - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - var hi = moment.defineLocale('hi', { - months : 'जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर'.split('_'), - monthsShort : 'जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.'.split('_'), - monthsParseExact: true, - weekdays : 'रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'), - weekdaysShort : 'रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि'.split('_'), - weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'), - longDateFormat : { - LT : 'A h:mm बजे', - LTS : 'A h:mm:ss बजे', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm बजे', - LLLL : 'dddd, D MMMM YYYY, A h:mm बजे' - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[कल] LT', - nextWeek : 'dddd, LT', - lastDay : '[कल] LT', - lastWeek : '[पिछले] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s में', - past : '%s पहले', - s : 'कुछ ही क्षण', - m : 'एक मिनट', - mm : '%d मिनट', - h : 'एक घंटा', - hh : '%d घंटे', - d : 'एक दिन', - dd : '%d दिन', - M : 'एक महीने', - MM : '%d महीने', - y : 'एक वर्ष', - yy : '%d वर्ष' - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - // Hindi notation for meridiems are quite fuzzy in practice. While there exists - // a rigid notion of a 'Pahar' it is not used as rigidly in modern Hindi. - meridiemParse: /रात|सुबह|दोपहर|शाम/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'रात') { - return hour < 4 ? hour : hour + 12; - } else if (meridiem === 'सुबह') { - return hour; - } else if (meridiem === 'दोपहर') { - return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'शाम') { - return hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'रात'; - } else if (hour < 10) { - return 'सुबह'; - } else if (hour < 17) { - return 'दोपहर'; - } else if (hour < 20) { - return 'शाम'; - } else { - return 'रात'; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); - - return hi; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/hr.js b/apps/meteor/private/moment-locales/hr.js deleted file mode 100644 index 70fdf51776df..000000000000 --- a/apps/meteor/private/moment-locales/hr.js +++ /dev/null @@ -1,145 +0,0 @@ -//! moment.js locale configuration -//! locale : Croatian [hr] -//! author : Bojan Marković : https://github.com/bmarkovic - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - function translate(number, withoutSuffix, key) { - var result = number + ' '; - switch (key) { - case 'm': - return withoutSuffix ? 'jedna minuta' : 'jedne minute'; - case 'mm': - if (number === 1) { - result += 'minuta'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'minute'; - } else { - result += 'minuta'; - } - return result; - case 'h': - return withoutSuffix ? 'jedan sat' : 'jednog sata'; - case 'hh': - if (number === 1) { - result += 'sat'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'sata'; - } else { - result += 'sati'; - } - return result; - case 'dd': - if (number === 1) { - result += 'dan'; - } else { - result += 'dana'; - } - return result; - case 'MM': - if (number === 1) { - result += 'mjesec'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'mjeseca'; - } else { - result += 'mjeseci'; - } - return result; - case 'yy': - if (number === 1) { - result += 'godina'; - } else if (number === 2 || number === 3 || number === 4) { - result += 'godine'; - } else { - result += 'godina'; - } - return result; - } - } - - var hr = moment.defineLocale('hr', { - months : { - format: 'siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca'.split('_'), - standalone: 'siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac'.split('_') - }, - monthsShort : 'sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.'.split('_'), - monthsParseExact: true, - weekdays : 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), - weekdaysShort : 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), - weekdaysMin : 'ne_po_ut_sr_če_pe_su'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD. MM. YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY H:mm', - LLLL : 'dddd, D. MMMM YYYY H:mm' - }, - calendar : { - sameDay : '[danas u] LT', - nextDay : '[sutra u] LT', - nextWeek : function () { - switch (this.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[jučer u] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - return '[prošlu] dddd [u] LT'; - case 6: - return '[prošle] [subote] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prošli] dddd [u] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : 'za %s', - past : 'prije %s', - s : 'par sekundi', - m : translate, - mm : translate, - h : translate, - hh : translate, - d : 'dan', - dd : translate, - M : 'mjesec', - MM : translate, - y : 'godinu', - yy : translate - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return hr; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/hu.js b/apps/meteor/private/moment-locales/hu.js deleted file mode 100644 index 85fc38125ad3..000000000000 --- a/apps/meteor/private/moment-locales/hu.js +++ /dev/null @@ -1,108 +0,0 @@ -//! moment.js locale configuration -//! locale : Hungarian [hu] -//! author : Adam Brunner : https://github.com/adambrunner - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var weekEndings = 'vasárnap hétfőn kedden szerdán csütörtökön pénteken szombaton'.split(' '); - function translate(number, withoutSuffix, key, isFuture) { - var num = number; - switch (key) { - case 's': - return (isFuture || withoutSuffix) ? 'néhány másodperc' : 'néhány másodperce'; - case 'm': - return 'egy' + (isFuture || withoutSuffix ? ' perc' : ' perce'); - case 'mm': - return num + (isFuture || withoutSuffix ? ' perc' : ' perce'); - case 'h': - return 'egy' + (isFuture || withoutSuffix ? ' óra' : ' órája'); - case 'hh': - return num + (isFuture || withoutSuffix ? ' óra' : ' órája'); - case 'd': - return 'egy' + (isFuture || withoutSuffix ? ' nap' : ' napja'); - case 'dd': - return num + (isFuture || withoutSuffix ? ' nap' : ' napja'); - case 'M': - return 'egy' + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); - case 'MM': - return num + (isFuture || withoutSuffix ? ' hónap' : ' hónapja'); - case 'y': - return 'egy' + (isFuture || withoutSuffix ? ' év' : ' éve'); - case 'yy': - return num + (isFuture || withoutSuffix ? ' év' : ' éve'); - } - return ''; - } - function week(isFuture) { - return (isFuture ? '' : '[múlt] ') + '[' + weekEndings[this.day()] + '] LT[-kor]'; - } - - var hu = moment.defineLocale('hu', { - months : 'január_február_március_április_május_június_július_augusztus_szeptember_október_november_december'.split('_'), - monthsShort : 'jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec'.split('_'), - weekdays : 'vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat'.split('_'), - weekdaysShort : 'vas_hét_kedd_sze_csüt_pén_szo'.split('_'), - weekdaysMin : 'v_h_k_sze_cs_p_szo'.split('_'), - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'YYYY.MM.DD.', - LL : 'YYYY. MMMM D.', - LLL : 'YYYY. MMMM D. H:mm', - LLLL : 'YYYY. MMMM D., dddd H:mm' - }, - meridiemParse: /de|du/i, - isPM: function (input) { - return input.charAt(1).toLowerCase() === 'u'; - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 12) { - return isLower === true ? 'de' : 'DE'; - } else { - return isLower === true ? 'du' : 'DU'; - } - }, - calendar : { - sameDay : '[ma] LT[-kor]', - nextDay : '[holnap] LT[-kor]', - nextWeek : function () { - return week.call(this, true); - }, - lastDay : '[tegnap] LT[-kor]', - lastWeek : function () { - return week.call(this, false); - }, - sameElse : 'L' - }, - relativeTime : { - future : '%s múlva', - past : '%s', - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return hu; - -})); diff --git a/apps/meteor/private/moment-locales/hy-am.js b/apps/meteor/private/moment-locales/hy-am.js deleted file mode 100644 index 8b262005f03c..000000000000 --- a/apps/meteor/private/moment-locales/hy-am.js +++ /dev/null @@ -1,95 +0,0 @@ -//! moment.js locale configuration -//! locale : Armenian [hy-am] -//! author : Armendarabyan : https://github.com/armendarabyan - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var hy_am = moment.defineLocale('hy-am', { - months : { - format: 'հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի'.split('_'), - standalone: 'հունվար_փետրվար_մարտ_ապրիլ_մայիս_հունիս_հուլիս_օգոստոս_սեպտեմբեր_հոկտեմբեր_նոյեմբեր_դեկտեմբեր'.split('_') - }, - monthsShort : 'հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ'.split('_'), - weekdays : 'կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ'.split('_'), - weekdaysShort : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), - weekdaysMin : 'կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY թ.', - LLL : 'D MMMM YYYY թ., HH:mm', - LLLL : 'dddd, D MMMM YYYY թ., HH:mm' - }, - calendar : { - sameDay: '[այսօր] LT', - nextDay: '[վաղը] LT', - lastDay: '[երեկ] LT', - nextWeek: function () { - return 'dddd [օրը ժամը] LT'; - }, - lastWeek: function () { - return '[անցած] dddd [օրը ժամը] LT'; - }, - sameElse: 'L' - }, - relativeTime : { - future : '%s հետո', - past : '%s առաջ', - s : 'մի քանի վայրկյան', - m : 'րոպե', - mm : '%d րոպե', - h : 'ժամ', - hh : '%d ժամ', - d : 'օր', - dd : '%d օր', - M : 'ամիս', - MM : '%d ամիս', - y : 'տարի', - yy : '%d տարի' - }, - meridiemParse: /գիշերվա|առավոտվա|ցերեկվա|երեկոյան/, - isPM: function (input) { - return /^(ցերեկվա|երեկոյան)$/.test(input); - }, - meridiem : function (hour) { - if (hour < 4) { - return 'գիշերվա'; - } else if (hour < 12) { - return 'առավոտվա'; - } else if (hour < 17) { - return 'ցերեկվա'; - } else { - return 'երեկոյան'; - } - }, - ordinalParse: /\d{1,2}|\d{1,2}-(ին|րդ)/, - ordinal: function (number, period) { - switch (period) { - case 'DDD': - case 'w': - case 'W': - case 'DDDo': - if (number === 1) { - return number + '-ին'; - } - return number + '-րդ'; - default: - return number; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return hy_am; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/id.js b/apps/meteor/private/moment-locales/id.js deleted file mode 100644 index 16dff2f1b5c0..000000000000 --- a/apps/meteor/private/moment-locales/id.js +++ /dev/null @@ -1,83 +0,0 @@ -//! moment.js locale configuration -//! locale : Indonesian [id] -//! author : Mohammad Satrio Utomo : https://github.com/tyok -//! reference: http://id.wikisource.org/wiki/Pedoman_Umum_Ejaan_Bahasa_Indonesia_yang_Disempurnakan - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var id = moment.defineLocale('id', { - months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nov_Des'.split('_'), - weekdays : 'Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu'.split('_'), - weekdaysShort : 'Min_Sen_Sel_Rab_Kam_Jum_Sab'.split('_'), - weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sb'.split('_'), - longDateFormat : { - LT : 'HH.mm', - LTS : 'HH.mm.ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY [pukul] HH.mm', - LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm' - }, - meridiemParse: /pagi|siang|sore|malam/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'pagi') { - return hour; - } else if (meridiem === 'siang') { - return hour >= 11 ? hour : hour + 12; - } else if (meridiem === 'sore' || meridiem === 'malam') { - return hour + 12; - } - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'pagi'; - } else if (hours < 15) { - return 'siang'; - } else if (hours < 19) { - return 'sore'; - } else { - return 'malam'; - } - }, - calendar : { - sameDay : '[Hari ini pukul] LT', - nextDay : '[Besok pukul] LT', - nextWeek : 'dddd [pukul] LT', - lastDay : '[Kemarin pukul] LT', - lastWeek : 'dddd [lalu pukul] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'dalam %s', - past : '%s yang lalu', - s : 'beberapa detik', - m : 'semenit', - mm : '%d menit', - h : 'sejam', - hh : '%d jam', - d : 'sehari', - dd : '%d hari', - M : 'sebulan', - MM : '%d bulan', - y : 'setahun', - yy : '%d tahun' - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return id; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/is.js b/apps/meteor/private/moment-locales/is.js deleted file mode 100644 index 810fee617390..000000000000 --- a/apps/meteor/private/moment-locales/is.js +++ /dev/null @@ -1,127 +0,0 @@ -//! moment.js locale configuration -//! locale : Icelandic [is] -//! author : Hinrik Örn Sigurðsson : https://github.com/hinrik - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - function plural(n) { - if (n % 100 === 11) { - return true; - } else if (n % 10 === 1) { - return false; - } - return true; - } - function translate(number, withoutSuffix, key, isFuture) { - var result = number + ' '; - switch (key) { - case 's': - return withoutSuffix || isFuture ? 'nokkrar sekúndur' : 'nokkrum sekúndum'; - case 'm': - return withoutSuffix ? 'mínúta' : 'mínútu'; - case 'mm': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'mínútur' : 'mínútum'); - } else if (withoutSuffix) { - return result + 'mínúta'; - } - return result + 'mínútu'; - case 'hh': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'klukkustundir' : 'klukkustundum'); - } - return result + 'klukkustund'; - case 'd': - if (withoutSuffix) { - return 'dagur'; - } - return isFuture ? 'dag' : 'degi'; - case 'dd': - if (plural(number)) { - if (withoutSuffix) { - return result + 'dagar'; - } - return result + (isFuture ? 'daga' : 'dögum'); - } else if (withoutSuffix) { - return result + 'dagur'; - } - return result + (isFuture ? 'dag' : 'degi'); - case 'M': - if (withoutSuffix) { - return 'mánuður'; - } - return isFuture ? 'mánuð' : 'mánuði'; - case 'MM': - if (plural(number)) { - if (withoutSuffix) { - return result + 'mánuðir'; - } - return result + (isFuture ? 'mánuði' : 'mánuðum'); - } else if (withoutSuffix) { - return result + 'mánuður'; - } - return result + (isFuture ? 'mánuð' : 'mánuði'); - case 'y': - return withoutSuffix || isFuture ? 'ár' : 'ári'; - case 'yy': - if (plural(number)) { - return result + (withoutSuffix || isFuture ? 'ár' : 'árum'); - } - return result + (withoutSuffix || isFuture ? 'ár' : 'ári'); - } - } - - var is = moment.defineLocale('is', { - months : 'janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember'.split('_'), - monthsShort : 'jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des'.split('_'), - weekdays : 'sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur'.split('_'), - weekdaysShort : 'sun_mán_þri_mið_fim_fös_lau'.split('_'), - weekdaysMin : 'Su_Má_Þr_Mi_Fi_Fö_La'.split('_'), - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY [kl.] H:mm', - LLLL : 'dddd, D. MMMM YYYY [kl.] H:mm' - }, - calendar : { - sameDay : '[í dag kl.] LT', - nextDay : '[á morgun kl.] LT', - nextWeek : 'dddd [kl.] LT', - lastDay : '[í gær kl.] LT', - lastWeek : '[síðasta] dddd [kl.] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'eftir %s', - past : 'fyrir %s síðan', - s : translate, - m : translate, - mm : translate, - h : 'klukkustund', - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return is; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/it.js b/apps/meteor/private/moment-locales/it.js deleted file mode 100644 index 35d44ccacd8c..000000000000 --- a/apps/meteor/private/moment-locales/it.js +++ /dev/null @@ -1,70 +0,0 @@ -//! moment.js locale configuration -//! locale : Italian [it] -//! author : Lorenzo : https://github.com/aliem -//! author: Mattia Larentis: https://github.com/nostalgiaz - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var it = moment.defineLocale('it', { - months : 'gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre'.split('_'), - monthsShort : 'gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic'.split('_'), - weekdays : 'Domenica_Lunedì_Martedì_Mercoledì_Giovedì_Venerdì_Sabato'.split('_'), - weekdaysShort : 'Dom_Lun_Mar_Mer_Gio_Ven_Sab'.split('_'), - weekdaysMin : 'Do_Lu_Ma_Me_Gi_Ve_Sa'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[Oggi alle] LT', - nextDay: '[Domani alle] LT', - nextWeek: 'dddd [alle] LT', - lastDay: '[Ieri alle] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[la scorsa] dddd [alle] LT'; - default: - return '[lo scorso] dddd [alle] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : function (s) { - return ((/^[0-9].+$/).test(s) ? 'tra' : 'in') + ' ' + s; - }, - past : '%s fa', - s : 'alcuni secondi', - m : 'un minuto', - mm : '%d minuti', - h : 'un\'ora', - hh : '%d ore', - d : 'un giorno', - dd : '%d giorni', - M : 'un mese', - MM : '%d mesi', - y : 'un anno', - yy : '%d anni' - }, - ordinalParse : /\d{1,2}º/, - ordinal: '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return it; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ja.js b/apps/meteor/private/moment-locales/ja.js deleted file mode 100644 index adea3597c2a2..000000000000 --- a/apps/meteor/private/moment-locales/ja.js +++ /dev/null @@ -1,76 +0,0 @@ -//! moment.js locale configuration -//! locale : Japanese [ja] -//! author : LI Long : https://github.com/baryon - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var ja = moment.defineLocale('ja', { - months : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), - monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), - weekdays : '日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日'.split('_'), - weekdaysShort : '日_月_火_水_木_金_土'.split('_'), - weekdaysMin : '日_月_火_水_木_金_土'.split('_'), - longDateFormat : { - LT : 'Ah時m分', - LTS : 'Ah時m分s秒', - L : 'YYYY/MM/DD', - LL : 'YYYY年M月D日', - LLL : 'YYYY年M月D日Ah時m分', - LLLL : 'YYYY年M月D日Ah時m分 dddd' - }, - meridiemParse: /午前|午後/i, - isPM : function (input) { - return input === '午後'; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return '午前'; - } else { - return '午後'; - } - }, - calendar : { - sameDay : '[今日] LT', - nextDay : '[明日] LT', - nextWeek : '[来週]dddd LT', - lastDay : '[昨日] LT', - lastWeek : '[前週]dddd LT', - sameElse : 'L' - }, - ordinalParse : /\d{1,2}日/, - ordinal : function (number, period) { - switch (period) { - case 'd': - case 'D': - case 'DDD': - return number + '日'; - default: - return number; - } - }, - relativeTime : { - future : '%s後', - past : '%s前', - s : '数秒', - m : '1分', - mm : '%d分', - h : '1時間', - hh : '%d時間', - d : '1日', - dd : '%d日', - M : '1ヶ月', - MM : '%dヶ月', - y : '1年', - yy : '%d年' - } - }); - - return ja; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/jv.js b/apps/meteor/private/moment-locales/jv.js deleted file mode 100644 index c58e0768abc5..000000000000 --- a/apps/meteor/private/moment-locales/jv.js +++ /dev/null @@ -1,83 +0,0 @@ -//! moment.js locale configuration -//! locale : Japanese [jv] -//! author : Rony Lantip : https://github.com/lantip -//! reference: http://jv.wikipedia.org/wiki/Basa_Jawa - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var jv = moment.defineLocale('jv', { - months : 'Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember'.split('_'), - monthsShort : 'Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des'.split('_'), - weekdays : 'Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu'.split('_'), - weekdaysShort : 'Min_Sen_Sel_Reb_Kem_Jem_Sep'.split('_'), - weekdaysMin : 'Mg_Sn_Sl_Rb_Km_Jm_Sp'.split('_'), - longDateFormat : { - LT : 'HH.mm', - LTS : 'HH.mm.ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY [pukul] HH.mm', - LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm' - }, - meridiemParse: /enjing|siyang|sonten|ndalu/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'enjing') { - return hour; - } else if (meridiem === 'siyang') { - return hour >= 11 ? hour : hour + 12; - } else if (meridiem === 'sonten' || meridiem === 'ndalu') { - return hour + 12; - } - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'enjing'; - } else if (hours < 15) { - return 'siyang'; - } else if (hours < 19) { - return 'sonten'; - } else { - return 'ndalu'; - } - }, - calendar : { - sameDay : '[Dinten puniko pukul] LT', - nextDay : '[Mbenjang pukul] LT', - nextWeek : 'dddd [pukul] LT', - lastDay : '[Kala wingi pukul] LT', - lastWeek : 'dddd [kepengker pukul] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'wonten ing %s', - past : '%s ingkang kepengker', - s : 'sawetawis detik', - m : 'setunggal menit', - mm : '%d menit', - h : 'setunggal jam', - hh : '%d jam', - d : 'sedinten', - dd : '%d dinten', - M : 'sewulan', - MM : '%d wulan', - y : 'setaun', - yy : '%d taun' - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return jv; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ka.js b/apps/meteor/private/moment-locales/ka.js deleted file mode 100644 index b9faf683440d..000000000000 --- a/apps/meteor/private/moment-locales/ka.js +++ /dev/null @@ -1,89 +0,0 @@ -//! moment.js locale configuration -//! locale : Georgian [ka] -//! author : Irakli Janiashvili : https://github.com/irakli-janiashvili - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var ka = moment.defineLocale('ka', { - months : { - standalone: 'იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი'.split('_'), - format: 'იანვარს_თებერვალს_მარტს_აპრილის_მაისს_ივნისს_ივლისს_აგვისტს_სექტემბერს_ოქტომბერს_ნოემბერს_დეკემბერს'.split('_') - }, - monthsShort : 'იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ'.split('_'), - weekdays : { - standalone: 'კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი'.split('_'), - format: 'კვირას_ორშაბათს_სამშაბათს_ოთხშაბათს_ხუთშაბათს_პარასკევს_შაბათს'.split('_'), - isFormat: /(წინა|შემდეგ)/ - }, - weekdaysShort : 'კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ'.split('_'), - weekdaysMin : 'კვ_ორ_სა_ოთ_ხუ_პა_შა'.split('_'), - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY h:mm A', - LLLL : 'dddd, D MMMM YYYY h:mm A' - }, - calendar : { - sameDay : '[დღეს] LT[-ზე]', - nextDay : '[ხვალ] LT[-ზე]', - lastDay : '[გუშინ] LT[-ზე]', - nextWeek : '[შემდეგ] dddd LT[-ზე]', - lastWeek : '[წინა] dddd LT-ზე', - sameElse : 'L' - }, - relativeTime : { - future : function (s) { - return (/(წამი|წუთი|საათი|წელი)/).test(s) ? - s.replace(/ი$/, 'ში') : - s + 'ში'; - }, - past : function (s) { - if ((/(წამი|წუთი|საათი|დღე|თვე)/).test(s)) { - return s.replace(/(ი|ე)$/, 'ის წინ'); - } - if ((/წელი/).test(s)) { - return s.replace(/წელი$/, 'წლის წინ'); - } - }, - s : 'რამდენიმე წამი', - m : 'წუთი', - mm : '%d წუთი', - h : 'საათი', - hh : '%d საათი', - d : 'დღე', - dd : '%d დღე', - M : 'თვე', - MM : '%d თვე', - y : 'წელი', - yy : '%d წელი' - }, - ordinalParse: /0|1-ლი|მე-\d{1,2}|\d{1,2}-ე/, - ordinal : function (number) { - if (number === 0) { - return number; - } - if (number === 1) { - return number + '-ლი'; - } - if ((number < 20) || (number <= 100 && (number % 20 === 0)) || (number % 100 === 0)) { - return 'მე-' + number; - } - return number + '-ე'; - }, - week : { - dow : 1, - doy : 7 - } - }); - - return ka; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/kk.js b/apps/meteor/private/moment-locales/kk.js deleted file mode 100644 index 270106f156b6..000000000000 --- a/apps/meteor/private/moment-locales/kk.js +++ /dev/null @@ -1,87 +0,0 @@ -//! moment.js locale configuration -//! locale : Kazakh [kk] -//! authors : Nurlan Rakhimzhanov : https://github.com/nurlan - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var suffixes = { - 0: '-ші', - 1: '-ші', - 2: '-ші', - 3: '-ші', - 4: '-ші', - 5: '-ші', - 6: '-шы', - 7: '-ші', - 8: '-ші', - 9: '-шы', - 10: '-шы', - 20: '-шы', - 30: '-шы', - 40: '-шы', - 50: '-ші', - 60: '-шы', - 70: '-ші', - 80: '-ші', - 90: '-шы', - 100: '-ші' - }; - - var kk = moment.defineLocale('kk', { - months : 'қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан'.split('_'), - monthsShort : 'қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел'.split('_'), - weekdays : 'жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі'.split('_'), - weekdaysShort : 'жек_дүй_сей_сәр_бей_жұм_сен'.split('_'), - weekdaysMin : 'жк_дй_сй_ср_бй_жм_сн'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Бүгін сағат] LT', - nextDay : '[Ертең сағат] LT', - nextWeek : 'dddd [сағат] LT', - lastDay : '[Кеше сағат] LT', - lastWeek : '[Өткен аптаның] dddd [сағат] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s ішінде', - past : '%s бұрын', - s : 'бірнеше секунд', - m : 'бір минут', - mm : '%d минут', - h : 'бір сағат', - hh : '%d сағат', - d : 'бір күн', - dd : '%d күн', - M : 'бір ай', - MM : '%d ай', - y : 'бір жыл', - yy : '%d жыл' - }, - ordinalParse: /\d{1,2}-(ші|шы)/, - ordinal : function (number) { - var a = number % 10, - b = number >= 100 ? 100 : null; - return number + (suffixes[number] || suffixes[a] || suffixes[b]); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return kk; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/km.js b/apps/meteor/private/moment-locales/km.js deleted file mode 100644 index cbfe31df795d..000000000000 --- a/apps/meteor/private/moment-locales/km.js +++ /dev/null @@ -1,58 +0,0 @@ -//! moment.js locale configuration -//! locale : Cambodian [km] -//! author : Kruy Vanna : https://github.com/kruyvanna - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var km = moment.defineLocale('km', { - months: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'), - monthsShort: 'មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ'.split('_'), - weekdays: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'), - weekdaysShort: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'), - weekdaysMin: 'អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍'.split('_'), - longDateFormat: { - LT: 'HH:mm', - LTS : 'HH:mm:ss', - L: 'DD/MM/YYYY', - LL: 'D MMMM YYYY', - LLL: 'D MMMM YYYY HH:mm', - LLLL: 'dddd, D MMMM YYYY HH:mm' - }, - calendar: { - sameDay: '[ថ្ងៃនេះ ម៉ោង] LT', - nextDay: '[ស្អែក ម៉ោង] LT', - nextWeek: 'dddd [ម៉ោង] LT', - lastDay: '[ម្សិលមិញ ម៉ោង] LT', - lastWeek: 'dddd [សប្តាហ៍មុន] [ម៉ោង] LT', - sameElse: 'L' - }, - relativeTime: { - future: '%sទៀត', - past: '%sមុន', - s: 'ប៉ុន្មានវិនាទី', - m: 'មួយនាទី', - mm: '%d នាទី', - h: 'មួយម៉ោង', - hh: '%d ម៉ោង', - d: 'មួយថ្ងៃ', - dd: '%d ថ្ងៃ', - M: 'មួយខែ', - MM: '%d ខែ', - y: 'មួយឆ្នាំ', - yy: '%d ឆ្នាំ' - }, - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return km; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ko.js b/apps/meteor/private/moment-locales/ko.js deleted file mode 100644 index 248b6bae7c99..000000000000 --- a/apps/meteor/private/moment-locales/ko.js +++ /dev/null @@ -1,68 +0,0 @@ -//! moment.js locale configuration -//! locale : Korean [ko] -//! -//! authors -//! -//! - Kyungwook, Park : https://github.com/kyungw00k -//! - Jeeeyul Lee - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var ko = moment.defineLocale('ko', { - months : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'), - monthsShort : '1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월'.split('_'), - weekdays : '일요일_월요일_화요일_수요일_목요일_금요일_토요일'.split('_'), - weekdaysShort : '일_월_화_수_목_금_토'.split('_'), - weekdaysMin : '일_월_화_수_목_금_토'.split('_'), - longDateFormat : { - LT : 'A h시 m분', - LTS : 'A h시 m분 s초', - L : 'YYYY.MM.DD', - LL : 'YYYY년 MMMM D일', - LLL : 'YYYY년 MMMM D일 A h시 m분', - LLLL : 'YYYY년 MMMM D일 dddd A h시 m분' - }, - calendar : { - sameDay : '오늘 LT', - nextDay : '내일 LT', - nextWeek : 'dddd LT', - lastDay : '어제 LT', - lastWeek : '지난주 dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s 후', - past : '%s 전', - s : '몇 초', - ss : '%d초', - m : '일분', - mm : '%d분', - h : '한 시간', - hh : '%d시간', - d : '하루', - dd : '%d일', - M : '한 달', - MM : '%d달', - y : '일 년', - yy : '%d년' - }, - ordinalParse : /\d{1,2}일/, - ordinal : '%d일', - meridiemParse : /오전|오후/, - isPM : function (token) { - return token === '오후'; - }, - meridiem : function (hour, minute, isUpper) { - return hour < 12 ? '오전' : '오후'; - } - }); - - return ko; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ky.js b/apps/meteor/private/moment-locales/ky.js deleted file mode 100644 index eaffed1001d3..000000000000 --- a/apps/meteor/private/moment-locales/ky.js +++ /dev/null @@ -1,88 +0,0 @@ -//! moment.js locale configuration -//! locale : Kyrgyz [ky] -//! author : Chyngyz Arystan uulu : https://github.com/chyngyz - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - - var suffixes = { - 0: '-чү', - 1: '-чи', - 2: '-чи', - 3: '-чү', - 4: '-чү', - 5: '-чи', - 6: '-чы', - 7: '-чи', - 8: '-чи', - 9: '-чу', - 10: '-чу', - 20: '-чы', - 30: '-чу', - 40: '-чы', - 50: '-чү', - 60: '-чы', - 70: '-чи', - 80: '-чи', - 90: '-чу', - 100: '-чү' - }; - - var ky = moment.defineLocale('ky', { - months : 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_'), - monthsShort : 'янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек'.split('_'), - weekdays : 'Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби'.split('_'), - weekdaysShort : 'Жек_Дүй_Шей_Шар_Бей_Жум_Ише'.split('_'), - weekdaysMin : 'Жк_Дй_Шй_Шр_Бй_Жм_Иш'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Бүгүн саат] LT', - nextDay : '[Эртең саат] LT', - nextWeek : 'dddd [саат] LT', - lastDay : '[Кече саат] LT', - lastWeek : '[Өткен аптанын] dddd [күнү] [саат] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s ичинде', - past : '%s мурун', - s : 'бирнече секунд', - m : 'бир мүнөт', - mm : '%d мүнөт', - h : 'бир саат', - hh : '%d саат', - d : 'бир күн', - dd : '%d күн', - M : 'бир ай', - MM : '%d ай', - y : 'бир жыл', - yy : '%d жыл' - }, - ordinalParse: /\d{1,2}-(чи|чы|чү|чу)/, - ordinal : function (number) { - var a = number % 10, - b = number >= 100 ? 100 : null; - return number + (suffixes[number] || suffixes[a] || suffixes[b]); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return ky; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/lb.js b/apps/meteor/private/moment-locales/lb.js deleted file mode 100644 index 2f4298320d1a..000000000000 --- a/apps/meteor/private/moment-locales/lb.js +++ /dev/null @@ -1,136 +0,0 @@ -//! moment.js locale configuration -//! locale : Luxembourgish [lb] -//! author : mweimerskirch : https://github.com/mweimerskirch, David Raison : https://github.com/kwisatz - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 'm': ['eng Minutt', 'enger Minutt'], - 'h': ['eng Stonn', 'enger Stonn'], - 'd': ['een Dag', 'engem Dag'], - 'M': ['ee Mount', 'engem Mount'], - 'y': ['ee Joer', 'engem Joer'] - }; - return withoutSuffix ? format[key][0] : format[key][1]; - } - function processFutureTime(string) { - var number = string.substr(0, string.indexOf(' ')); - if (eifelerRegelAppliesToNumber(number)) { - return 'a ' + string; - } - return 'an ' + string; - } - function processPastTime(string) { - var number = string.substr(0, string.indexOf(' ')); - if (eifelerRegelAppliesToNumber(number)) { - return 'viru ' + string; - } - return 'virun ' + string; - } - /** - * Returns true if the word before the given number loses the '-n' ending. - * e.g. 'an 10 Deeg' but 'a 5 Deeg' - * - * @param number {integer} - * @returns {boolean} - */ - function eifelerRegelAppliesToNumber(number) { - number = parseInt(number, 10); - if (isNaN(number)) { - return false; - } - if (number < 0) { - // Negative Number --> always true - return true; - } else if (number < 10) { - // Only 1 digit - if (4 <= number && number <= 7) { - return true; - } - return false; - } else if (number < 100) { - // 2 digits - var lastDigit = number % 10, firstDigit = number / 10; - if (lastDigit === 0) { - return eifelerRegelAppliesToNumber(firstDigit); - } - return eifelerRegelAppliesToNumber(lastDigit); - } else if (number < 10000) { - // 3 or 4 digits --> recursively check first digit - while (number >= 10) { - number = number / 10; - } - return eifelerRegelAppliesToNumber(number); - } else { - // Anything larger than 4 digits: recursively check first n-3 digits - number = number / 1000; - return eifelerRegelAppliesToNumber(number); - } - } - - var lb = moment.defineLocale('lb', { - months: 'Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember'.split('_'), - monthsShort: 'Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.'.split('_'), - monthsParseExact : true, - weekdays: 'Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg'.split('_'), - weekdaysShort: 'So._Mé._Dë._Më._Do._Fr._Sa.'.split('_'), - weekdaysMin: 'So_Mé_Dë_Më_Do_Fr_Sa'.split('_'), - weekdaysParseExact : true, - longDateFormat: { - LT: 'H:mm [Auer]', - LTS: 'H:mm:ss [Auer]', - L: 'DD.MM.YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm [Auer]', - LLLL: 'dddd, D. MMMM YYYY H:mm [Auer]' - }, - calendar: { - sameDay: '[Haut um] LT', - sameElse: 'L', - nextDay: '[Muer um] LT', - nextWeek: 'dddd [um] LT', - lastDay: '[Gëschter um] LT', - lastWeek: function () { - // Different date string for 'Dënschdeg' (Tuesday) and 'Donneschdeg' (Thursday) due to phonological rule - switch (this.day()) { - case 2: - case 4: - return '[Leschten] dddd [um] LT'; - default: - return '[Leschte] dddd [um] LT'; - } - } - }, - relativeTime : { - future : processFutureTime, - past : processPastTime, - s : 'e puer Sekonnen', - m : processRelativeTime, - mm : '%d Minutten', - h : processRelativeTime, - hh : '%d Stonnen', - d : processRelativeTime, - dd : '%d Deeg', - M : processRelativeTime, - MM : '%d Méint', - y : processRelativeTime, - yy : '%d Joer' - }, - ordinalParse: /\d{1,2}\./, - ordinal: '%d.', - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return lb; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/lo.js b/apps/meteor/private/moment-locales/lo.js deleted file mode 100644 index 689a18306667..000000000000 --- a/apps/meteor/private/moment-locales/lo.js +++ /dev/null @@ -1,70 +0,0 @@ -//! moment.js locale configuration -//! locale : Lao [lo] -//! author : Ryan Hart : https://github.com/ryanhart2 - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var lo = moment.defineLocale('lo', { - months : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'), - monthsShort : 'ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ'.split('_'), - weekdays : 'ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), - weekdaysShort : 'ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ'.split('_'), - weekdaysMin : 'ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'ວັນdddd D MMMM YYYY HH:mm' - }, - meridiemParse: /ຕອນເຊົ້າ|ຕອນແລງ/, - isPM: function (input) { - return input === 'ຕອນແລງ'; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'ຕອນເຊົ້າ'; - } else { - return 'ຕອນແລງ'; - } - }, - calendar : { - sameDay : '[ມື້ນີ້ເວລາ] LT', - nextDay : '[ມື້ອື່ນເວລາ] LT', - nextWeek : '[ວັນ]dddd[ໜ້າເວລາ] LT', - lastDay : '[ມື້ວານນີ້ເວລາ] LT', - lastWeek : '[ວັນ]dddd[ແລ້ວນີ້ເວລາ] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'ອີກ %s', - past : '%sຜ່ານມາ', - s : 'ບໍ່ເທົ່າໃດວິນາທີ', - m : '1 ນາທີ', - mm : '%d ນາທີ', - h : '1 ຊົ່ວໂມງ', - hh : '%d ຊົ່ວໂມງ', - d : '1 ມື້', - dd : '%d ມື້', - M : '1 ເດືອນ', - MM : '%d ເດືອນ', - y : '1 ປີ', - yy : '%d ປີ' - }, - ordinalParse: /(ທີ່)\d{1,2}/, - ordinal : function (number) { - return 'ທີ່' + number; - } - }); - - return lo; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/lt.js b/apps/meteor/private/moment-locales/lt.js deleted file mode 100644 index 2bb9a36d83dc..000000000000 --- a/apps/meteor/private/moment-locales/lt.js +++ /dev/null @@ -1,117 +0,0 @@ -//! moment.js locale configuration -//! locale : Lithuanian [lt] -//! author : Mindaugas Mozūras : https://github.com/mmozuras - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var units = { - 'm' : 'minutė_minutės_minutę', - 'mm': 'minutės_minučių_minutes', - 'h' : 'valanda_valandos_valandą', - 'hh': 'valandos_valandų_valandas', - 'd' : 'diena_dienos_dieną', - 'dd': 'dienos_dienų_dienas', - 'M' : 'mėnuo_mėnesio_mėnesį', - 'MM': 'mėnesiai_mėnesių_mėnesius', - 'y' : 'metai_metų_metus', - 'yy': 'metai_metų_metus' - }; - function translateSeconds(number, withoutSuffix, key, isFuture) { - if (withoutSuffix) { - return 'kelios sekundės'; - } else { - return isFuture ? 'kelių sekundžių' : 'kelias sekundes'; - } - } - function translateSingular(number, withoutSuffix, key, isFuture) { - return withoutSuffix ? forms(key)[0] : (isFuture ? forms(key)[1] : forms(key)[2]); - } - function special(number) { - return number % 10 === 0 || (number > 10 && number < 20); - } - function forms(key) { - return units[key].split('_'); - } - function translate(number, withoutSuffix, key, isFuture) { - var result = number + ' '; - if (number === 1) { - return result + translateSingular(number, withoutSuffix, key[0], isFuture); - } else if (withoutSuffix) { - return result + (special(number) ? forms(key)[1] : forms(key)[0]); - } else { - if (isFuture) { - return result + forms(key)[1]; - } else { - return result + (special(number) ? forms(key)[1] : forms(key)[2]); - } - } - } - var lt = moment.defineLocale('lt', { - months : { - format: 'sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio'.split('_'), - standalone: 'sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis'.split('_'), - isFormat: /D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?|MMMM?(\[[^\[\]]*\]|\s+)+D[oD]?/ - }, - monthsShort : 'sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd'.split('_'), - weekdays : { - format: 'sekmadienį_pirmadienį_antradienį_trečiadienį_ketvirtadienį_penktadienį_šeštadienį'.split('_'), - standalone: 'sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis'.split('_'), - isFormat: /dddd HH:mm/ - }, - weekdaysShort : 'Sek_Pir_Ant_Tre_Ket_Pen_Šeš'.split('_'), - weekdaysMin : 'S_P_A_T_K_Pn_Š'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY-MM-DD', - LL : 'YYYY [m.] MMMM D [d.]', - LLL : 'YYYY [m.] MMMM D [d.], HH:mm [val.]', - LLLL : 'YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]', - l : 'YYYY-MM-DD', - ll : 'YYYY [m.] MMMM D [d.]', - lll : 'YYYY [m.] MMMM D [d.], HH:mm [val.]', - llll : 'YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]' - }, - calendar : { - sameDay : '[Šiandien] LT', - nextDay : '[Rytoj] LT', - nextWeek : 'dddd LT', - lastDay : '[Vakar] LT', - lastWeek : '[Praėjusį] dddd LT', - sameElse : 'L' - }, - relativeTime : { - future : 'po %s', - past : 'prieš %s', - s : translateSeconds, - m : translateSingular, - mm : translate, - h : translateSingular, - hh : translate, - d : translateSingular, - dd : translate, - M : translateSingular, - MM : translate, - y : translateSingular, - yy : translate - }, - ordinalParse: /\d{1,2}-oji/, - ordinal : function (number) { - return number + '-oji'; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return lt; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/lv.js b/apps/meteor/private/moment-locales/lv.js deleted file mode 100644 index 780be13986b0..000000000000 --- a/apps/meteor/private/moment-locales/lv.js +++ /dev/null @@ -1,97 +0,0 @@ -//! moment.js locale configuration -//! locale : Latvian [lv] -//! author : Kristaps Karlsons : https://github.com/skakri -//! author : Jānis Elmeris : https://github.com/JanisE - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var units = { - 'm': 'minūtes_minūtēm_minūte_minūtes'.split('_'), - 'mm': 'minūtes_minūtēm_minūte_minūtes'.split('_'), - 'h': 'stundas_stundām_stunda_stundas'.split('_'), - 'hh': 'stundas_stundām_stunda_stundas'.split('_'), - 'd': 'dienas_dienām_diena_dienas'.split('_'), - 'dd': 'dienas_dienām_diena_dienas'.split('_'), - 'M': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'), - 'MM': 'mēneša_mēnešiem_mēnesis_mēneši'.split('_'), - 'y': 'gada_gadiem_gads_gadi'.split('_'), - 'yy': 'gada_gadiem_gads_gadi'.split('_') - }; - /** - * @param withoutSuffix boolean true = a length of time; false = before/after a period of time. - */ - function format(forms, number, withoutSuffix) { - if (withoutSuffix) { - // E.g. "21 minūte", "3 minūtes". - return number % 10 === 1 && number % 100 !== 11 ? forms[2] : forms[3]; - } else { - // E.g. "21 minūtes" as in "pēc 21 minūtes". - // E.g. "3 minūtēm" as in "pēc 3 minūtēm". - return number % 10 === 1 && number % 100 !== 11 ? forms[0] : forms[1]; - } - } - function relativeTimeWithPlural(number, withoutSuffix, key) { - return number + ' ' + format(units[key], number, withoutSuffix); - } - function relativeTimeWithSingular(number, withoutSuffix, key) { - return format(units[key], number, withoutSuffix); - } - function relativeSeconds(number, withoutSuffix) { - return withoutSuffix ? 'dažas sekundes' : 'dažām sekundēm'; - } - - var lv = moment.defineLocale('lv', { - months : 'janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris'.split('_'), - monthsShort : 'jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec'.split('_'), - weekdays : 'svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena'.split('_'), - weekdaysShort : 'Sv_P_O_T_C_Pk_S'.split('_'), - weekdaysMin : 'Sv_P_O_T_C_Pk_S'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY.', - LL : 'YYYY. [gada] D. MMMM', - LLL : 'YYYY. [gada] D. MMMM, HH:mm', - LLLL : 'YYYY. [gada] D. MMMM, dddd, HH:mm' - }, - calendar : { - sameDay : '[Šodien pulksten] LT', - nextDay : '[Rīt pulksten] LT', - nextWeek : 'dddd [pulksten] LT', - lastDay : '[Vakar pulksten] LT', - lastWeek : '[Pagājušā] dddd [pulksten] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'pēc %s', - past : 'pirms %s', - s : relativeSeconds, - m : relativeTimeWithSingular, - mm : relativeTimeWithPlural, - h : relativeTimeWithSingular, - hh : relativeTimeWithPlural, - d : relativeTimeWithSingular, - dd : relativeTimeWithPlural, - M : relativeTimeWithSingular, - MM : relativeTimeWithPlural, - y : relativeTimeWithSingular, - yy : relativeTimeWithPlural - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return lv; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/me.js b/apps/meteor/private/moment-locales/me.js deleted file mode 100644 index 134e82899d7b..000000000000 --- a/apps/meteor/private/moment-locales/me.js +++ /dev/null @@ -1,111 +0,0 @@ -//! moment.js locale configuration -//! locale : Montenegrin [me] -//! author : Miodrag Nikač : https://github.com/miodragnikac - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var translator = { - words: { //Different grammatical cases - m: ['jedan minut', 'jednog minuta'], - mm: ['minut', 'minuta', 'minuta'], - h: ['jedan sat', 'jednog sata'], - hh: ['sat', 'sata', 'sati'], - dd: ['dan', 'dana', 'dana'], - MM: ['mjesec', 'mjeseca', 'mjeseci'], - yy: ['godina', 'godine', 'godina'] - }, - correctGrammaticalCase: function (number, wordKey) { - return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]); - }, - translate: function (number, withoutSuffix, key) { - var wordKey = translator.words[key]; - if (key.length === 1) { - return withoutSuffix ? wordKey[0] : wordKey[1]; - } else { - return number + ' ' + translator.correctGrammaticalCase(number, wordKey); - } - } - }; - - var me = moment.defineLocale('me', { - months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'), - monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'), - monthsParseExact : true, - weekdays: 'nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota'.split('_'), - weekdaysShort: 'ned._pon._uto._sri._čet._pet._sub.'.split('_'), - weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), - weekdaysParseExact : true, - longDateFormat: { - LT: 'H:mm', - LTS : 'H:mm:ss', - L: 'DD. MM. YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm', - LLLL: 'dddd, D. MMMM YYYY H:mm' - }, - calendar: { - sameDay: '[danas u] LT', - nextDay: '[sjutra u] LT', - - nextWeek: function () { - switch (this.day()) { - case 0: - return '[u] [nedjelju] [u] LT'; - case 3: - return '[u] [srijedu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[juče u] LT', - lastWeek : function () { - var lastWeekDays = [ - '[prošle] [nedjelje] [u] LT', - '[prošlog] [ponedjeljka] [u] LT', - '[prošlog] [utorka] [u] LT', - '[prošle] [srijede] [u] LT', - '[prošlog] [četvrtka] [u] LT', - '[prošlog] [petka] [u] LT', - '[prošle] [subote] [u] LT' - ]; - return lastWeekDays[this.day()]; - }, - sameElse : 'L' - }, - relativeTime : { - future : 'za %s', - past : 'prije %s', - s : 'nekoliko sekundi', - m : translator.translate, - mm : translator.translate, - h : translator.translate, - hh : translator.translate, - d : 'dan', - dd : translator.translate, - M : 'mjesec', - MM : translator.translate, - y : 'godinu', - yy : translator.translate - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return me; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/mk.js b/apps/meteor/private/moment-locales/mk.js deleted file mode 100644 index 88413ace21c4..000000000000 --- a/apps/meteor/private/moment-locales/mk.js +++ /dev/null @@ -1,90 +0,0 @@ -//! moment.js locale configuration -//! locale : Macedonian [mk] -//! author : Borislav Mickov : https://github.com/B0k0 - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var mk = moment.defineLocale('mk', { - months : 'јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември'.split('_'), - monthsShort : 'јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек'.split('_'), - weekdays : 'недела_понеделник_вторник_среда_четврток_петок_сабота'.split('_'), - weekdaysShort : 'нед_пон_вто_сре_чет_пет_саб'.split('_'), - weekdaysMin : 'нe_пo_вт_ср_че_пе_сa'.split('_'), - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'D.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY H:mm', - LLLL : 'dddd, D MMMM YYYY H:mm' - }, - calendar : { - sameDay : '[Денес во] LT', - nextDay : '[Утре во] LT', - nextWeek : '[Во] dddd [во] LT', - lastDay : '[Вчера во] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - case 3: - case 6: - return '[Изминатата] dddd [во] LT'; - case 1: - case 2: - case 4: - case 5: - return '[Изминатиот] dddd [во] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : 'после %s', - past : 'пред %s', - s : 'неколку секунди', - m : 'минута', - mm : '%d минути', - h : 'час', - hh : '%d часа', - d : 'ден', - dd : '%d дена', - M : 'месец', - MM : '%d месеци', - y : 'година', - yy : '%d години' - }, - ordinalParse: /\d{1,2}-(ев|ен|ти|ви|ри|ми)/, - ordinal : function (number) { - var lastDigit = number % 10, - last2Digits = number % 100; - if (number === 0) { - return number + '-ев'; - } else if (last2Digits === 0) { - return number + '-ен'; - } else if (last2Digits > 10 && last2Digits < 20) { - return number + '-ти'; - } else if (lastDigit === 1) { - return number + '-ви'; - } else if (lastDigit === 2) { - return number + '-ри'; - } else if (lastDigit === 7 || lastDigit === 8) { - return number + '-ми'; - } else { - return number + '-ти'; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return mk; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ml.js b/apps/meteor/private/moment-locales/ml.js deleted file mode 100644 index 487b37a63884..000000000000 --- a/apps/meteor/private/moment-locales/ml.js +++ /dev/null @@ -1,81 +0,0 @@ -//! moment.js locale configuration -//! locale : Malayalam [ml] -//! author : Floyd Pink : https://github.com/floydpink - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var ml = moment.defineLocale('ml', { - months : 'ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ'.split('_'), - monthsShort : 'ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.'.split('_'), - monthsParseExact : true, - weekdays : 'ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച'.split('_'), - weekdaysShort : 'ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി'.split('_'), - weekdaysMin : 'ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ'.split('_'), - longDateFormat : { - LT : 'A h:mm -നു', - LTS : 'A h:mm:ss -നു', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm -നു', - LLLL : 'dddd, D MMMM YYYY, A h:mm -നു' - }, - calendar : { - sameDay : '[ഇന്ന്] LT', - nextDay : '[നാളെ] LT', - nextWeek : 'dddd, LT', - lastDay : '[ഇന്നലെ] LT', - lastWeek : '[കഴിഞ്ഞ] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s കഴിഞ്ഞ്', - past : '%s മുൻപ്', - s : 'അൽപ നിമിഷങ്ങൾ', - m : 'ഒരു മിനിറ്റ്', - mm : '%d മിനിറ്റ്', - h : 'ഒരു മണിക്കൂർ', - hh : '%d മണിക്കൂർ', - d : 'ഒരു ദിവസം', - dd : '%d ദിവസം', - M : 'ഒരു മാസം', - MM : '%d മാസം', - y : 'ഒരു വർഷം', - yy : '%d വർഷം' - }, - meridiemParse: /രാത്രി|രാവിലെ|ഉച്ച കഴിഞ്ഞ്|വൈകുന്നേരം|രാത്രി/i, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if ((meridiem === 'രാത്രി' && hour >= 4) || - meridiem === 'ഉച്ച കഴിഞ്ഞ്' || - meridiem === 'വൈകുന്നേരം') { - return hour + 12; - } else { - return hour; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'രാത്രി'; - } else if (hour < 12) { - return 'രാവിലെ'; - } else if (hour < 17) { - return 'ഉച്ച കഴിഞ്ഞ്'; - } else if (hour < 20) { - return 'വൈകുന്നേരം'; - } else { - return 'രാത്രി'; - } - } - }); - - return ml; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/mr.js b/apps/meteor/private/moment-locales/mr.js deleted file mode 100644 index fc388b013728..000000000000 --- a/apps/meteor/private/moment-locales/mr.js +++ /dev/null @@ -1,159 +0,0 @@ -//! moment.js locale configuration -//! locale : Marathi [mr] -//! author : Harshad Kale : https://github.com/kalehv -//! author : Vivek Athalye : https://github.com/vnathalye - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - function relativeTimeMr(number, withoutSuffix, string, isFuture) - { - var output = ''; - if (withoutSuffix) { - switch (string) { - case 's': output = 'काही सेकंद'; break; - case 'm': output = 'एक मिनिट'; break; - case 'mm': output = '%d मिनिटे'; break; - case 'h': output = 'एक तास'; break; - case 'hh': output = '%d तास'; break; - case 'd': output = 'एक दिवस'; break; - case 'dd': output = '%d दिवस'; break; - case 'M': output = 'एक महिना'; break; - case 'MM': output = '%d महिने'; break; - case 'y': output = 'एक वर्ष'; break; - case 'yy': output = '%d वर्षे'; break; - } - } - else { - switch (string) { - case 's': output = 'काही सेकंदां'; break; - case 'm': output = 'एका मिनिटा'; break; - case 'mm': output = '%d मिनिटां'; break; - case 'h': output = 'एका तासा'; break; - case 'hh': output = '%d तासां'; break; - case 'd': output = 'एका दिवसा'; break; - case 'dd': output = '%d दिवसां'; break; - case 'M': output = 'एका महिन्या'; break; - case 'MM': output = '%d महिन्यां'; break; - case 'y': output = 'एका वर्षा'; break; - case 'yy': output = '%d वर्षां'; break; - } - } - return output.replace(/%d/i, number); - } - - var mr = moment.defineLocale('mr', { - months : 'जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर'.split('_'), - monthsShort: 'जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.'.split('_'), - monthsParseExact : true, - weekdays : 'रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार'.split('_'), - weekdaysShort : 'रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि'.split('_'), - weekdaysMin : 'र_सो_मं_बु_गु_शु_श'.split('_'), - longDateFormat : { - LT : 'A h:mm वाजता', - LTS : 'A h:mm:ss वाजता', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm वाजता', - LLLL : 'dddd, D MMMM YYYY, A h:mm वाजता' - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[उद्या] LT', - nextWeek : 'dddd, LT', - lastDay : '[काल] LT', - lastWeek: '[मागील] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future: '%sमध्ये', - past: '%sपूर्वी', - s: relativeTimeMr, - m: relativeTimeMr, - mm: relativeTimeMr, - h: relativeTimeMr, - hh: relativeTimeMr, - d: relativeTimeMr, - dd: relativeTimeMr, - M: relativeTimeMr, - MM: relativeTimeMr, - y: relativeTimeMr, - yy: relativeTimeMr - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiemParse: /रात्री|सकाळी|दुपारी|सायंकाळी/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'रात्री') { - return hour < 4 ? hour : hour + 12; - } else if (meridiem === 'सकाळी') { - return hour; - } else if (meridiem === 'दुपारी') { - return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'सायंकाळी') { - return hour + 12; - } - }, - meridiem: function (hour, minute, isLower) { - if (hour < 4) { - return 'रात्री'; - } else if (hour < 10) { - return 'सकाळी'; - } else if (hour < 17) { - return 'दुपारी'; - } else if (hour < 20) { - return 'सायंकाळी'; - } else { - return 'रात्री'; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); - - return mr; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ms-my.js b/apps/meteor/private/moment-locales/ms-my.js deleted file mode 100644 index e353173a912b..000000000000 --- a/apps/meteor/private/moment-locales/ms-my.js +++ /dev/null @@ -1,83 +0,0 @@ -//! moment.js locale configuration -//! locale : Malay [ms-my] -//! note : DEPRECATED, the correct one is [ms] -//! author : Weldan Jamili : https://github.com/weldan - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var ms_my = moment.defineLocale('ms-my', { - months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'), - monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'), - weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'), - weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'), - weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'), - longDateFormat : { - LT : 'HH.mm', - LTS : 'HH.mm.ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY [pukul] HH.mm', - LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm' - }, - meridiemParse: /pagi|tengahari|petang|malam/, - meridiemHour: function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'pagi') { - return hour; - } else if (meridiem === 'tengahari') { - return hour >= 11 ? hour : hour + 12; - } else if (meridiem === 'petang' || meridiem === 'malam') { - return hour + 12; - } - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'pagi'; - } else if (hours < 15) { - return 'tengahari'; - } else if (hours < 19) { - return 'petang'; - } else { - return 'malam'; - } - }, - calendar : { - sameDay : '[Hari ini pukul] LT', - nextDay : '[Esok pukul] LT', - nextWeek : 'dddd [pukul] LT', - lastDay : '[Kelmarin pukul] LT', - lastWeek : 'dddd [lepas pukul] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'dalam %s', - past : '%s yang lepas', - s : 'beberapa saat', - m : 'seminit', - mm : '%d minit', - h : 'sejam', - hh : '%d jam', - d : 'sehari', - dd : '%d hari', - M : 'sebulan', - MM : '%d bulan', - y : 'setahun', - yy : '%d tahun' - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return ms_my; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ms.js b/apps/meteor/private/moment-locales/ms.js deleted file mode 100644 index 280194ced7af..000000000000 --- a/apps/meteor/private/moment-locales/ms.js +++ /dev/null @@ -1,82 +0,0 @@ -//! moment.js locale configuration -//! locale : Malay [ms] -//! author : Weldan Jamili : https://github.com/weldan - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var ms = moment.defineLocale('ms', { - months : 'Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember'.split('_'), - monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis'.split('_'), - weekdays : 'Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu'.split('_'), - weekdaysShort : 'Ahd_Isn_Sel_Rab_Kha_Jum_Sab'.split('_'), - weekdaysMin : 'Ah_Is_Sl_Rb_Km_Jm_Sb'.split('_'), - longDateFormat : { - LT : 'HH.mm', - LTS : 'HH.mm.ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY [pukul] HH.mm', - LLLL : 'dddd, D MMMM YYYY [pukul] HH.mm' - }, - meridiemParse: /pagi|tengahari|petang|malam/, - meridiemHour: function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'pagi') { - return hour; - } else if (meridiem === 'tengahari') { - return hour >= 11 ? hour : hour + 12; - } else if (meridiem === 'petang' || meridiem === 'malam') { - return hour + 12; - } - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'pagi'; - } else if (hours < 15) { - return 'tengahari'; - } else if (hours < 19) { - return 'petang'; - } else { - return 'malam'; - } - }, - calendar : { - sameDay : '[Hari ini pukul] LT', - nextDay : '[Esok pukul] LT', - nextWeek : 'dddd [pukul] LT', - lastDay : '[Kelmarin pukul] LT', - lastWeek : 'dddd [lepas pukul] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'dalam %s', - past : '%s yang lepas', - s : 'beberapa saat', - m : 'seminit', - mm : '%d minit', - h : 'sejam', - hh : '%d jam', - d : 'sehari', - dd : '%d hari', - M : 'sebulan', - MM : '%d bulan', - y : 'setahun', - yy : '%d tahun' - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return ms; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/my.js b/apps/meteor/private/moment-locales/my.js deleted file mode 100644 index b395579397b0..000000000000 --- a/apps/meteor/private/moment-locales/my.js +++ /dev/null @@ -1,93 +0,0 @@ -//! moment.js locale configuration -//! locale : Burmese [my] -//! author : Squar team, mysquar.com - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var symbolMap = { - '1': '၁', - '2': '၂', - '3': '၃', - '4': '၄', - '5': '၅', - '6': '၆', - '7': '၇', - '8': '၈', - '9': '၉', - '0': '၀' - }, numberMap = { - '၁': '1', - '၂': '2', - '၃': '3', - '၄': '4', - '၅': '5', - '၆': '6', - '၇': '7', - '၈': '8', - '၉': '9', - '၀': '0' - }; - - var my = moment.defineLocale('my', { - months: 'ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ'.split('_'), - monthsShort: 'ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ'.split('_'), - weekdays: 'တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ'.split('_'), - weekdaysShort: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'), - weekdaysMin: 'နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ'.split('_'), - - longDateFormat: { - LT: 'HH:mm', - LTS: 'HH:mm:ss', - L: 'DD/MM/YYYY', - LL: 'D MMMM YYYY', - LLL: 'D MMMM YYYY HH:mm', - LLLL: 'dddd D MMMM YYYY HH:mm' - }, - calendar: { - sameDay: '[ယနေ.] LT [မှာ]', - nextDay: '[မနက်ဖြန်] LT [မှာ]', - nextWeek: 'dddd LT [မှာ]', - lastDay: '[မနေ.က] LT [မှာ]', - lastWeek: '[ပြီးခဲ့သော] dddd LT [မှာ]', - sameElse: 'L' - }, - relativeTime: { - future: 'လာမည့် %s မှာ', - past: 'လွန်ခဲ့သော %s က', - s: 'စက္ကန်.အနည်းငယ်', - m: 'တစ်မိနစ်', - mm: '%d မိနစ်', - h: 'တစ်နာရီ', - hh: '%d နာရီ', - d: 'တစ်ရက်', - dd: '%d ရက်', - M: 'တစ်လ', - MM: '%d လ', - y: 'တစ်နှစ်', - yy: '%d နှစ်' - }, - preparse: function (string) { - return string.replace(/[၁၂၃၄၅၆၇၈၉၀]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - week: { - dow: 1, // Monday is the first day of the week. - doy: 4 // The week that contains Jan 1st is the first week of the year. - } - }); - - return my; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/nb.js b/apps/meteor/private/moment-locales/nb.js deleted file mode 100644 index 592734d6c959..000000000000 --- a/apps/meteor/private/moment-locales/nb.js +++ /dev/null @@ -1,63 +0,0 @@ -//! moment.js locale configuration -//! locale : Norwegian Bokmål [nb] -//! authors : Espen Hovlandsdal : https://github.com/rexxars -//! Sigurd Gartmann : https://github.com/sigurdga - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var nb = moment.defineLocale('nb', { - months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), - monthsShort : 'jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.'.split('_'), - monthsParseExact : true, - weekdays : 'søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag'.split('_'), - weekdaysShort : 'sø._ma._ti._on._to._fr._lø.'.split('_'), - weekdaysMin : 'sø_ma_ti_on_to_fr_lø'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY [kl.] HH:mm', - LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm' - }, - calendar : { - sameDay: '[i dag kl.] LT', - nextDay: '[i morgen kl.] LT', - nextWeek: 'dddd [kl.] LT', - lastDay: '[i går kl.] LT', - lastWeek: '[forrige] dddd [kl.] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'om %s', - past : '%s siden', - s : 'noen sekunder', - m : 'ett minutt', - mm : '%d minutter', - h : 'en time', - hh : '%d timer', - d : 'en dag', - dd : '%d dager', - M : 'en måned', - MM : '%d måneder', - y : 'ett år', - yy : '%d år' - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return nb; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ne.js b/apps/meteor/private/moment-locales/ne.js deleted file mode 100644 index 85de195eaaa8..000000000000 --- a/apps/meteor/private/moment-locales/ne.js +++ /dev/null @@ -1,123 +0,0 @@ -//! moment.js locale configuration -//! locale : Nepalese [ne] -//! author : suvash : https://github.com/suvash - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var symbolMap = { - '1': '१', - '2': '२', - '3': '३', - '4': '४', - '5': '५', - '6': '६', - '7': '७', - '8': '८', - '9': '९', - '0': '०' - }, - numberMap = { - '१': '1', - '२': '2', - '३': '3', - '४': '4', - '५': '5', - '६': '6', - '७': '7', - '८': '8', - '९': '9', - '०': '0' - }; - - var ne = moment.defineLocale('ne', { - months : 'जनवरी_फेब्रुवरी_मार्च_अप्रिल_मई_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर'.split('_'), - monthsShort : 'जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.'.split('_'), - monthsParseExact : true, - weekdays : 'आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार'.split('_'), - weekdaysShort : 'आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.'.split('_'), - weekdaysMin : 'आ._सो._मं._बु._बि._शु._श.'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'Aको h:mm बजे', - LTS : 'Aको h:mm:ss बजे', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, Aको h:mm बजे', - LLLL : 'dddd, D MMMM YYYY, Aको h:mm बजे' - }, - preparse: function (string) { - return string.replace(/[१२३४५६७८९०]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - meridiemParse: /राति|बिहान|दिउँसो|साँझ/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'राति') { - return hour < 4 ? hour : hour + 12; - } else if (meridiem === 'बिहान') { - return hour; - } else if (meridiem === 'दिउँसो') { - return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'साँझ') { - return hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 3) { - return 'राति'; - } else if (hour < 12) { - return 'बिहान'; - } else if (hour < 16) { - return 'दिउँसो'; - } else if (hour < 20) { - return 'साँझ'; - } else { - return 'राति'; - } - }, - calendar : { - sameDay : '[आज] LT', - nextDay : '[भोलि] LT', - nextWeek : '[आउँदो] dddd[,] LT', - lastDay : '[हिजो] LT', - lastWeek : '[गएको] dddd[,] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%sमा', - past : '%s अगाडि', - s : 'केही क्षण', - m : 'एक मिनेट', - mm : '%d मिनेट', - h : 'एक घण्टा', - hh : '%d घण्टा', - d : 'एक दिन', - dd : '%d दिन', - M : 'एक महिना', - MM : '%d महिना', - y : 'एक बर्ष', - yy : '%d बर्ष' - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); - - return ne; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/nl.js b/apps/meteor/private/moment-locales/nl.js deleted file mode 100644 index 724930a76935..000000000000 --- a/apps/meteor/private/moment-locales/nl.js +++ /dev/null @@ -1,73 +0,0 @@ -//! moment.js locale configuration -//! locale : Dutch [nl] -//! author : Joris Röling : https://github.com/jjupiter - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var monthsShortWithDots = 'jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.'.split('_'), - monthsShortWithoutDots = 'jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec'.split('_'); - - var nl = moment.defineLocale('nl', { - months : 'januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december'.split('_'), - monthsShort : function (m, format) { - if (/-MMM-/.test(format)) { - return monthsShortWithoutDots[m.month()]; - } else { - return monthsShortWithDots[m.month()]; - } - }, - monthsParseExact : true, - weekdays : 'zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag'.split('_'), - weekdaysShort : 'zo._ma._di._wo._do._vr._za.'.split('_'), - weekdaysMin : 'Zo_Ma_Di_Wo_Do_Vr_Za'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD-MM-YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[vandaag om] LT', - nextDay: '[morgen om] LT', - nextWeek: 'dddd [om] LT', - lastDay: '[gisteren om] LT', - lastWeek: '[afgelopen] dddd [om] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'over %s', - past : '%s geleden', - s : 'een paar seconden', - m : 'één minuut', - mm : '%d minuten', - h : 'één uur', - hh : '%d uur', - d : 'één dag', - dd : '%d dagen', - M : 'één maand', - MM : '%d maanden', - y : 'één jaar', - yy : '%d jaar' - }, - ordinalParse: /\d{1,2}(ste|de)/, - ordinal : function (number) { - return number + ((number === 1 || number === 8 || number >= 20) ? 'ste' : 'de'); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return nl; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/nn.js b/apps/meteor/private/moment-locales/nn.js deleted file mode 100644 index cb3307d3d0ed..000000000000 --- a/apps/meteor/private/moment-locales/nn.js +++ /dev/null @@ -1,60 +0,0 @@ -//! moment.js locale configuration -//! locale : Nynorsk [nn] -//! author : https://github.com/mechuwind - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var nn = moment.defineLocale('nn', { - months : 'januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember'.split('_'), - monthsShort : 'jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des'.split('_'), - weekdays : 'sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag'.split('_'), - weekdaysShort : 'sun_mån_tys_ons_tor_fre_lau'.split('_'), - weekdaysMin : 'su_må_ty_on_to_fr_lø'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY [kl.] H:mm', - LLLL : 'dddd D. MMMM YYYY [kl.] HH:mm' - }, - calendar : { - sameDay: '[I dag klokka] LT', - nextDay: '[I morgon klokka] LT', - nextWeek: 'dddd [klokka] LT', - lastDay: '[I går klokka] LT', - lastWeek: '[Føregåande] dddd [klokka] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'om %s', - past : '%s sidan', - s : 'nokre sekund', - m : 'eit minutt', - mm : '%d minutt', - h : 'ein time', - hh : '%d timar', - d : 'ein dag', - dd : '%d dagar', - M : 'ein månad', - MM : '%d månader', - y : 'eit år', - yy : '%d år' - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return nn; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/pa-in.js b/apps/meteor/private/moment-locales/pa-in.js deleted file mode 100644 index 6567ded8a0ce..000000000000 --- a/apps/meteor/private/moment-locales/pa-in.js +++ /dev/null @@ -1,124 +0,0 @@ -//! moment.js locale configuration -//! locale : Punjabi (India) [pa-in] -//! author : Harpreet Singh : https://github.com/harpreetkhalsagtbit - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var symbolMap = { - '1': '੧', - '2': '੨', - '3': '੩', - '4': '੪', - '5': '੫', - '6': '੬', - '7': '੭', - '8': '੮', - '9': '੯', - '0': '੦' - }, - numberMap = { - '੧': '1', - '੨': '2', - '੩': '3', - '੪': '4', - '੫': '5', - '੬': '6', - '੭': '7', - '੮': '8', - '੯': '9', - '੦': '0' - }; - - var pa_in = moment.defineLocale('pa-in', { - // There are months name as per Nanakshahi Calendar but they are not used as rigidly in modern Punjabi. - months : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'), - monthsShort : 'ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ'.split('_'), - weekdays : 'ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ'.split('_'), - weekdaysShort : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), - weekdaysMin : 'ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ'.split('_'), - longDateFormat : { - LT : 'A h:mm ਵਜੇ', - LTS : 'A h:mm:ss ਵਜੇ', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm ਵਜੇ', - LLLL : 'dddd, D MMMM YYYY, A h:mm ਵਜੇ' - }, - calendar : { - sameDay : '[ਅਜ] LT', - nextDay : '[ਕਲ] LT', - nextWeek : 'dddd, LT', - lastDay : '[ਕਲ] LT', - lastWeek : '[ਪਿਛਲੇ] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s ਵਿੱਚ', - past : '%s ਪਿਛਲੇ', - s : 'ਕੁਝ ਸਕਿੰਟ', - m : 'ਇਕ ਮਿੰਟ', - mm : '%d ਮਿੰਟ', - h : 'ਇੱਕ ਘੰਟਾ', - hh : '%d ਘੰਟੇ', - d : 'ਇੱਕ ਦਿਨ', - dd : '%d ਦਿਨ', - M : 'ਇੱਕ ਮਹੀਨਾ', - MM : '%d ਮਹੀਨੇ', - y : 'ਇੱਕ ਸਾਲ', - yy : '%d ਸਾਲ' - }, - preparse: function (string) { - return string.replace(/[੧੨੩੪੫੬੭੮੯੦]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - // Punjabi notation for meridiems are quite fuzzy in practice. While there exists - // a rigid notion of a 'Pahar' it is not used as rigidly in modern Punjabi. - meridiemParse: /ਰਾਤ|ਸਵੇਰ|ਦੁਪਹਿਰ|ਸ਼ਾਮ/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'ਰਾਤ') { - return hour < 4 ? hour : hour + 12; - } else if (meridiem === 'ਸਵੇਰ') { - return hour; - } else if (meridiem === 'ਦੁਪਹਿਰ') { - return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'ਸ਼ਾਮ') { - return hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'ਰਾਤ'; - } else if (hour < 10) { - return 'ਸਵੇਰ'; - } else if (hour < 17) { - return 'ਦੁਪਹਿਰ'; - } else if (hour < 20) { - return 'ਸ਼ਾਮ'; - } else { - return 'ਰਾਤ'; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); - - return pa_in; - -})); diff --git a/apps/meteor/private/moment-locales/pl.js b/apps/meteor/private/moment-locales/pl.js deleted file mode 100644 index 0a861d1d6735..000000000000 --- a/apps/meteor/private/moment-locales/pl.js +++ /dev/null @@ -1,105 +0,0 @@ -//! moment.js locale configuration -//! locale : Polish [pl] -//! author : Rafal Hirsz : https://github.com/evoL - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var monthsNominative = 'styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień'.split('_'), - monthsSubjective = 'stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia'.split('_'); - function plural(n) { - return (n % 10 < 5) && (n % 10 > 1) && ((~~(n / 10) % 10) !== 1); - } - function translate(number, withoutSuffix, key) { - var result = number + ' '; - switch (key) { - case 'm': - return withoutSuffix ? 'minuta' : 'minutę'; - case 'mm': - return result + (plural(number) ? 'minuty' : 'minut'); - case 'h': - return withoutSuffix ? 'godzina' : 'godzinę'; - case 'hh': - return result + (plural(number) ? 'godziny' : 'godzin'); - case 'MM': - return result + (plural(number) ? 'miesiące' : 'miesięcy'); - case 'yy': - return result + (plural(number) ? 'lata' : 'lat'); - } - } - - var pl = moment.defineLocale('pl', { - months : function (momentToFormat, format) { - if (format === '') { - // Hack: if format empty we know this is used to generate - // RegExp by moment. Give then back both valid forms of months - // in RegExp ready format. - return '(' + monthsSubjective[momentToFormat.month()] + '|' + monthsNominative[momentToFormat.month()] + ')'; - } else if (/D MMMM/.test(format)) { - return monthsSubjective[momentToFormat.month()]; - } else { - return monthsNominative[momentToFormat.month()]; - } - }, - monthsShort : 'sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru'.split('_'), - weekdays : 'niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota'.split('_'), - weekdaysShort : 'nie_pon_wt_śr_czw_pt_sb'.split('_'), - weekdaysMin : 'Nd_Pn_Wt_Śr_Cz_Pt_So'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[Dziś o] LT', - nextDay: '[Jutro o] LT', - nextWeek: '[W] dddd [o] LT', - lastDay: '[Wczoraj o] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[W zeszłą niedzielę o] LT'; - case 3: - return '[W zeszłą środę o] LT'; - case 6: - return '[W zeszłą sobotę o] LT'; - default: - return '[W zeszły] dddd [o] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : 'za %s', - past : '%s temu', - s : 'kilka sekund', - m : translate, - mm : translate, - h : translate, - hh : translate, - d : '1 dzień', - dd : '%d dni', - M : 'miesiąc', - MM : translate, - y : 'rok', - yy : translate - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return pl; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/pt-br.js b/apps/meteor/private/moment-locales/pt-br.js deleted file mode 100644 index 32272050cfb7..000000000000 --- a/apps/meteor/private/moment-locales/pt-br.js +++ /dev/null @@ -1,61 +0,0 @@ -//! moment.js locale configuration -//! locale : Portuguese (Brazil) [pt-br] -//! author : Caio Ribeiro Pereira : https://github.com/caio-ribeiro-pereira - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var pt_br = moment.defineLocale('pt-br', { - months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'), - monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), - weekdays : 'Domingo_Segunda-feira_Terça-feira_Quarta-feira_Quinta-feira_Sexta-feira_Sábado'.split('_'), - weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'), - weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D [de] MMMM [de] YYYY', - LLL : 'D [de] MMMM [de] YYYY [às] HH:mm', - LLLL : 'dddd, D [de] MMMM [de] YYYY [às] HH:mm' - }, - calendar : { - sameDay: '[Hoje às] LT', - nextDay: '[Amanhã às] LT', - nextWeek: 'dddd [às] LT', - lastDay: '[Ontem às] LT', - lastWeek: function () { - return (this.day() === 0 || this.day() === 6) ? - '[Último] dddd [às] LT' : // Saturday + Sunday - '[Última] dddd [às] LT'; // Monday - Friday - }, - sameElse: 'L' - }, - relativeTime : { - future : 'em %s', - past : '%s atrás', - s : 'poucos segundos', - m : 'um minuto', - mm : '%d minutos', - h : 'uma hora', - hh : '%d horas', - d : 'um dia', - dd : '%d dias', - M : 'um mês', - MM : '%d meses', - y : 'um ano', - yy : '%d anos' - }, - ordinalParse: /\d{1,2}º/, - ordinal : '%dº' - }); - - return pt_br; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/pt.js b/apps/meteor/private/moment-locales/pt.js deleted file mode 100644 index 72c2a1bdb998..000000000000 --- a/apps/meteor/private/moment-locales/pt.js +++ /dev/null @@ -1,65 +0,0 @@ -//! moment.js locale configuration -//! locale : Portuguese [pt] -//! author : Jefferson : https://github.com/jalex79 - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var pt = moment.defineLocale('pt', { - months : 'Janeiro_Fevereiro_Março_Abril_Maio_Junho_Julho_Agosto_Setembro_Outubro_Novembro_Dezembro'.split('_'), - monthsShort : 'Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez'.split('_'), - weekdays : 'Domingo_Segunda-Feira_Terça-Feira_Quarta-Feira_Quinta-Feira_Sexta-Feira_Sábado'.split('_'), - weekdaysShort : 'Dom_Seg_Ter_Qua_Qui_Sex_Sáb'.split('_'), - weekdaysMin : 'Dom_2ª_3ª_4ª_5ª_6ª_Sáb'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D [de] MMMM [de] YYYY', - LLL : 'D [de] MMMM [de] YYYY HH:mm', - LLLL : 'dddd, D [de] MMMM [de] YYYY HH:mm' - }, - calendar : { - sameDay: '[Hoje às] LT', - nextDay: '[Amanhã às] LT', - nextWeek: 'dddd [às] LT', - lastDay: '[Ontem às] LT', - lastWeek: function () { - return (this.day() === 0 || this.day() === 6) ? - '[Último] dddd [às] LT' : // Saturday + Sunday - '[Última] dddd [às] LT'; // Monday - Friday - }, - sameElse: 'L' - }, - relativeTime : { - future : 'em %s', - past : 'há %s', - s : 'segundos', - m : 'um minuto', - mm : '%d minutos', - h : 'uma hora', - hh : '%d horas', - d : 'um dia', - dd : '%d dias', - M : 'um mês', - MM : '%d meses', - y : 'um ano', - yy : '%d anos' - }, - ordinalParse: /\d{1,2}º/, - ordinal : '%dº', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return pt; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ro.js b/apps/meteor/private/moment-locales/ro.js deleted file mode 100644 index 78b325ac3832..000000000000 --- a/apps/meteor/private/moment-locales/ro.js +++ /dev/null @@ -1,75 +0,0 @@ -//! moment.js locale configuration -//! locale : Romanian [ro] -//! author : Vlad Gurdiga : https://github.com/gurdiga -//! author : Valentin Agachi : https://github.com/avaly - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'mm': 'minute', - 'hh': 'ore', - 'dd': 'zile', - 'MM': 'luni', - 'yy': 'ani' - }, - separator = ' '; - if (number % 100 >= 20 || (number >= 100 && number % 100 === 0)) { - separator = ' de '; - } - return number + separator + format[key]; - } - - var ro = moment.defineLocale('ro', { - months : 'ianuarie_februarie_martie_aprilie_mai_iunie_iulie_august_septembrie_octombrie_noiembrie_decembrie'.split('_'), - monthsShort : 'ian._febr._mart._apr._mai_iun._iul._aug._sept._oct._nov._dec.'.split('_'), - monthsParseExact: true, - weekdays : 'duminică_luni_marți_miercuri_joi_vineri_sâmbătă'.split('_'), - weekdaysShort : 'Dum_Lun_Mar_Mie_Joi_Vin_Sâm'.split('_'), - weekdaysMin : 'Du_Lu_Ma_Mi_Jo_Vi_Sâ'.split('_'), - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY H:mm', - LLLL : 'dddd, D MMMM YYYY H:mm' - }, - calendar : { - sameDay: '[azi la] LT', - nextDay: '[mâine la] LT', - nextWeek: 'dddd [la] LT', - lastDay: '[ieri la] LT', - lastWeek: '[fosta] dddd [la] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'peste %s', - past : '%s în urmă', - s : 'câteva secunde', - m : 'un minut', - mm : relativeTimeWithPlural, - h : 'o oră', - hh : relativeTimeWithPlural, - d : 'o zi', - dd : relativeTimeWithPlural, - M : 'o lună', - MM : relativeTimeWithPlural, - y : 'un an', - yy : relativeTimeWithPlural - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return ro; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ru.js b/apps/meteor/private/moment-locales/ru.js deleted file mode 100644 index faa3cc2e3797..000000000000 --- a/apps/meteor/private/moment-locales/ru.js +++ /dev/null @@ -1,183 +0,0 @@ -//! moment.js locale configuration -//! locale : Russian [ru] -//! author : Viktorminator : https://github.com/Viktorminator -//! Author : Menelion Elensúle : https://github.com/Oire -//! author : Коренберг Марк : https://github.com/socketpair - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - function plural(word, num) { - var forms = word.split('_'); - return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); - } - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'mm': withoutSuffix ? 'минута_минуты_минут' : 'минуту_минуты_минут', - 'hh': 'час_часа_часов', - 'dd': 'день_дня_дней', - 'MM': 'месяц_месяца_месяцев', - 'yy': 'год_года_лет' - }; - if (key === 'm') { - return withoutSuffix ? 'минута' : 'минуту'; - } - else { - return number + ' ' + plural(format[key], +number); - } - } - var monthsParse = [/^янв/i, /^фев/i, /^мар/i, /^апр/i, /^ма[йя]/i, /^июн/i, /^июл/i, /^авг/i, /^сен/i, /^окт/i, /^ноя/i, /^дек/i]; - - // http://new.gramota.ru/spravka/rules/139-prop : § 103 - // Сокращения месяцев: http://new.gramota.ru/spravka/buro/search-answer?s=242637 - // CLDR data: http://www.unicode.org/cldr/charts/28/summary/ru.html#1753 - var ru = moment.defineLocale('ru', { - months : { - format: 'января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря'.split('_'), - standalone: 'январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь'.split('_') - }, - monthsShort : { - // по CLDR именно "июл." и "июн.", но какой смысл менять букву на точку ? - format: 'янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.'.split('_'), - standalone: 'янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.'.split('_') - }, - weekdays : { - standalone: 'воскресенье_понедельник_вторник_среда_четверг_пятница_суббота'.split('_'), - format: 'воскресенье_понедельник_вторник_среду_четверг_пятницу_субботу'.split('_'), - isFormat: /\[ ?[Вв] ?(?:прошлую|следующую|эту)? ?\] ?dddd/ - }, - weekdaysShort : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), - weekdaysMin : 'вс_пн_вт_ср_чт_пт_сб'.split('_'), - monthsParse : monthsParse, - longMonthsParse : monthsParse, - shortMonthsParse : monthsParse, - - // полные названия с падежами, по три буквы, для некоторых, по 4 буквы, сокращения с точкой и без точки - monthsRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i, - - // копия предыдущего - monthsShortRegex: /^(январ[ья]|янв\.?|феврал[ья]|февр?\.?|марта?|мар\.?|апрел[ья]|апр\.?|ма[йя]|июн[ья]|июн\.?|июл[ья]|июл\.?|августа?|авг\.?|сентябр[ья]|сент?\.?|октябр[ья]|окт\.?|ноябр[ья]|нояб?\.?|декабр[ья]|дек\.?)/i, - - // полные названия с падежами - monthsStrictRegex: /^(январ[яь]|феврал[яь]|марта?|апрел[яь]|ма[яй]|июн[яь]|июл[яь]|августа?|сентябр[яь]|октябр[яь]|ноябр[яь]|декабр[яь])/i, - - // Выражение, которое соотвествует только сокращённым формам - monthsShortStrictRegex: /^(янв\.|февр?\.|мар[т.]|апр\.|ма[яй]|июн[ья.]|июл[ья.]|авг\.|сент?\.|окт\.|нояб?\.|дек\.)/i, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY г.', - LLL : 'D MMMM YYYY г., HH:mm', - LLLL : 'dddd, D MMMM YYYY г., HH:mm' - }, - calendar : { - sameDay: '[Сегодня в] LT', - nextDay: '[Завтра в] LT', - lastDay: '[Вчера в] LT', - nextWeek: function (now) { - if (now.week() !== this.week()) { - switch (this.day()) { - case 0: - return '[В следующее] dddd [в] LT'; - case 1: - case 2: - case 4: - return '[В следующий] dddd [в] LT'; - case 3: - case 5: - case 6: - return '[В следующую] dddd [в] LT'; - } - } else { - if (this.day() === 2) { - return '[Во] dddd [в] LT'; - } else { - return '[В] dddd [в] LT'; - } - } - }, - lastWeek: function (now) { - if (now.week() !== this.week()) { - switch (this.day()) { - case 0: - return '[В прошлое] dddd [в] LT'; - case 1: - case 2: - case 4: - return '[В прошлый] dddd [в] LT'; - case 3: - case 5: - case 6: - return '[В прошлую] dddd [в] LT'; - } - } else { - if (this.day() === 2) { - return '[Во] dddd [в] LT'; - } else { - return '[В] dddd [в] LT'; - } - } - }, - sameElse: 'L' - }, - relativeTime : { - future : 'через %s', - past : '%s назад', - s : 'несколько секунд', - m : relativeTimeWithPlural, - mm : relativeTimeWithPlural, - h : 'час', - hh : relativeTimeWithPlural, - d : 'день', - dd : relativeTimeWithPlural, - M : 'месяц', - MM : relativeTimeWithPlural, - y : 'год', - yy : relativeTimeWithPlural - }, - meridiemParse: /ночи|утра|дня|вечера/i, - isPM : function (input) { - return /^(дня|вечера)$/.test(input); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'ночи'; - } else if (hour < 12) { - return 'утра'; - } else if (hour < 17) { - return 'дня'; - } else { - return 'вечера'; - } - }, - ordinalParse: /\d{1,2}-(й|го|я)/, - ordinal: function (number, period) { - switch (period) { - case 'M': - case 'd': - case 'DDD': - return number + '-й'; - case 'D': - return number + '-го'; - case 'w': - case 'W': - return number + '-я'; - default: - return number; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return ru; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/se.js b/apps/meteor/private/moment-locales/se.js deleted file mode 100644 index 4ed6afbae98b..000000000000 --- a/apps/meteor/private/moment-locales/se.js +++ /dev/null @@ -1,61 +0,0 @@ -//! moment.js locale configuration -//! locale : Northern Sami [se] -//! authors : Bård Rolstad Henriksen : https://github.com/karamell - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - - var se = moment.defineLocale('se', { - months : 'ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu'.split('_'), - monthsShort : 'ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov'.split('_'), - weekdays : 'sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat'.split('_'), - weekdaysShort : 'sotn_vuos_maŋ_gask_duor_bear_láv'.split('_'), - weekdaysMin : 's_v_m_g_d_b_L'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'MMMM D. [b.] YYYY', - LLL : 'MMMM D. [b.] YYYY [ti.] HH:mm', - LLLL : 'dddd, MMMM D. [b.] YYYY [ti.] HH:mm' - }, - calendar : { - sameDay: '[otne ti] LT', - nextDay: '[ihttin ti] LT', - nextWeek: 'dddd [ti] LT', - lastDay: '[ikte ti] LT', - lastWeek: '[ovddit] dddd [ti] LT', - sameElse: 'L' - }, - relativeTime : { - future : '%s geažes', - past : 'maŋit %s', - s : 'moadde sekunddat', - m : 'okta minuhta', - mm : '%d minuhtat', - h : 'okta diimmu', - hh : '%d diimmut', - d : 'okta beaivi', - dd : '%d beaivvit', - M : 'okta mánnu', - MM : '%d mánut', - y : 'okta jahki', - yy : '%d jagit' - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return se; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/si.js b/apps/meteor/private/moment-locales/si.js deleted file mode 100644 index be2387acad5a..000000000000 --- a/apps/meteor/private/moment-locales/si.js +++ /dev/null @@ -1,71 +0,0 @@ -//! moment.js locale configuration -//! locale : Sinhalese [si] -//! author : Sampath Sitinamaluwa : https://github.com/sampathsris - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - /*jshint -W100*/ - var si = moment.defineLocale('si', { - months : 'ජනවාරි_පෙබරවාරි_මාර්තු_අප්‍රේල්_මැයි_ජූනි_ජූලි_අගෝස්තු_සැප්තැම්බර්_ඔක්තෝබර්_නොවැම්බර්_දෙසැම්බර්'.split('_'), - monthsShort : 'ජන_පෙබ_මාර්_අප්_මැයි_ජූනි_ජූලි_අගෝ_සැප්_ඔක්_නොවැ_දෙසැ'.split('_'), - weekdays : 'ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා'.split('_'), - weekdaysShort : 'ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන'.split('_'), - weekdaysMin : 'ඉ_ස_අ_බ_බ්‍ර_සි_සෙ'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'a h:mm', - LTS : 'a h:mm:ss', - L : 'YYYY/MM/DD', - LL : 'YYYY MMMM D', - LLL : 'YYYY MMMM D, a h:mm', - LLLL : 'YYYY MMMM D [වැනි] dddd, a h:mm:ss' - }, - calendar : { - sameDay : '[අද] LT[ට]', - nextDay : '[හෙට] LT[ට]', - nextWeek : 'dddd LT[ට]', - lastDay : '[ඊයේ] LT[ට]', - lastWeek : '[පසුගිය] dddd LT[ට]', - sameElse : 'L' - }, - relativeTime : { - future : '%sකින්', - past : '%sකට පෙර', - s : 'තත්පර කිහිපය', - m : 'මිනිත්තුව', - mm : 'මිනිත්තු %d', - h : 'පැය', - hh : 'පැය %d', - d : 'දිනය', - dd : 'දින %d', - M : 'මාසය', - MM : 'මාස %d', - y : 'වසර', - yy : 'වසර %d' - }, - ordinalParse: /\d{1,2} වැනි/, - ordinal : function (number) { - return number + ' වැනි'; - }, - meridiemParse : /පෙර වරු|පස් වරු|පෙ.ව|ප.ව./, - isPM : function (input) { - return input === 'ප.ව.' || input === 'පස් වරු'; - }, - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'ප.ව.' : 'පස් වරු'; - } else { - return isLower ? 'පෙ.ව.' : 'පෙර වරු'; - } - } - }); - - return si; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/sk.js b/apps/meteor/private/moment-locales/sk.js deleted file mode 100644 index 582ae7ee692a..000000000000 --- a/apps/meteor/private/moment-locales/sk.js +++ /dev/null @@ -1,150 +0,0 @@ -//! moment.js locale configuration -//! locale : Slovak [sk] -//! author : Martin Minka : https://github.com/k2s -//! based on work of petrbela : https://github.com/petrbela - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var months = 'január_február_marec_apríl_máj_jún_júl_august_september_október_november_december'.split('_'), - monthsShort = 'jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec'.split('_'); - function plural(n) { - return (n > 1) && (n < 5); - } - function translate(number, withoutSuffix, key, isFuture) { - var result = number + ' '; - switch (key) { - case 's': // a few seconds / in a few seconds / a few seconds ago - return (withoutSuffix || isFuture) ? 'pár sekúnd' : 'pár sekundami'; - case 'm': // a minute / in a minute / a minute ago - return withoutSuffix ? 'minúta' : (isFuture ? 'minútu' : 'minútou'); - case 'mm': // 9 minutes / in 9 minutes / 9 minutes ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'minúty' : 'minút'); - } else { - return result + 'minútami'; - } - break; - case 'h': // an hour / in an hour / an hour ago - return withoutSuffix ? 'hodina' : (isFuture ? 'hodinu' : 'hodinou'); - case 'hh': // 9 hours / in 9 hours / 9 hours ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'hodiny' : 'hodín'); - } else { - return result + 'hodinami'; - } - break; - case 'd': // a day / in a day / a day ago - return (withoutSuffix || isFuture) ? 'deň' : 'dňom'; - case 'dd': // 9 days / in 9 days / 9 days ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'dni' : 'dní'); - } else { - return result + 'dňami'; - } - break; - case 'M': // a month / in a month / a month ago - return (withoutSuffix || isFuture) ? 'mesiac' : 'mesiacom'; - case 'MM': // 9 months / in 9 months / 9 months ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'mesiace' : 'mesiacov'); - } else { - return result + 'mesiacmi'; - } - break; - case 'y': // a year / in a year / a year ago - return (withoutSuffix || isFuture) ? 'rok' : 'rokom'; - case 'yy': // 9 years / in 9 years / 9 years ago - if (withoutSuffix || isFuture) { - return result + (plural(number) ? 'roky' : 'rokov'); - } else { - return result + 'rokmi'; - } - break; - } - } - - var sk = moment.defineLocale('sk', { - months : months, - monthsShort : monthsShort, - weekdays : 'nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota'.split('_'), - weekdaysShort : 'ne_po_ut_st_št_pi_so'.split('_'), - weekdaysMin : 'ne_po_ut_st_št_pi_so'.split('_'), - longDateFormat : { - LT: 'H:mm', - LTS : 'H:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY H:mm', - LLLL : 'dddd D. MMMM YYYY H:mm' - }, - calendar : { - sameDay: '[dnes o] LT', - nextDay: '[zajtra o] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[v nedeľu o] LT'; - case 1: - case 2: - return '[v] dddd [o] LT'; - case 3: - return '[v stredu o] LT'; - case 4: - return '[vo štvrtok o] LT'; - case 5: - return '[v piatok o] LT'; - case 6: - return '[v sobotu o] LT'; - } - }, - lastDay: '[včera o] LT', - lastWeek: function () { - switch (this.day()) { - case 0: - return '[minulú nedeľu o] LT'; - case 1: - case 2: - return '[minulý] dddd [o] LT'; - case 3: - return '[minulú stredu o] LT'; - case 4: - case 5: - return '[minulý] dddd [o] LT'; - case 6: - return '[minulú sobotu o] LT'; - } - }, - sameElse: 'L' - }, - relativeTime : { - future : 'za %s', - past : 'pred %s', - s : translate, - m : translate, - mm : translate, - h : translate, - hh : translate, - d : translate, - dd : translate, - M : translate, - MM : translate, - y : translate, - yy : translate - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return sk; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/sl.js b/apps/meteor/private/moment-locales/sl.js deleted file mode 100644 index 9015e9198987..000000000000 --- a/apps/meteor/private/moment-locales/sl.js +++ /dev/null @@ -1,162 +0,0 @@ -//! moment.js locale configuration -//! locale : Slovenian [sl] -//! author : Robert Sedovšek : https://github.com/sedovsek - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var result = number + ' '; - switch (key) { - case 's': - return withoutSuffix || isFuture ? 'nekaj sekund' : 'nekaj sekundami'; - case 'm': - return withoutSuffix ? 'ena minuta' : 'eno minuto'; - case 'mm': - if (number === 1) { - result += withoutSuffix ? 'minuta' : 'minuto'; - } else if (number === 2) { - result += withoutSuffix || isFuture ? 'minuti' : 'minutama'; - } else if (number < 5) { - result += withoutSuffix || isFuture ? 'minute' : 'minutami'; - } else { - result += withoutSuffix || isFuture ? 'minut' : 'minutami'; - } - return result; - case 'h': - return withoutSuffix ? 'ena ura' : 'eno uro'; - case 'hh': - if (number === 1) { - result += withoutSuffix ? 'ura' : 'uro'; - } else if (number === 2) { - result += withoutSuffix || isFuture ? 'uri' : 'urama'; - } else if (number < 5) { - result += withoutSuffix || isFuture ? 'ure' : 'urami'; - } else { - result += withoutSuffix || isFuture ? 'ur' : 'urami'; - } - return result; - case 'd': - return withoutSuffix || isFuture ? 'en dan' : 'enim dnem'; - case 'dd': - if (number === 1) { - result += withoutSuffix || isFuture ? 'dan' : 'dnem'; - } else if (number === 2) { - result += withoutSuffix || isFuture ? 'dni' : 'dnevoma'; - } else { - result += withoutSuffix || isFuture ? 'dni' : 'dnevi'; - } - return result; - case 'M': - return withoutSuffix || isFuture ? 'en mesec' : 'enim mesecem'; - case 'MM': - if (number === 1) { - result += withoutSuffix || isFuture ? 'mesec' : 'mesecem'; - } else if (number === 2) { - result += withoutSuffix || isFuture ? 'meseca' : 'mesecema'; - } else if (number < 5) { - result += withoutSuffix || isFuture ? 'mesece' : 'meseci'; - } else { - result += withoutSuffix || isFuture ? 'mesecev' : 'meseci'; - } - return result; - case 'y': - return withoutSuffix || isFuture ? 'eno leto' : 'enim letom'; - case 'yy': - if (number === 1) { - result += withoutSuffix || isFuture ? 'leto' : 'letom'; - } else if (number === 2) { - result += withoutSuffix || isFuture ? 'leti' : 'letoma'; - } else if (number < 5) { - result += withoutSuffix || isFuture ? 'leta' : 'leti'; - } else { - result += withoutSuffix || isFuture ? 'let' : 'leti'; - } - return result; - } - } - - var sl = moment.defineLocale('sl', { - months : 'januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december'.split('_'), - monthsShort : 'jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.'.split('_'), - monthsParseExact: true, - weekdays : 'nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota'.split('_'), - weekdaysShort : 'ned._pon._tor._sre._čet._pet._sob.'.split('_'), - weekdaysMin : 'ne_po_to_sr_če_pe_so'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'H:mm', - LTS : 'H:mm:ss', - L : 'DD. MM. YYYY', - LL : 'D. MMMM YYYY', - LLL : 'D. MMMM YYYY H:mm', - LLLL : 'dddd, D. MMMM YYYY H:mm' - }, - calendar : { - sameDay : '[danes ob] LT', - nextDay : '[jutri ob] LT', - - nextWeek : function () { - switch (this.day()) { - case 0: - return '[v] [nedeljo] [ob] LT'; - case 3: - return '[v] [sredo] [ob] LT'; - case 6: - return '[v] [soboto] [ob] LT'; - case 1: - case 2: - case 4: - case 5: - return '[v] dddd [ob] LT'; - } - }, - lastDay : '[včeraj ob] LT', - lastWeek : function () { - switch (this.day()) { - case 0: - return '[prejšnjo] [nedeljo] [ob] LT'; - case 3: - return '[prejšnjo] [sredo] [ob] LT'; - case 6: - return '[prejšnjo] [soboto] [ob] LT'; - case 1: - case 2: - case 4: - case 5: - return '[prejšnji] dddd [ob] LT'; - } - }, - sameElse : 'L' - }, - relativeTime : { - future : 'čez %s', - past : 'pred %s', - s : processRelativeTime, - m : processRelativeTime, - mm : processRelativeTime, - h : processRelativeTime, - hh : processRelativeTime, - d : processRelativeTime, - dd : processRelativeTime, - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return sl; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/sq.js b/apps/meteor/private/moment-locales/sq.js deleted file mode 100644 index 6fa24551904a..000000000000 --- a/apps/meteor/private/moment-locales/sq.js +++ /dev/null @@ -1,70 +0,0 @@ -//! moment.js locale configuration -//! locale : Albanian [sq] -//! author : Flakërim Ismani : https://github.com/flakerimi -//! author: Menelion Elensúle: https://github.com/Oire (tests) -//! author : Oerd Cukalla : https://github.com/oerd (fixes) - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var sq = moment.defineLocale('sq', { - months : 'Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor'.split('_'), - monthsShort : 'Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj'.split('_'), - weekdays : 'E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë'.split('_'), - weekdaysShort : 'Die_Hën_Mar_Mër_Enj_Pre_Sht'.split('_'), - weekdaysMin : 'D_H_Ma_Më_E_P_Sh'.split('_'), - weekdaysParseExact : true, - meridiemParse: /PD|MD/, - isPM: function (input) { - return input.charAt(0) === 'M'; - }, - meridiem : function (hours, minutes, isLower) { - return hours < 12 ? 'PD' : 'MD'; - }, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[Sot në] LT', - nextDay : '[Nesër në] LT', - nextWeek : 'dddd [në] LT', - lastDay : '[Dje në] LT', - lastWeek : 'dddd [e kaluar në] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'në %s', - past : '%s më parë', - s : 'disa sekonda', - m : 'një minutë', - mm : '%d minuta', - h : 'një orë', - hh : '%d orë', - d : 'një ditë', - dd : '%d ditë', - M : 'një muaj', - MM : '%d muaj', - y : 'një vit', - yy : '%d vite' - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return sq; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/sr-cyrl.js b/apps/meteor/private/moment-locales/sr-cyrl.js deleted file mode 100644 index 943d57c4202a..000000000000 --- a/apps/meteor/private/moment-locales/sr-cyrl.js +++ /dev/null @@ -1,110 +0,0 @@ -//! moment.js locale configuration -//! locale : Serbian Cyrillic [sr-cyrl] -//! author : Milan Janačković : https://github.com/milan-j - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var translator = { - words: { //Different grammatical cases - m: ['један минут', 'једне минуте'], - mm: ['минут', 'минуте', 'минута'], - h: ['један сат', 'једног сата'], - hh: ['сат', 'сата', 'сати'], - dd: ['дан', 'дана', 'дана'], - MM: ['месец', 'месеца', 'месеци'], - yy: ['година', 'године', 'година'] - }, - correctGrammaticalCase: function (number, wordKey) { - return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]); - }, - translate: function (number, withoutSuffix, key) { - var wordKey = translator.words[key]; - if (key.length === 1) { - return withoutSuffix ? wordKey[0] : wordKey[1]; - } else { - return number + ' ' + translator.correctGrammaticalCase(number, wordKey); - } - } - }; - - var sr_cyrl = moment.defineLocale('sr-cyrl', { - months: 'јануар_фебруар_март_април_мај_јун_јул_август_септембар_октобар_новембар_децембар'.split('_'), - monthsShort: 'јан._феб._мар._апр._мај_јун_јул_авг._сеп._окт._нов._дец.'.split('_'), - monthsParseExact: true, - weekdays: 'недеља_понедељак_уторак_среда_четвртак_петак_субота'.split('_'), - weekdaysShort: 'нед._пон._уто._сре._чет._пет._суб.'.split('_'), - weekdaysMin: 'не_по_ут_ср_че_пе_су'.split('_'), - weekdaysParseExact : true, - longDateFormat: { - LT: 'H:mm', - LTS : 'H:mm:ss', - L: 'DD. MM. YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm', - LLLL: 'dddd, D. MMMM YYYY H:mm' - }, - calendar: { - sameDay: '[данас у] LT', - nextDay: '[сутра у] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[у] [недељу] [у] LT'; - case 3: - return '[у] [среду] [у] LT'; - case 6: - return '[у] [суботу] [у] LT'; - case 1: - case 2: - case 4: - case 5: - return '[у] dddd [у] LT'; - } - }, - lastDay : '[јуче у] LT', - lastWeek : function () { - var lastWeekDays = [ - '[прошле] [недеље] [у] LT', - '[прошлог] [понедељка] [у] LT', - '[прошлог] [уторка] [у] LT', - '[прошле] [среде] [у] LT', - '[прошлог] [четвртка] [у] LT', - '[прошлог] [петка] [у] LT', - '[прошле] [суботе] [у] LT' - ]; - return lastWeekDays[this.day()]; - }, - sameElse : 'L' - }, - relativeTime : { - future : 'за %s', - past : 'пре %s', - s : 'неколико секунди', - m : translator.translate, - mm : translator.translate, - h : translator.translate, - hh : translator.translate, - d : 'дан', - dd : translator.translate, - M : 'месец', - MM : translator.translate, - y : 'годину', - yy : translator.translate - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return sr_cyrl; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/sr.js b/apps/meteor/private/moment-locales/sr.js deleted file mode 100644 index a1f0ccb77c9e..000000000000 --- a/apps/meteor/private/moment-locales/sr.js +++ /dev/null @@ -1,110 +0,0 @@ -//! moment.js locale configuration -//! locale : Serbian [sr] -//! author : Milan Janačković : https://github.com/milan-j - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var translator = { - words: { //Different grammatical cases - m: ['jedan minut', 'jedne minute'], - mm: ['minut', 'minute', 'minuta'], - h: ['jedan sat', 'jednog sata'], - hh: ['sat', 'sata', 'sati'], - dd: ['dan', 'dana', 'dana'], - MM: ['mesec', 'meseca', 'meseci'], - yy: ['godina', 'godine', 'godina'] - }, - correctGrammaticalCase: function (number, wordKey) { - return number === 1 ? wordKey[0] : (number >= 2 && number <= 4 ? wordKey[1] : wordKey[2]); - }, - translate: function (number, withoutSuffix, key) { - var wordKey = translator.words[key]; - if (key.length === 1) { - return withoutSuffix ? wordKey[0] : wordKey[1]; - } else { - return number + ' ' + translator.correctGrammaticalCase(number, wordKey); - } - } - }; - - var sr = moment.defineLocale('sr', { - months: 'januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar'.split('_'), - monthsShort: 'jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.'.split('_'), - monthsParseExact: true, - weekdays: 'nedelja_ponedeljak_utorak_sreda_četvrtak_petak_subota'.split('_'), - weekdaysShort: 'ned._pon._uto._sre._čet._pet._sub.'.split('_'), - weekdaysMin: 'ne_po_ut_sr_če_pe_su'.split('_'), - weekdaysParseExact : true, - longDateFormat: { - LT: 'H:mm', - LTS : 'H:mm:ss', - L: 'DD. MM. YYYY', - LL: 'D. MMMM YYYY', - LLL: 'D. MMMM YYYY H:mm', - LLLL: 'dddd, D. MMMM YYYY H:mm' - }, - calendar: { - sameDay: '[danas u] LT', - nextDay: '[sutra u] LT', - nextWeek: function () { - switch (this.day()) { - case 0: - return '[u] [nedelju] [u] LT'; - case 3: - return '[u] [sredu] [u] LT'; - case 6: - return '[u] [subotu] [u] LT'; - case 1: - case 2: - case 4: - case 5: - return '[u] dddd [u] LT'; - } - }, - lastDay : '[juče u] LT', - lastWeek : function () { - var lastWeekDays = [ - '[prošle] [nedelje] [u] LT', - '[prošlog] [ponedeljka] [u] LT', - '[prošlog] [utorka] [u] LT', - '[prošle] [srede] [u] LT', - '[prošlog] [četvrtka] [u] LT', - '[prošlog] [petka] [u] LT', - '[prošle] [subote] [u] LT' - ]; - return lastWeekDays[this.day()]; - }, - sameElse : 'L' - }, - relativeTime : { - future : 'za %s', - past : 'pre %s', - s : 'nekoliko sekundi', - m : translator.translate, - mm : translator.translate, - h : translator.translate, - hh : translator.translate, - d : 'dan', - dd : translator.translate, - M : 'mesec', - MM : translator.translate, - y : 'godinu', - yy : translator.translate - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return sr; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ss.js b/apps/meteor/private/moment-locales/ss.js deleted file mode 100644 index 2dfb501e6952..000000000000 --- a/apps/meteor/private/moment-locales/ss.js +++ /dev/null @@ -1,89 +0,0 @@ -//! moment.js locale configuration -//! locale : Swazi [ss] -//! author : Nicolai Davies : https://github.com/nicolaidavies - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - - var ss = moment.defineLocale('ss', { - months : "Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split('_'), - monthsShort : 'Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo'.split('_'), - weekdays : 'Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo'.split('_'), - weekdaysShort : 'Lis_Umb_Lsb_Les_Lsi_Lsh_Umg'.split('_'), - weekdaysMin : 'Li_Us_Lb_Lt_Ls_Lh_Ug'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'h:mm A', - LTS : 'h:mm:ss A', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY h:mm A', - LLLL : 'dddd, D MMMM YYYY h:mm A' - }, - calendar : { - sameDay : '[Namuhla nga] LT', - nextDay : '[Kusasa nga] LT', - nextWeek : 'dddd [nga] LT', - lastDay : '[Itolo nga] LT', - lastWeek : 'dddd [leliphelile] [nga] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'nga %s', - past : 'wenteka nga %s', - s : 'emizuzwana lomcane', - m : 'umzuzu', - mm : '%d emizuzu', - h : 'lihora', - hh : '%d emahora', - d : 'lilanga', - dd : '%d emalanga', - M : 'inyanga', - MM : '%d tinyanga', - y : 'umnyaka', - yy : '%d iminyaka' - }, - meridiemParse: /ekuseni|emini|entsambama|ebusuku/, - meridiem : function (hours, minutes, isLower) { - if (hours < 11) { - return 'ekuseni'; - } else if (hours < 15) { - return 'emini'; - } else if (hours < 19) { - return 'entsambama'; - } else { - return 'ebusuku'; - } - }, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'ekuseni') { - return hour; - } else if (meridiem === 'emini') { - return hour >= 11 ? hour : hour + 12; - } else if (meridiem === 'entsambama' || meridiem === 'ebusuku') { - if (hour === 0) { - return 0; - } - return hour + 12; - } - }, - ordinalParse: /\d{1,2}/, - ordinal : '%d', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return ss; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/sv.js b/apps/meteor/private/moment-locales/sv.js deleted file mode 100644 index a77c3e1072ba..000000000000 --- a/apps/meteor/private/moment-locales/sv.js +++ /dev/null @@ -1,69 +0,0 @@ -//! moment.js locale configuration -//! locale : Swedish [sv] -//! author : Jens Alm : https://github.com/ulmus - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var sv = moment.defineLocale('sv', { - months : 'januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december'.split('_'), - monthsShort : 'jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec'.split('_'), - weekdays : 'söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag'.split('_'), - weekdaysShort : 'sön_mån_tis_ons_tor_fre_lör'.split('_'), - weekdaysMin : 'sö_må_ti_on_to_fr_lö'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'YYYY-MM-DD', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY [kl.] HH:mm', - LLLL : 'dddd D MMMM YYYY [kl.] HH:mm', - lll : 'D MMM YYYY HH:mm', - llll : 'ddd D MMM YYYY HH:mm' - }, - calendar : { - sameDay: '[Idag] LT', - nextDay: '[Imorgon] LT', - lastDay: '[Igår] LT', - nextWeek: '[På] dddd LT', - lastWeek: '[I] dddd[s] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'om %s', - past : 'för %s sedan', - s : 'några sekunder', - m : 'en minut', - mm : '%d minuter', - h : 'en timme', - hh : '%d timmar', - d : 'en dag', - dd : '%d dagar', - M : 'en månad', - MM : '%d månader', - y : 'ett år', - yy : '%d år' - }, - ordinalParse: /\d{1,2}(e|a)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'e' : - (b === 1) ? 'a' : - (b === 2) ? 'a' : - (b === 3) ? 'e' : 'e'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return sv; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/sw.js b/apps/meteor/private/moment-locales/sw.js deleted file mode 100644 index 1458d892fee4..000000000000 --- a/apps/meteor/private/moment-locales/sw.js +++ /dev/null @@ -1,59 +0,0 @@ -//! moment.js locale configuration -//! locale : Swahili [sw] -//! author : Fahad Kassim : https://github.com/fadsel - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var sw = moment.defineLocale('sw', { - months : 'Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba'.split('_'), - monthsShort : 'Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des'.split('_'), - weekdays : 'Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi'.split('_'), - weekdaysShort : 'Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos'.split('_'), - weekdaysMin : 'J2_J3_J4_J5_Al_Ij_J1'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[leo saa] LT', - nextDay : '[kesho saa] LT', - nextWeek : '[wiki ijayo] dddd [saat] LT', - lastDay : '[jana] LT', - lastWeek : '[wiki iliyopita] dddd [saat] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s baadaye', - past : 'tokea %s', - s : 'hivi punde', - m : 'dakika moja', - mm : 'dakika %d', - h : 'saa limoja', - hh : 'masaa %d', - d : 'siku moja', - dd : 'masiku %d', - M : 'mwezi mmoja', - MM : 'miezi %d', - y : 'mwaka mmoja', - yy : 'miaka %d' - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return sw; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/ta.js b/apps/meteor/private/moment-locales/ta.js deleted file mode 100644 index c04fa587b688..000000000000 --- a/apps/meteor/private/moment-locales/ta.js +++ /dev/null @@ -1,129 +0,0 @@ -//! moment.js locale configuration -//! locale : Tamil [ta] -//! author : Arjunkumar Krishnamoorthy : https://github.com/tk120404 - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var symbolMap = { - '1': '௧', - '2': '௨', - '3': '௩', - '4': '௪', - '5': '௫', - '6': '௬', - '7': '௭', - '8': '௮', - '9': '௯', - '0': '௦' - }, numberMap = { - '௧': '1', - '௨': '2', - '௩': '3', - '௪': '4', - '௫': '5', - '௬': '6', - '௭': '7', - '௮': '8', - '௯': '9', - '௦': '0' - }; - - var ta = moment.defineLocale('ta', { - months : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), - monthsShort : 'ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்'.split('_'), - weekdays : 'ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை'.split('_'), - weekdaysShort : 'ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி'.split('_'), - weekdaysMin : 'ஞா_தி_செ_பு_வி_வெ_ச'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, HH:mm', - LLLL : 'dddd, D MMMM YYYY, HH:mm' - }, - calendar : { - sameDay : '[இன்று] LT', - nextDay : '[நாளை] LT', - nextWeek : 'dddd, LT', - lastDay : '[நேற்று] LT', - lastWeek : '[கடந்த வாரம்] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s இல்', - past : '%s முன்', - s : 'ஒரு சில விநாடிகள்', - m : 'ஒரு நிமிடம்', - mm : '%d நிமிடங்கள்', - h : 'ஒரு மணி நேரம்', - hh : '%d மணி நேரம்', - d : 'ஒரு நாள்', - dd : '%d நாட்கள்', - M : 'ஒரு மாதம்', - MM : '%d மாதங்கள்', - y : 'ஒரு வருடம்', - yy : '%d ஆண்டுகள்' - }, - ordinalParse: /\d{1,2}வது/, - ordinal : function (number) { - return number + 'வது'; - }, - preparse: function (string) { - return string.replace(/[௧௨௩௪௫௬௭௮௯௦]/g, function (match) { - return numberMap[match]; - }); - }, - postformat: function (string) { - return string.replace(/\d/g, function (match) { - return symbolMap[match]; - }); - }, - // refer http://ta.wikipedia.org/s/1er1 - meridiemParse: /யாமம்|வைகறை|காலை|நண்பகல்|எற்பாடு|மாலை/, - meridiem : function (hour, minute, isLower) { - if (hour < 2) { - return ' யாமம்'; - } else if (hour < 6) { - return ' வைகறை'; // வைகறை - } else if (hour < 10) { - return ' காலை'; // காலை - } else if (hour < 14) { - return ' நண்பகல்'; // நண்பகல் - } else if (hour < 18) { - return ' எற்பாடு'; // எற்பாடு - } else if (hour < 22) { - return ' மாலை'; // மாலை - } else { - return ' யாமம்'; - } - }, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'யாமம்') { - return hour < 2 ? hour : hour + 12; - } else if (meridiem === 'வைகறை' || meridiem === 'காலை') { - return hour; - } else if (meridiem === 'நண்பகல்') { - return hour >= 10 ? hour : hour + 12; - } else { - return hour + 12; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); - - return ta; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/te.js b/apps/meteor/private/moment-locales/te.js deleted file mode 100644 index 1061ad22a4c4..000000000000 --- a/apps/meteor/private/moment-locales/te.js +++ /dev/null @@ -1,89 +0,0 @@ -//! moment.js locale configuration -//! locale : Telugu [te] -//! author : Krishna Chaitanya Thota : https://github.com/kcthota - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var te = moment.defineLocale('te', { - months : 'జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జూలై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్'.split('_'), - monthsShort : 'జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జూలై_ఆగ._సెప్._అక్టో._నవ._డిసె.'.split('_'), - monthsParseExact : true, - weekdays : 'ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం'.split('_'), - weekdaysShort : 'ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని'.split('_'), - weekdaysMin : 'ఆ_సో_మం_బు_గు_శు_శ'.split('_'), - longDateFormat : { - LT : 'A h:mm', - LTS : 'A h:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY, A h:mm', - LLLL : 'dddd, D MMMM YYYY, A h:mm' - }, - calendar : { - sameDay : '[నేడు] LT', - nextDay : '[రేపు] LT', - nextWeek : 'dddd, LT', - lastDay : '[నిన్న] LT', - lastWeek : '[గత] dddd, LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s లో', - past : '%s క్రితం', - s : 'కొన్ని క్షణాలు', - m : 'ఒక నిమిషం', - mm : '%d నిమిషాలు', - h : 'ఒక గంట', - hh : '%d గంటలు', - d : 'ఒక రోజు', - dd : '%d రోజులు', - M : 'ఒక నెల', - MM : '%d నెలలు', - y : 'ఒక సంవత్సరం', - yy : '%d సంవత్సరాలు' - }, - ordinalParse : /\d{1,2}వ/, - ordinal : '%dవ', - meridiemParse: /రాత్రి|ఉదయం|మధ్యాహ్నం|సాయంత్రం/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === 'రాత్రి') { - return hour < 4 ? hour : hour + 12; - } else if (meridiem === 'ఉదయం') { - return hour; - } else if (meridiem === 'మధ్యాహ్నం') { - return hour >= 10 ? hour : hour + 12; - } else if (meridiem === 'సాయంత్రం') { - return hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'రాత్రి'; - } else if (hour < 10) { - return 'ఉదయం'; - } else if (hour < 17) { - return 'మధ్యాహ్నం'; - } else if (hour < 20) { - return 'సాయంత్రం'; - } else { - return 'రాత్రి'; - } - }, - week : { - dow : 0, // Sunday is the first day of the week. - doy : 6 // The week that contains Jan 1st is the first week of the year. - } - }); - - return te; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/th.js b/apps/meteor/private/moment-locales/th.js deleted file mode 100644 index 4d3c2784ccff..000000000000 --- a/apps/meteor/private/moment-locales/th.js +++ /dev/null @@ -1,67 +0,0 @@ -//! moment.js locale configuration -//! locale : Thai [th] -//! author : Kridsada Thanabulpong : https://github.com/sirn - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var th = moment.defineLocale('th', { - months : 'มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม'.split('_'), - monthsShort : 'ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.'.split('_'), - monthsParseExact: true, - weekdays : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์'.split('_'), - weekdaysShort : 'อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์'.split('_'), // yes, three characters difference - weekdaysMin : 'อา._จ._อ._พ._พฤ._ศ._ส.'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'H นาฬิกา m นาที', - LTS : 'H นาฬิกา m นาที s วินาที', - L : 'YYYY/MM/DD', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY เวลา H นาฬิกา m นาที', - LLLL : 'วันddddที่ D MMMM YYYY เวลา H นาฬิกา m นาที' - }, - meridiemParse: /ก่อนเที่ยง|หลังเที่ยง/, - isPM: function (input) { - return input === 'หลังเที่ยง'; - }, - meridiem : function (hour, minute, isLower) { - if (hour < 12) { - return 'ก่อนเที่ยง'; - } else { - return 'หลังเที่ยง'; - } - }, - calendar : { - sameDay : '[วันนี้ เวลา] LT', - nextDay : '[พรุ่งนี้ เวลา] LT', - nextWeek : 'dddd[หน้า เวลา] LT', - lastDay : '[เมื่อวานนี้ เวลา] LT', - lastWeek : '[วัน]dddd[ที่แล้ว เวลา] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'อีก %s', - past : '%sที่แล้ว', - s : 'ไม่กี่วินาที', - m : '1 นาที', - mm : '%d นาที', - h : '1 ชั่วโมง', - hh : '%d ชั่วโมง', - d : '1 วัน', - dd : '%d วัน', - M : '1 เดือน', - MM : '%d เดือน', - y : '1 ปี', - yy : '%d ปี' - } - }); - - return th; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/tl-ph.js b/apps/meteor/private/moment-locales/tl-ph.js deleted file mode 100644 index 48d2dc86963f..000000000000 --- a/apps/meteor/private/moment-locales/tl-ph.js +++ /dev/null @@ -1,62 +0,0 @@ -//! moment.js locale configuration -//! locale : Tagalog (Philippines) [tl-ph] -//! author : Dan Hagman - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var tl_ph = moment.defineLocale('tl-ph', { - months : 'Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre'.split('_'), - monthsShort : 'Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis'.split('_'), - weekdays : 'Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado'.split('_'), - weekdaysShort : 'Lin_Lun_Mar_Miy_Huw_Biy_Sab'.split('_'), - weekdaysMin : 'Li_Lu_Ma_Mi_Hu_Bi_Sab'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'MM/D/YYYY', - LL : 'MMMM D, YYYY', - LLL : 'MMMM D, YYYY HH:mm', - LLLL : 'dddd, MMMM DD, YYYY HH:mm' - }, - calendar : { - sameDay: '[Ngayon sa] LT', - nextDay: '[Bukas sa] LT', - nextWeek: 'dddd [sa] LT', - lastDay: '[Kahapon sa] LT', - lastWeek: 'dddd [huling linggo] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'sa loob ng %s', - past : '%s ang nakalipas', - s : 'ilang segundo', - m : 'isang minuto', - mm : '%d minuto', - h : 'isang oras', - hh : '%d oras', - d : 'isang araw', - dd : '%d araw', - M : 'isang buwan', - MM : '%d buwan', - y : 'isang taon', - yy : '%d taon' - }, - ordinalParse: /\d{1,2}/, - ordinal : function (number) { - return number; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return tl_ph; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/tlh.js b/apps/meteor/private/moment-locales/tlh.js deleted file mode 100644 index 80181784838f..000000000000 --- a/apps/meteor/private/moment-locales/tlh.js +++ /dev/null @@ -1,120 +0,0 @@ -//! moment.js locale configuration -//! locale : Klingon [tlh] -//! author : Dominika Kruk : https://github.com/amaranthrose - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var numbersNouns = 'pagh_wa’_cha’_wej_loS_vagh_jav_Soch_chorgh_Hut'.split('_'); - - function translateFuture(output) { - var time = output; - time = (output.indexOf('jaj') !== -1) ? - time.slice(0, -3) + 'leS' : - (output.indexOf('jar') !== -1) ? - time.slice(0, -3) + 'waQ' : - (output.indexOf('DIS') !== -1) ? - time.slice(0, -3) + 'nem' : - time + ' pIq'; - return time; - } - - function translatePast(output) { - var time = output; - time = (output.indexOf('jaj') !== -1) ? - time.slice(0, -3) + 'Hu’' : - (output.indexOf('jar') !== -1) ? - time.slice(0, -3) + 'wen' : - (output.indexOf('DIS') !== -1) ? - time.slice(0, -3) + 'ben' : - time + ' ret'; - return time; - } - - function translate(number, withoutSuffix, string, isFuture) { - var numberNoun = numberAsNoun(number); - switch (string) { - case 'mm': - return numberNoun + ' tup'; - case 'hh': - return numberNoun + ' rep'; - case 'dd': - return numberNoun + ' jaj'; - case 'MM': - return numberNoun + ' jar'; - case 'yy': - return numberNoun + ' DIS'; - } - } - - function numberAsNoun(number) { - var hundred = Math.floor((number % 1000) / 100), - ten = Math.floor((number % 100) / 10), - one = number % 10, - word = ''; - if (hundred > 0) { - word += numbersNouns[hundred] + 'vatlh'; - } - if (ten > 0) { - word += ((word !== '') ? ' ' : '') + numbersNouns[ten] + 'maH'; - } - if (one > 0) { - word += ((word !== '') ? ' ' : '') + numbersNouns[one]; - } - return (word === '') ? 'pagh' : word; - } - - var tlh = moment.defineLocale('tlh', { - months : 'tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’'.split('_'), - monthsShort : 'jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’'.split('_'), - monthsParseExact : true, - weekdays : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), - weekdaysShort : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), - weekdaysMin : 'lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[DaHjaj] LT', - nextDay: '[wa’leS] LT', - nextWeek: 'LLL', - lastDay: '[wa’Hu’] LT', - lastWeek: 'LLL', - sameElse: 'L' - }, - relativeTime : { - future : translateFuture, - past : translatePast, - s : 'puS lup', - m : 'wa’ tup', - mm : translate, - h : 'wa’ rep', - hh : translate, - d : 'wa’ jaj', - dd : translate, - M : 'wa’ jar', - MM : translate, - y : 'wa’ DIS', - yy : translate - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return tlh; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/tr.js b/apps/meteor/private/moment-locales/tr.js deleted file mode 100644 index c88ed7eeddc3..000000000000 --- a/apps/meteor/private/moment-locales/tr.js +++ /dev/null @@ -1,90 +0,0 @@ -//! moment.js locale configuration -//! locale : Turkish [tr] -//! authors : Erhan Gundogan : https://github.com/erhangundogan, -//! Burak Yiğit Kaya: https://github.com/BYK - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var suffixes = { - 1: '\'inci', - 5: '\'inci', - 8: '\'inci', - 70: '\'inci', - 80: '\'inci', - 2: '\'nci', - 7: '\'nci', - 20: '\'nci', - 50: '\'nci', - 3: '\'üncü', - 4: '\'üncü', - 100: '\'üncü', - 6: '\'ncı', - 9: '\'uncu', - 10: '\'uncu', - 30: '\'uncu', - 60: '\'ıncı', - 90: '\'ıncı' - }; - - var tr = moment.defineLocale('tr', { - months : 'Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık'.split('_'), - monthsShort : 'Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara'.split('_'), - weekdays : 'Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi'.split('_'), - weekdaysShort : 'Paz_Pts_Sal_Çar_Per_Cum_Cts'.split('_'), - weekdaysMin : 'Pz_Pt_Sa_Ça_Pe_Cu_Ct'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[bugün saat] LT', - nextDay : '[yarın saat] LT', - nextWeek : '[haftaya] dddd [saat] LT', - lastDay : '[dün] LT', - lastWeek : '[geçen hafta] dddd [saat] LT', - sameElse : 'L' - }, - relativeTime : { - future : '%s sonra', - past : '%s önce', - s : 'birkaç saniye', - m : 'bir dakika', - mm : '%d dakika', - h : 'bir saat', - hh : '%d saat', - d : 'bir gün', - dd : '%d gün', - M : 'bir ay', - MM : '%d ay', - y : 'bir yıl', - yy : '%d yıl' - }, - ordinalParse: /\d{1,2}'(inci|nci|üncü|ncı|uncu|ıncı)/, - ordinal : function (number) { - if (number === 0) { // special case for zero - return number + '\'ıncı'; - } - var a = number % 10, - b = number % 100 - a, - c = number >= 100 ? 100 : null; - return number + (suffixes[a] || suffixes[b] || suffixes[c]); - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return tr; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/tzl.js b/apps/meteor/private/moment-locales/tzl.js deleted file mode 100644 index 0918334b4aa4..000000000000 --- a/apps/meteor/private/moment-locales/tzl.js +++ /dev/null @@ -1,91 +0,0 @@ -//! moment.js locale configuration -//! locale : Talossan [tzl] -//! author : Robin van der Vliet : https://github.com/robin0van0der0v with the help of Iustì Canun - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - - // After the year there should be a slash and the amount of years since December 26, 1979 in Roman numerals. - // This is currently too difficult (maybe even impossible) to add. - var tzl = moment.defineLocale('tzl', { - months : 'Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar'.split('_'), - monthsShort : 'Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec'.split('_'), - weekdays : 'Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi'.split('_'), - weekdaysShort : 'Súl_Lún_Mai_Már_Xhú_Vié_Sát'.split('_'), - weekdaysMin : 'Sú_Lú_Ma_Má_Xh_Vi_Sá'.split('_'), - longDateFormat : { - LT : 'HH.mm', - LTS : 'HH.mm.ss', - L : 'DD.MM.YYYY', - LL : 'D. MMMM [dallas] YYYY', - LLL : 'D. MMMM [dallas] YYYY HH.mm', - LLLL : 'dddd, [li] D. MMMM [dallas] YYYY HH.mm' - }, - meridiemParse: /d\'o|d\'a/i, - isPM : function (input) { - return 'd\'o' === input.toLowerCase(); - }, - meridiem : function (hours, minutes, isLower) { - if (hours > 11) { - return isLower ? 'd\'o' : 'D\'O'; - } else { - return isLower ? 'd\'a' : 'D\'A'; - } - }, - calendar : { - sameDay : '[oxhi à] LT', - nextDay : '[demà à] LT', - nextWeek : 'dddd [à] LT', - lastDay : '[ieiri à] LT', - lastWeek : '[sür el] dddd [lasteu à] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'osprei %s', - past : 'ja%s', - s : processRelativeTime, - m : processRelativeTime, - mm : processRelativeTime, - h : processRelativeTime, - hh : processRelativeTime, - d : processRelativeTime, - dd : processRelativeTime, - M : processRelativeTime, - MM : processRelativeTime, - y : processRelativeTime, - yy : processRelativeTime - }, - ordinalParse: /\d{1,2}\./, - ordinal : '%d.', - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - function processRelativeTime(number, withoutSuffix, key, isFuture) { - var format = { - 's': ['viensas secunds', '\'iensas secunds'], - 'm': ['\'n míut', '\'iens míut'], - 'mm': [number + ' míuts', '' + number + ' míuts'], - 'h': ['\'n þora', '\'iensa þora'], - 'hh': [number + ' þoras', '' + number + ' þoras'], - 'd': ['\'n ziua', '\'iensa ziua'], - 'dd': [number + ' ziuas', '' + number + ' ziuas'], - 'M': ['\'n mes', '\'iens mes'], - 'MM': [number + ' mesen', '' + number + ' mesen'], - 'y': ['\'n ar', '\'iens ar'], - 'yy': [number + ' ars', '' + number + ' ars'] - }; - return isFuture ? format[key][0] : (withoutSuffix ? format[key][0] : format[key][1]); - } - - return tzl; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/tzm-latn.js b/apps/meteor/private/moment-locales/tzm-latn.js deleted file mode 100644 index ccf96b992e82..000000000000 --- a/apps/meteor/private/moment-locales/tzm-latn.js +++ /dev/null @@ -1,58 +0,0 @@ -//! moment.js locale configuration -//! locale : Central Atlas Tamazight Latin [tzm-latn] -//! author : Abdel Said : https://github.com/abdelsaid - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var tzm_latn = moment.defineLocale('tzm-latn', { - months : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'), - monthsShort : 'innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir'.split('_'), - weekdays : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), - weekdaysShort : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), - weekdaysMin : 'asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[asdkh g] LT', - nextDay: '[aska g] LT', - nextWeek: 'dddd [g] LT', - lastDay: '[assant g] LT', - lastWeek: 'dddd [g] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'dadkh s yan %s', - past : 'yan %s', - s : 'imik', - m : 'minuḍ', - mm : '%d minuḍ', - h : 'saɛa', - hh : '%d tassaɛin', - d : 'ass', - dd : '%d ossan', - M : 'ayowr', - MM : '%d iyyirn', - y : 'asgas', - yy : '%d isgasn' - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); - - return tzm_latn; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/tzm.js b/apps/meteor/private/moment-locales/tzm.js deleted file mode 100644 index 71fb076ae2b5..000000000000 --- a/apps/meteor/private/moment-locales/tzm.js +++ /dev/null @@ -1,58 +0,0 @@ -//! moment.js locale configuration -//! locale : Central Atlas Tamazight [tzm] -//! author : Abdel Said : https://github.com/abdelsaid - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var tzm = moment.defineLocale('tzm', { - months : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), - monthsShort : 'ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ'.split('_'), - weekdays : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), - weekdaysShort : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), - weekdaysMin : 'ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS: 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd D MMMM YYYY HH:mm' - }, - calendar : { - sameDay: '[ⴰⵙⴷⵅ ⴴ] LT', - nextDay: '[ⴰⵙⴽⴰ ⴴ] LT', - nextWeek: 'dddd [ⴴ] LT', - lastDay: '[ⴰⵚⴰⵏⵜ ⴴ] LT', - lastWeek: 'dddd [ⴴ] LT', - sameElse: 'L' - }, - relativeTime : { - future : 'ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s', - past : 'ⵢⴰⵏ %s', - s : 'ⵉⵎⵉⴽ', - m : 'ⵎⵉⵏⵓⴺ', - mm : '%d ⵎⵉⵏⵓⴺ', - h : 'ⵙⴰⵄⴰ', - hh : '%d ⵜⴰⵙⵙⴰⵄⵉⵏ', - d : 'ⴰⵙⵙ', - dd : '%d oⵙⵙⴰⵏ', - M : 'ⴰⵢoⵓⵔ', - MM : '%d ⵉⵢⵢⵉⵔⵏ', - y : 'ⴰⵙⴳⴰⵙ', - yy : '%d ⵉⵙⴳⴰⵙⵏ' - }, - week : { - dow : 6, // Saturday is the first day of the week. - doy : 12 // The week that contains Jan 1st is the first week of the year. - } - }); - - return tzm; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/uk.js b/apps/meteor/private/moment-locales/uk.js deleted file mode 100644 index 91ec18bf74fe..000000000000 --- a/apps/meteor/private/moment-locales/uk.js +++ /dev/null @@ -1,146 +0,0 @@ -//! moment.js locale configuration -//! locale : Ukrainian [uk] -//! author : zemlanin : https://github.com/zemlanin -//! Author : Menelion Elensúle : https://github.com/Oire - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - function plural(word, num) { - var forms = word.split('_'); - return num % 10 === 1 && num % 100 !== 11 ? forms[0] : (num % 10 >= 2 && num % 10 <= 4 && (num % 100 < 10 || num % 100 >= 20) ? forms[1] : forms[2]); - } - function relativeTimeWithPlural(number, withoutSuffix, key) { - var format = { - 'mm': withoutSuffix ? 'хвилина_хвилини_хвилин' : 'хвилину_хвилини_хвилин', - 'hh': withoutSuffix ? 'година_години_годин' : 'годину_години_годин', - 'dd': 'день_дні_днів', - 'MM': 'місяць_місяці_місяців', - 'yy': 'рік_роки_років' - }; - if (key === 'm') { - return withoutSuffix ? 'хвилина' : 'хвилину'; - } - else if (key === 'h') { - return withoutSuffix ? 'година' : 'годину'; - } - else { - return number + ' ' + plural(format[key], +number); - } - } - function weekdaysCaseReplace(m, format) { - var weekdays = { - 'nominative': 'неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота'.split('_'), - 'accusative': 'неділю_понеділок_вівторок_середу_четвер_п’ятницю_суботу'.split('_'), - 'genitive': 'неділі_понеділка_вівторка_середи_четверга_п’ятниці_суботи'.split('_') - }, - nounCase = (/(\[[ВвУу]\]) ?dddd/).test(format) ? - 'accusative' : - ((/\[?(?:минулої|наступної)? ?\] ?dddd/).test(format) ? - 'genitive' : - 'nominative'); - return weekdays[nounCase][m.day()]; - } - function processHoursFunction(str) { - return function () { - return str + 'о' + (this.hours() === 11 ? 'б' : '') + '] LT'; - }; - } - - var uk = moment.defineLocale('uk', { - months : { - 'format': 'січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня'.split('_'), - 'standalone': 'січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень'.split('_') - }, - monthsShort : 'січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд'.split('_'), - weekdays : weekdaysCaseReplace, - weekdaysShort : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), - weekdaysMin : 'нд_пн_вт_ср_чт_пт_сб'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD.MM.YYYY', - LL : 'D MMMM YYYY р.', - LLL : 'D MMMM YYYY р., HH:mm', - LLLL : 'dddd, D MMMM YYYY р., HH:mm' - }, - calendar : { - sameDay: processHoursFunction('[Сьогодні '), - nextDay: processHoursFunction('[Завтра '), - lastDay: processHoursFunction('[Вчора '), - nextWeek: processHoursFunction('[У] dddd ['), - lastWeek: function () { - switch (this.day()) { - case 0: - case 3: - case 5: - case 6: - return processHoursFunction('[Минулої] dddd [').call(this); - case 1: - case 2: - case 4: - return processHoursFunction('[Минулого] dddd [').call(this); - } - }, - sameElse: 'L' - }, - relativeTime : { - future : 'за %s', - past : '%s тому', - s : 'декілька секунд', - m : relativeTimeWithPlural, - mm : relativeTimeWithPlural, - h : 'годину', - hh : relativeTimeWithPlural, - d : 'день', - dd : relativeTimeWithPlural, - M : 'місяць', - MM : relativeTimeWithPlural, - y : 'рік', - yy : relativeTimeWithPlural - }, - // M. E.: those two are virtually unused but a user might want to implement them for his/her website for some reason - meridiemParse: /ночі|ранку|дня|вечора/, - isPM: function (input) { - return /^(дня|вечора)$/.test(input); - }, - meridiem : function (hour, minute, isLower) { - if (hour < 4) { - return 'ночі'; - } else if (hour < 12) { - return 'ранку'; - } else if (hour < 17) { - return 'дня'; - } else { - return 'вечора'; - } - }, - ordinalParse: /\d{1,2}-(й|го)/, - ordinal: function (number, period) { - switch (period) { - case 'M': - case 'd': - case 'DDD': - case 'w': - case 'W': - return number + '-й'; - case 'D': - return number + '-го'; - default: - return number; - } - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 1st is the first week of the year. - } - }); - - return uk; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/uz.js b/apps/meteor/private/moment-locales/uz.js deleted file mode 100644 index 3fccde184577..000000000000 --- a/apps/meteor/private/moment-locales/uz.js +++ /dev/null @@ -1,58 +0,0 @@ -//! moment.js locale configuration -//! locale : Uzbek [uz] -//! author : Sardor Muminov : https://github.com/muminoff - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var uz = moment.defineLocale('uz', { - months : 'январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр'.split('_'), - monthsShort : 'янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек'.split('_'), - weekdays : 'Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба'.split('_'), - weekdaysShort : 'Якш_Душ_Сеш_Чор_Пай_Жум_Шан'.split('_'), - weekdaysMin : 'Як_Ду_Се_Чо_Па_Жу_Ша'.split('_'), - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'D MMMM YYYY, dddd HH:mm' - }, - calendar : { - sameDay : '[Бугун соат] LT [да]', - nextDay : '[Эртага] LT [да]', - nextWeek : 'dddd [куни соат] LT [да]', - lastDay : '[Кеча соат] LT [да]', - lastWeek : '[Утган] dddd [куни соат] LT [да]', - sameElse : 'L' - }, - relativeTime : { - future : 'Якин %s ичида', - past : 'Бир неча %s олдин', - s : 'фурсат', - m : 'бир дакика', - mm : '%d дакика', - h : 'бир соат', - hh : '%d соат', - d : 'бир кун', - dd : '%d кун', - M : 'бир ой', - MM : '%d ой', - y : 'бир йил', - yy : '%d йил' - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 7 // The week that contains Jan 4th is the first week of the year. - } - }); - - return uz; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/vi.js b/apps/meteor/private/moment-locales/vi.js deleted file mode 100644 index ba207e93ed03..000000000000 --- a/apps/meteor/private/moment-locales/vi.js +++ /dev/null @@ -1,79 +0,0 @@ -//! moment.js locale configuration -//! locale : Vietnamese [vi] -//! author : Bang Nguyen : https://github.com/bangnk - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var vi = moment.defineLocale('vi', { - months : 'tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12'.split('_'), - monthsShort : 'Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12'.split('_'), - monthsParseExact : true, - weekdays : 'chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy'.split('_'), - weekdaysShort : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), - weekdaysMin : 'CN_T2_T3_T4_T5_T6_T7'.split('_'), - weekdaysParseExact : true, - meridiemParse: /sa|ch/i, - isPM : function (input) { - return /^ch$/i.test(input); - }, - meridiem : function (hours, minutes, isLower) { - if (hours < 12) { - return isLower ? 'sa' : 'SA'; - } else { - return isLower ? 'ch' : 'CH'; - } - }, - longDateFormat : { - LT : 'HH:mm', - LTS : 'HH:mm:ss', - L : 'DD/MM/YYYY', - LL : 'D MMMM [năm] YYYY', - LLL : 'D MMMM [năm] YYYY HH:mm', - LLLL : 'dddd, D MMMM [năm] YYYY HH:mm', - l : 'DD/M/YYYY', - ll : 'D MMM YYYY', - lll : 'D MMM YYYY HH:mm', - llll : 'ddd, D MMM YYYY HH:mm' - }, - calendar : { - sameDay: '[Hôm nay lúc] LT', - nextDay: '[Ngày mai lúc] LT', - nextWeek: 'dddd [tuần tới lúc] LT', - lastDay: '[Hôm qua lúc] LT', - lastWeek: 'dddd [tuần rồi lúc] LT', - sameElse: 'L' - }, - relativeTime : { - future : '%s tới', - past : '%s trước', - s : 'vài giây', - m : 'một phút', - mm : '%d phút', - h : 'một giờ', - hh : '%d giờ', - d : 'một ngày', - dd : '%d ngày', - M : 'một tháng', - MM : '%d tháng', - y : 'một năm', - yy : '%d năm' - }, - ordinalParse: /\d{1,2}/, - ordinal : function (number) { - return number; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return vi; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/x-pseudo.js b/apps/meteor/private/moment-locales/x-pseudo.js deleted file mode 100644 index f573d4c1a7bd..000000000000 --- a/apps/meteor/private/moment-locales/x-pseudo.js +++ /dev/null @@ -1,68 +0,0 @@ -//! moment.js locale configuration -//! locale : Pseudo [x-pseudo] -//! author : Andrew Hood : https://github.com/andrewhood125 - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var x_pseudo = moment.defineLocale('x-pseudo', { - months : 'J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér'.split('_'), - monthsShort : 'J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc'.split('_'), - monthsParseExact : true, - weekdays : 'S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý'.split('_'), - weekdaysShort : 'S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát'.split('_'), - weekdaysMin : 'S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá'.split('_'), - weekdaysParseExact : true, - longDateFormat : { - LT : 'HH:mm', - L : 'DD/MM/YYYY', - LL : 'D MMMM YYYY', - LLL : 'D MMMM YYYY HH:mm', - LLLL : 'dddd, D MMMM YYYY HH:mm' - }, - calendar : { - sameDay : '[T~ódá~ý át] LT', - nextDay : '[T~ómó~rró~w át] LT', - nextWeek : 'dddd [át] LT', - lastDay : '[Ý~ést~érdá~ý át] LT', - lastWeek : '[L~ást] dddd [át] LT', - sameElse : 'L' - }, - relativeTime : { - future : 'í~ñ %s', - past : '%s á~gó', - s : 'á ~féw ~sécó~ñds', - m : 'á ~míñ~úté', - mm : '%d m~íñú~tés', - h : 'á~ñ hó~úr', - hh : '%d h~óúrs', - d : 'á ~dáý', - dd : '%d d~áýs', - M : 'á ~móñ~th', - MM : '%d m~óñt~hs', - y : 'á ~ýéár', - yy : '%d ý~éárs' - }, - ordinalParse: /\d{1,2}(th|st|nd|rd)/, - ordinal : function (number) { - var b = number % 10, - output = (~~(number % 100 / 10) === 1) ? 'th' : - (b === 1) ? 'st' : - (b === 2) ? 'nd' : - (b === 3) ? 'rd' : 'th'; - return number + output; - }, - week : { - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return x_pseudo; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/zh-cn.js b/apps/meteor/private/moment-locales/zh-cn.js deleted file mode 100644 index cee6160fbc14..000000000000 --- a/apps/meteor/private/moment-locales/zh-cn.js +++ /dev/null @@ -1,127 +0,0 @@ -//! moment.js locale configuration -//! locale : Chinese (China) [zh-cn] -//! author : suupic : https://github.com/suupic -//! author : Zeno Zeng : https://github.com/zenozeng - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var zh_cn = moment.defineLocale('zh-cn', { - months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), - monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), - weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), - weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'), - weekdaysMin : '日_一_二_三_四_五_六'.split('_'), - longDateFormat : { - LT : 'Ah点mm分', - LTS : 'Ah点m分s秒', - L : 'YYYY-MM-DD', - LL : 'YYYY年MMMD日', - LLL : 'YYYY年MMMD日Ah点mm分', - LLLL : 'YYYY年MMMD日ddddAh点mm分', - l : 'YYYY-MM-DD', - ll : 'YYYY年MMMD日', - lll : 'YYYY年MMMD日Ah点mm分', - llll : 'YYYY年MMMD日ddddAh点mm分' - }, - meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, - meridiemHour: function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === '凌晨' || meridiem === '早上' || - meridiem === '上午') { - return hour; - } else if (meridiem === '下午' || meridiem === '晚上') { - return hour + 12; - } else { - // '中午' - return hour >= 11 ? hour : hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 600) { - return '凌晨'; - } else if (hm < 900) { - return '早上'; - } else if (hm < 1130) { - return '上午'; - } else if (hm < 1230) { - return '中午'; - } else if (hm < 1800) { - return '下午'; - } else { - return '晚上'; - } - }, - calendar : { - sameDay : function () { - return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT'; - }, - nextDay : function () { - return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT'; - }, - lastDay : function () { - return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT'; - }, - nextWeek : function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.diff(startOfWeek, 'days') >= 7 ? '[下]' : '[本]'; - return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; - }, - lastWeek : function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]'; - return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; - }, - sameElse : 'LL' - }, - ordinalParse: /\d{1,2}(日|月|周)/, - ordinal : function (number, period) { - switch (period) { - case 'd': - case 'D': - case 'DDD': - return number + '日'; - case 'M': - return number + '月'; - case 'w': - case 'W': - return number + '周'; - default: - return number; - } - }, - relativeTime : { - future : '%s内', - past : '%s前', - s : '几秒', - m : '1 分钟', - mm : '%d 分钟', - h : '1 小时', - hh : '%d 小时', - d : '1 天', - dd : '%d 天', - M : '1 个月', - MM : '%d 个月', - y : '1 年', - yy : '%d 年' - }, - week : { - // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return zh_cn; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/zh-tw.js b/apps/meteor/private/moment-locales/zh-tw.js deleted file mode 100644 index c6766c8b682f..000000000000 --- a/apps/meteor/private/moment-locales/zh-tw.js +++ /dev/null @@ -1,104 +0,0 @@ -//! moment.js locale configuration -//! locale : Chinese (Taiwan) [zh-tw] -//! author : Ben : https://github.com/ben-lin -//! author : Chris Lam : https://github.com/hehachris - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var zh_tw = moment.defineLocale('zh-tw', { - months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), - monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), - weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), - weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'), - weekdaysMin : '日_一_二_三_四_五_六'.split('_'), - longDateFormat : { - LT : 'Ah點mm分', - LTS : 'Ah點m分s秒', - L : 'YYYY年MMMD日', - LL : 'YYYY年MMMD日', - LLL : 'YYYY年MMMD日Ah點mm分', - LLLL : 'YYYY年MMMD日ddddAh點mm分', - l : 'YYYY年MMMD日', - ll : 'YYYY年MMMD日', - lll : 'YYYY年MMMD日Ah點mm分', - llll : 'YYYY年MMMD日ddddAh點mm分' - }, - meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, - meridiemHour : function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === '凌晨' || meridiem === '早上' || meridiem === '上午') { - return hour; - } else if (meridiem === '中午') { - return hour >= 11 ? hour : hour + 12; - } else if (meridiem === '下午' || meridiem === '晚上') { - return hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 600) { - return '凌晨'; - } else if (hm < 900) { - return '早上'; - } else if (hm < 1130) { - return '上午'; - } else if (hm < 1230) { - return '中午'; - } else if (hm < 1800) { - return '下午'; - } else { - return '晚上'; - } - }, - calendar : { - sameDay : '[今天]LT', - nextDay : '[明天]LT', - nextWeek : '[下]ddddLT', - lastDay : '[昨天]LT', - lastWeek : '[上]ddddLT', - sameElse : 'L' - }, - ordinalParse: /\d{1,2}(日|月|週)/, - ordinal : function (number, period) { - switch (period) { - case 'd' : - case 'D' : - case 'DDD' : - return number + '日'; - case 'M' : - return number + '月'; - case 'w' : - case 'W' : - return number + '週'; - default : - return number; - } - }, - relativeTime : { - future : '%s內', - past : '%s前', - s : '幾秒', - m : '1 分鐘', - mm : '%d 分鐘', - h : '1 小時', - hh : '%d 小時', - d : '1 天', - dd : '%d 天', - M : '1 個月', - MM : '%d 個月', - y : '1 年', - yy : '%d 年' - } - }); - - return zh_tw; - -})); \ No newline at end of file diff --git a/apps/meteor/private/moment-locales/zh.js b/apps/meteor/private/moment-locales/zh.js deleted file mode 100644 index cee6160fbc14..000000000000 --- a/apps/meteor/private/moment-locales/zh.js +++ /dev/null @@ -1,127 +0,0 @@ -//! moment.js locale configuration -//! locale : Chinese (China) [zh-cn] -//! author : suupic : https://github.com/suupic -//! author : Zeno Zeng : https://github.com/zenozeng - -;(function (global, factory) { - typeof exports === 'object' && typeof module !== 'undefined' - && typeof require === 'function' ? factory(require('../moment')) : - typeof define === 'function' && define.amd ? define(['../moment'], factory) : - factory(global.moment) -}(this, function (moment) { 'use strict'; - - - var zh_cn = moment.defineLocale('zh-cn', { - months : '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'), - monthsShort : '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'), - weekdays : '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'), - weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'), - weekdaysMin : '日_一_二_三_四_五_六'.split('_'), - longDateFormat : { - LT : 'Ah点mm分', - LTS : 'Ah点m分s秒', - L : 'YYYY-MM-DD', - LL : 'YYYY年MMMD日', - LLL : 'YYYY年MMMD日Ah点mm分', - LLLL : 'YYYY年MMMD日ddddAh点mm分', - l : 'YYYY-MM-DD', - ll : 'YYYY年MMMD日', - lll : 'YYYY年MMMD日Ah点mm分', - llll : 'YYYY年MMMD日ddddAh点mm分' - }, - meridiemParse: /凌晨|早上|上午|中午|下午|晚上/, - meridiemHour: function (hour, meridiem) { - if (hour === 12) { - hour = 0; - } - if (meridiem === '凌晨' || meridiem === '早上' || - meridiem === '上午') { - return hour; - } else if (meridiem === '下午' || meridiem === '晚上') { - return hour + 12; - } else { - // '中午' - return hour >= 11 ? hour : hour + 12; - } - }, - meridiem : function (hour, minute, isLower) { - var hm = hour * 100 + minute; - if (hm < 600) { - return '凌晨'; - } else if (hm < 900) { - return '早上'; - } else if (hm < 1130) { - return '上午'; - } else if (hm < 1230) { - return '中午'; - } else if (hm < 1800) { - return '下午'; - } else { - return '晚上'; - } - }, - calendar : { - sameDay : function () { - return this.minutes() === 0 ? '[今天]Ah[点整]' : '[今天]LT'; - }, - nextDay : function () { - return this.minutes() === 0 ? '[明天]Ah[点整]' : '[明天]LT'; - }, - lastDay : function () { - return this.minutes() === 0 ? '[昨天]Ah[点整]' : '[昨天]LT'; - }, - nextWeek : function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.diff(startOfWeek, 'days') >= 7 ? '[下]' : '[本]'; - return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; - }, - lastWeek : function () { - var startOfWeek, prefix; - startOfWeek = moment().startOf('week'); - prefix = this.unix() < startOfWeek.unix() ? '[上]' : '[本]'; - return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm'; - }, - sameElse : 'LL' - }, - ordinalParse: /\d{1,2}(日|月|周)/, - ordinal : function (number, period) { - switch (period) { - case 'd': - case 'D': - case 'DDD': - return number + '日'; - case 'M': - return number + '月'; - case 'w': - case 'W': - return number + '周'; - default: - return number; - } - }, - relativeTime : { - future : '%s内', - past : '%s前', - s : '几秒', - m : '1 分钟', - mm : '%d 分钟', - h : '1 小时', - hh : '%d 小时', - d : '1 天', - dd : '%d 天', - M : '1 个月', - MM : '%d 个月', - y : '1 年', - yy : '%d 年' - }, - week : { - // GB/T 7408-1994《数据元和交换格式·信息交换·日期和时间表示法》与ISO 8601:1988等效 - dow : 1, // Monday is the first day of the week. - doy : 4 // The week that contains Jan 4th is the first week of the year. - } - }); - - return zh_cn; - -})); \ No newline at end of file From eccaf085eac2b469f770c8c97ecacd09b9b592fc Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Fri, 15 Sep 2023 17:52:00 -0300 Subject: [PATCH 147/275] Bump version to 6.5.0-develop --- apps/meteor/.docker/Dockerfile.rhel | 2 +- apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/package.json | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/meteor/.docker/Dockerfile.rhel b/apps/meteor/.docker/Dockerfile.rhel index 9f03ae9f3db4..1481b0445e45 100644 --- a/apps/meteor/.docker/Dockerfile.rhel +++ b/apps/meteor/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 6.4.0-develop +ENV RC_VERSION 6.5.0-develop MAINTAINER buildmaster@rocket.chat diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index a5d2fcb9bc57..b9e235456291 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.4.0-develop" + "version": "6.5.0-develop" } diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 1e1d7e03ce02..4954c22a319b 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.4.0-develop", + "version": "6.5.0-develop", "private": true, "author": { "name": "Rocket.Chat", diff --git a/package.json b/package.json index 47f10019e2cc..7d3e08d4f5a6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.4.0-develop", + "version": "6.5.0-develop", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, From b3fa016832c343711e9a617798c06473bf72c40c Mon Sep 17 00:00:00 2001 From: janainaCoelhoRocketchat <105796517+janainaCoelhoRocketchat@users.noreply.github.com> Date: Fri, 15 Sep 2023 21:15:28 -0300 Subject: [PATCH 148/275] test: create non private team and readonly team (#30371) --- .../header/CreateTeam/CreateTeamModal.tsx | 95 ++++++++++++++----- .../tests/e2e/page-objects/home-team.ts | 10 +- apps/meteor/tests/e2e/team-management.spec.ts | 26 ++++- 3 files changed, 102 insertions(+), 29 deletions(-) diff --git a/apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.tsx b/apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.tsx index 1f12c2b59b49..9907aa788894 100644 --- a/apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.tsx +++ b/apps/meteor/client/sidebar/header/CreateTeam/CreateTeamModal.tsx @@ -1,15 +1,16 @@ -import { Box, Modal, Button, TextInput, Field, ToggleSwitch, FieldGroup, Icon } from '@rocket.chat/fuselage'; +import { Box, Button, Field, FieldGroup, Icon, Modal, TextInput, ToggleSwitch } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { - useTranslation, - useSetting, - usePermission, useEndpoint, - useToastMessageDispatch, + usePermission, usePermissionWithScopedRoles, + useSetting, + useToastMessageDispatch, + useTranslation, } from '@rocket.chat/ui-contexts'; import type { ComponentProps, ReactElement } from 'react'; -import React, { memo, useMemo, useEffect } from 'react'; -import { useForm, Controller } from 'react-hook-form'; +import React, { memo, useEffect, useMemo } from 'react'; +import { Controller, useForm } from 'react-hook-form'; import UserAutoCompleteMultiple from '../../../components/UserAutoCompleteMultiple'; import { goToRoomById } from '../../../lib/utils/goToRoomById'; @@ -129,18 +130,35 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement => } }; + const createTeamFormId = useUniqueId(); + const nameId = useUniqueId(); + const topicId = useUniqueId(); + const privateId = useUniqueId(); + const readOnlyId = useUniqueId(); + const encryptedId = useUniqueId(); + const broadcastId = useUniqueId(); + const addMembersId = useUniqueId(); + return ( - ) => }> + ) => ( + + )} + > - {t('Teams_New_Title')} + {t('Teams_New_Title')} - {t('Teams_New_Name_Label')} + + {t('Teams_New_Name_Label')} + void }): ReactElement => placeholder={t('Team_Name')} addon={} error={errors.name?.message} + aria-describedby={`${nameId}-error`} + aria-required='true' /> - {errors?.name && {errors.name.message}} + {errors?.name && ( + + {errors.name.message} + + )} - + {t('Teams_New_Description_Label')}{' '} ({t('optional')}) - + - {t('Teams_New_Private_Label')} - + {t('Teams_New_Private_Label')} + {isPrivate ? t('Teams_New_Private_Description_Enabled') : t('Teams_New_Private_Description_Disabled')} @@ -176,7 +205,7 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement => control={control} name='isPrivate' render={({ field: { onChange, value, ref } }): ReactElement => ( - + )} /> @@ -184,8 +213,8 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement => - {t('Teams_New_Read_only_Label')} - + {t('Teams_New_Read_only_Label')} + {readOnly ? t('Only_authorized_users_can_write_new_messages') : t('Teams_New_Read_only_Description')} @@ -193,7 +222,14 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement => control={control} name='readOnly' render={({ field: { onChange, value, ref } }): ReactElement => ( - + )} /> @@ -201,8 +237,8 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement => - {t('Teams_New_Encrypted_Label')} - + {t('Teams_New_Encrypted_Label')} + {isPrivate ? t('Teams_New_Encrypted_Description_Enabled') : t('Teams_New_Encrypted_Description_Disabled')} @@ -210,7 +246,14 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement => control={control} name='encrypted' render={({ field: { onChange, value, ref } }): ReactElement => ( - + )} /> @@ -218,20 +261,20 @@ const CreateTeamModal = ({ onClose }: { onClose: () => void }): ReactElement => - {t('Teams_New_Broadcast_Label')} - {t('Teams_New_Broadcast_Description')} + {t('Teams_New_Broadcast_Label')} + {t('Teams_New_Broadcast_Description')} ( - + )} /> - + {t('Teams_New_Add_members_Label')}{' '} ({t('optional')}) diff --git a/apps/meteor/tests/e2e/page-objects/home-team.ts b/apps/meteor/tests/e2e/page-objects/home-team.ts index 24e8396979c9..9c890da05db8 100644 --- a/apps/meteor/tests/e2e/page-objects/home-team.ts +++ b/apps/meteor/tests/e2e/page-objects/home-team.ts @@ -1,6 +1,6 @@ import type { Locator, Page } from '@playwright/test'; -import { HomeContent, HomeSidenav, HomeFlextab } from './fragments'; +import { HomeContent, HomeFlextab, HomeSidenav } from './fragments'; export class HomeTeam { private readonly page: Page; @@ -30,4 +30,12 @@ export class HomeTeam { get btnTeamCreate(): Locator { return this.page.locator('role=dialog >> role=group >> role=button[name=Create]'); } + + get textPrivate(): Locator { + return this.page.locator('role=dialog[name="Create Team"] >> label >> text="Private"'); + } + + get textReadOnly(): Locator { + return this.page.locator('role=dialog[name="Create Team"] >> label >> text="Read Only"'); + } } diff --git a/apps/meteor/tests/e2e/team-management.spec.ts b/apps/meteor/tests/e2e/team-management.spec.ts index ee2220966d8d..338f5c5eb0ef 100644 --- a/apps/meteor/tests/e2e/team-management.spec.ts +++ b/apps/meteor/tests/e2e/team-management.spec.ts @@ -3,7 +3,7 @@ import { faker } from '@faker-js/faker'; import { Users } from './fixtures/userStates'; import { HomeTeam } from './page-objects'; import { createTargetChannel } from './utils'; -import { test, expect } from './utils/test'; +import { expect, test } from './utils/test'; test.use({ storageState: Users.admin.state }); @@ -11,6 +11,8 @@ test.describe.serial('teams-management', () => { let poHomeTeam: HomeTeam; let targetChannel: string; const targetTeam = faker.string.uuid(); + const targetTeamNonPrivate = faker.string.uuid(); + const targetTeamReadOnly = faker.string.uuid(); test.beforeAll(async ({ api }) => { targetChannel = await createTargetChannel(api); @@ -22,7 +24,7 @@ test.describe.serial('teams-management', () => { await page.goto('/home'); }); - test('expect create "targetTeam"', async ({ page }) => { + test('expect create "targetTeam" private', async ({ page }) => { await poHomeTeam.sidenav.openNewByLabel('Team'); await poHomeTeam.inputTeamName.type(targetTeam); await poHomeTeam.addMember('user1'); @@ -31,6 +33,26 @@ test.describe.serial('teams-management', () => { await expect(page).toHaveURL(`/group/${targetTeam}`); }); + test('expect create "targetTeamNonPrivate" non private', async ({ page }) => { + await poHomeTeam.sidenav.openNewByLabel('Team'); + await poHomeTeam.inputTeamName.type(targetTeamNonPrivate); + await poHomeTeam.textPrivate.click(); + await poHomeTeam.addMember('user1'); + await poHomeTeam.btnTeamCreate.click(); + + await expect(page).toHaveURL(`/channel/${targetTeamNonPrivate}`); + }); + + test('expect create "targetTeamReadOnly" readonly', async ({ page }) => { + await poHomeTeam.sidenav.openNewByLabel('Team'); + await poHomeTeam.inputTeamName.type(targetTeamReadOnly); + await poHomeTeam.textReadOnly.click(); + await poHomeTeam.addMember('user1'); + await poHomeTeam.btnTeamCreate.click(); + + await expect(page).toHaveURL(`/group/${targetTeamReadOnly}`); + }); + test('expect throw validation error if team name already exists', async () => { await poHomeTeam.sidenav.openNewByLabel('Team'); await poHomeTeam.inputTeamName.type(targetTeam); From f46c1f7b703b12f368c4ccad0a39a5f34edd9dd7 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Sat, 16 Sep 2023 01:25:05 +0000 Subject: [PATCH 149/275] Release 6.4.0-rc.2 [no ci] --- .changeset/bump-patch-1694827499043.md | 5 ++++ .changeset/pre.json | 1 + apps/meteor/.docker/Dockerfile.rhel | 2 +- apps/meteor/CHANGELOG.md | 25 +++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 11 ++++++++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 11 ++++++++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 11 ++++++++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 13 ++++++++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 11 ++++++++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 11 ++++++++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 11 ++++++++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 10 ++++++++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 8 ++++++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 8 ++++++ ee/packages/ddp-client/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 12 +++++++++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 7 ++++++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 9 +++++++ ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 9 +++++++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 3 +++ packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 8 ++++++ packages/cron/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 9 +++++++ packages/fuselage-ui-kit/package.json | 6 ++--- packages/gazzodown/CHANGELOG.md | 9 +++++++ packages/gazzodown/package.json | 8 +++--- packages/instance-status/CHANGELOG.md | 7 ++++++ packages/instance-status/package.json | 2 +- packages/livechat/CHANGELOG.md | 6 +++++ packages/livechat/package.json | 2 +- packages/model-typings/CHANGELOG.md | 7 ++++++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 7 ++++++ packages/models/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 7 ++++++ packages/rest-typings/package.json | 2 +- packages/ui-client/CHANGELOG.md | 7 ++++++ packages/ui-client/package.json | 4 +-- packages/ui-contexts/CHANGELOG.md | 9 +++++++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 7 ++++++ packages/ui-video-conf/package.json | 4 +-- packages/uikit-playground/CHANGELOG.md | 8 ++++++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 7 ++++++ packages/web-ui-registration/package.json | 4 +-- 63 files changed, 314 insertions(+), 40 deletions(-) create mode 100644 .changeset/bump-patch-1694827499043.md diff --git a/.changeset/bump-patch-1694827499043.md b/.changeset/bump-patch-1694827499043.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1694827499043.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/.changeset/pre.json b/.changeset/pre.json index bf2911665af5..e1a8413aec27 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -57,6 +57,7 @@ "bright-snakes-vanish", "brown-clouds-add", "bump-patch-1694741499930", + "bump-patch-1694827499043", "chilled-flies-fold", "chilled-phones-give", "cool-students-tan", diff --git a/apps/meteor/.docker/Dockerfile.rhel b/apps/meteor/.docker/Dockerfile.rhel index 037a4e51337e..527ebcc5bd1b 100644 --- a/apps/meteor/.docker/Dockerfile.rhel +++ b/apps/meteor/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 6.4.0-rc.1 +ENV RC_VERSION 6.4.0-rc.2 MAINTAINER buildmaster@rocket.chat diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index db7855b84991..ccf14c4c250a 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,29 @@ # @rocket.chat/meteor +## 6.4.0-rc.2 + +### Patch Changes + +- Bump @rocket.chat/meteor version. + - @rocket.chat/core-typings@6.4.0-rc.2 + - @rocket.chat/rest-typings@6.4.0-rc.2 + - @rocket.chat/api-client@0.1.7-rc.2 + - @rocket.chat/omnichannel-services@0.0.13-rc.2 + - @rocket.chat/pdf-worker@0.0.13-rc.2 + - @rocket.chat/presence@0.0.13-rc.2 + - @rocket.chat/core-services@0.2.0-rc.2 + - @rocket.chat/cron@0.0.9-rc.2 + - @rocket.chat/gazzodown@2.0.0-rc.2 + - @rocket.chat/model-typings@0.1.0-rc.2 + - @rocket.chat/ui-contexts@2.0.0-rc.2 + - @rocket.chat/fuselage-ui-kit@2.0.0-rc.2 + - @rocket.chat/models@0.0.13-rc.2 + - @rocket.chat/ui-theming@0.1.0-rc.0 + - @rocket.chat/ui-client@2.0.0-rc.2 + - @rocket.chat/ui-video-conf@2.0.0-rc.2 + - @rocket.chat/web-ui-registration@2.0.0-rc.2 + - @rocket.chat/instance-status@0.0.13-rc.2 + ## 6.4.0-rc.1 ### Patch Changes @@ -186,6 +210,7 @@ - @rocket.chat/random@1.2.1 - @rocket.chat/sha256@1.0.9 - @rocket.chat/ui-composer@0.0.1 + ## 6.3.6 ### Patch Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index 660bed4d191b..a20950daf15c 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.4.0-rc.1" + "version": "6.4.0-rc.2" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index 6d032b37f4ae..af8de00fa2e6 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,15 @@ # rocketchat-services +## 1.1.7-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/rest-typings@6.4.0-rc.2 +- @rocket.chat/core-services@0.2.0-rc.2 +- @rocket.chat/model-typings@0.1.0-rc.2 +- @rocket.chat/models@0.0.13-rc.2 + ## 1.1.7-rc.1 ### Patch Changes @@ -37,6 +47,7 @@ - @rocket.chat/model-typings@0.1.0-rc.0 - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 1.1.6 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 3ab8bd2abfd3..78c287bcee68 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.7-rc.1", + "version": "1.1.7-rc.2", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 568e96beff0d..181a97d81af6 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.4.0-rc.1", + "version": "6.4.0-rc.2", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index 269ce5961b3f..42cfee4dacda 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/account-service +## 0.2.7-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/rest-typings@6.4.0-rc.2 +- @rocket.chat/core-services@0.2.0-rc.2 +- @rocket.chat/model-typings@0.1.0-rc.2 +- @rocket.chat/models@0.0.13-rc.2 + ## 0.2.7-rc.1 ### Patch Changes @@ -37,6 +47,7 @@ - @rocket.chat/model-typings@0.1.0-rc.0 - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.2.6 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index 5eaf101e2561..b4b5dd413f31 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.2.7-rc.1", + "version": "0.2.7-rc.2", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index 469f334a1914..616d4029e915 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/authorization-service +## 0.2.7-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/rest-typings@6.4.0-rc.2 +- @rocket.chat/core-services@0.2.0-rc.2 +- @rocket.chat/model-typings@0.1.0-rc.2 +- @rocket.chat/models@0.0.13-rc.2 + ## 0.2.7-rc.1 ### Patch Changes @@ -37,6 +47,7 @@ - @rocket.chat/model-typings@0.1.0-rc.0 - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.2.6 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index 67541bcffc22..8bc3e5bf6695 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.2.7-rc.1", + "version": "0.2.7-rc.2", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index 31ecba3b2705..3b5dc23898ba 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/ddp-streamer +## 0.1.7-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/rest-typings@6.4.0-rc.2 +- @rocket.chat/core-services@0.2.0-rc.2 +- @rocket.chat/model-typings@0.1.0-rc.2 +- @rocket.chat/ui-contexts@2.0.0-rc.2 +- @rocket.chat/models@0.0.13-rc.2 +- @rocket.chat/instance-status@0.0.13-rc.2 + ## 0.1.7-rc.1 ### Patch Changes @@ -43,6 +55,7 @@ - @rocket.chat/ui-contexts@2.0.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 - @rocket.chat/instance-status@0.0.11-rc.0 + ## 0.1.6 ### Patch Changes diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 9b6e9120ac64..38eced4bdc20 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.1.7-rc.1", + "version": "0.1.7-rc.2", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index 3792b27f8777..538df8eab4db 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-transcript +## 0.2.7-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/omnichannel-services@0.0.13-rc.2 +- @rocket.chat/pdf-worker@0.0.13-rc.2 +- @rocket.chat/core-services@0.2.0-rc.2 +- @rocket.chat/model-typings@0.1.0-rc.2 +- @rocket.chat/models@0.0.13-rc.2 + ## 0.2.7-rc.1 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index d49a70a5ba97..943060057c5c 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.2.7-rc.1", + "version": "0.2.7-rc.2", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index 41ae24166a9d..9e3b10ff21b6 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/presence-service +## 0.2.7-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/presence@0.0.13-rc.2 +- @rocket.chat/core-services@0.2.0-rc.2 +- @rocket.chat/model-typings@0.1.0-rc.2 +- @rocket.chat/models@0.0.13-rc.2 + ## 0.2.7-rc.1 ### Patch Changes @@ -33,6 +43,7 @@ - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/presence@0.0.11-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.2.6 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index 7c7e148ba935..e3f53286e218 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.2.7-rc.1", + "version": "0.2.7-rc.2", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index 9e91d31dfa00..ce179e21061f 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/queue-worker +## 0.2.7-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/omnichannel-services@0.0.13-rc.2 +- @rocket.chat/core-services@0.2.0-rc.2 +- @rocket.chat/model-typings@0.1.0-rc.2 +- @rocket.chat/models@0.0.13-rc.2 + ## 0.2.7-rc.1 ### Patch Changes @@ -33,6 +43,7 @@ - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/omnichannel-services@0.0.11-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.2.6 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index f94aef6bc2cb..41ffca1a66da 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.2.7-rc.1", + "version": "0.2.7-rc.2", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index fcb6517da230..29b31439f4dc 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/stream-hub-service +## 0.2.7-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/core-services@0.2.0-rc.2 +- @rocket.chat/model-typings@0.1.0-rc.2 +- @rocket.chat/models@0.0.13-rc.2 + ## 0.2.7-rc.1 ### Patch Changes @@ -31,6 +40,7 @@ - @rocket.chat/model-typings@0.1.0-rc.0 - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.2.6 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index a204e8e472cc..176a46e38f7b 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.2.7-rc.1", + "version": "0.2.7-rc.2", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index 223cbcb9626e..c48d4d366376 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/api-client +## 0.1.7-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/rest-typings@6.4.0-rc.2 + ## 0.1.7-rc.1 ### Patch Changes @@ -25,6 +32,7 @@ - Updated dependencies [93d4912e17] - @rocket.chat/core-typings@6.4.0-rc.0 - @rocket.chat/rest-typings@6.4.0-rc.0 + ## 0.1.6 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index 963df9c96db5..92c1b021a3a6 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/api-client", - "version": "0.1.7-rc.1", + "version": "0.1.7-rc.2", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index 8b2691b5445f..36c493a9ca94 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/ddp-client +## 0.2.0-rc.2 + +### Patch Changes + +- @rocket.chat/rest-typings@6.4.0-rc.2 +- @rocket.chat/api-client@0.1.7-rc.2 + ## 0.2.0-rc.1 ### Patch Changes @@ -26,6 +33,7 @@ - Updated dependencies [93d4912e17] - @rocket.chat/rest-typings@6.4.0-rc.0 - @rocket.chat/api-client@0.1.5-rc.0 + ## 0.1.6 ### Patch Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index fe74871830c1..746297f44048 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ddp-client", - "version": "0.2.0-rc.1", + "version": "0.2.0-rc.2", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index 1465f2f6b96d..a9eeca91e09c 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-services +## 0.0.13-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/rest-typings@6.4.0-rc.2 +- @rocket.chat/pdf-worker@0.0.13-rc.2 +- @rocket.chat/core-services@0.2.0-rc.2 +- @rocket.chat/model-typings@0.1.0-rc.2 +- @rocket.chat/models@0.0.13-rc.2 + ## 0.0.13-rc.1 ### Patch Changes @@ -39,6 +50,7 @@ - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/pdf-worker@0.0.11-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.0.12 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 969ac8d4517e..e0f07f0d36a2 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.0.13-rc.1", + "version": "0.0.13-rc.2", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index 624f93717870..126d9f1a5341 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/pdf-worker +## 0.0.13-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 + ## 0.0.13-rc.1 ### Patch Changes @@ -18,6 +24,7 @@ - Updated dependencies [61128364d6] - Updated dependencies [d45365436e] - @rocket.chat/core-typings@6.4.0-rc.0 + ## 0.0.12 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index aeeb4c16303e..e2137e8b8adf 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.13-rc.1", + "version": "0.0.13-rc.2", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index df81eb37e1e0..67c58bc03c3d 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/presence +## 0.0.13-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/core-services@0.2.0-rc.2 +- @rocket.chat/models@0.0.13-rc.2 + ## 0.0.13-rc.1 ### Patch Changes @@ -24,6 +32,7 @@ - @rocket.chat/core-typings@6.4.0-rc.0 - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.0.12 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 63b1c585ec6a..5dadcc93e184 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.0.13-rc.1", + "version": "0.0.13-rc.2", "private": true, "devDependencies": { "@babel/core": "~7.22.9", diff --git a/package.json b/package.json index 978e0634a0ae..f1868518c353 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.4.0-rc.1", + "version": "6.4.0-rc.2", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index b2df91a73bd7..b9633f0946a2 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/core-services +## 0.2.0-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/rest-typings@6.4.0-rc.2 +- @rocket.chat/models@0.0.13-rc.2 + ## 0.2.0-rc.1 ### Patch Changes @@ -32,6 +40,7 @@ - @rocket.chat/core-typings@6.4.0-rc.0 - @rocket.chat/rest-typings@6.4.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.1.6 ### Patch Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index c5185a20d394..496d7b8ef9d0 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.2.0-rc.1", + "version": "0.2.0-rc.2", "private": true, "devDependencies": { "@babel/core": "~7.22.9", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index c6075ce782ba..312b39aa21a7 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,7 @@ # @rocket.chat/core-typings +## 6.4.0-rc.2 + ## 6.4.0-rc.1 ## 6.4.0-rc.0 @@ -16,6 +18,7 @@ - ba24f3c21f: Fixed `default` field not being returned from the `setDefault` endpoints when setting to false - 61128364d6: Fixes a problem where the calculated time for considering the visitor abandonment was the first message from the visitor and not the visitor's reply to the agent. - d45365436e: Use group filter when set to LDAP sync process + ## 6.3.6 ## 6.3.5 diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 5512e8fb5df4..70cf554f3783 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-typings", - "version": "6.4.0-rc.1", + "version": "6.4.0-rc.2", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index d763a70fc093..772a49bf8b71 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/cron +## 0.0.9-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/models@0.0.13-rc.2 + ## 0.0.9-rc.1 ### Patch Changes @@ -21,6 +28,7 @@ - @rocket.chat/core-typings@6.4.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 - @rocket.chat/random@1.2.1 + ## 0.0.8 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index ed418ed4dc5b..ba8d90e3a9ee 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.9-rc.1", + "version": "0.0.9-rc.2", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index a59fee43ac19..90aa7405e2e7 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 2.0.0-rc.2 + +### Patch Changes + +- @rocket.chat/gazzodown@2.0.0-rc.2 +- @rocket.chat/ui-contexts@2.0.0-rc.2 +- @rocket.chat/ui-video-conf@2.0.0-rc.2 + ## 2.0.0-rc.1 ### Patch Changes @@ -26,6 +34,7 @@ - @rocket.chat/eslint-config@0.6.0-rc.0 - @rocket.chat/gazzodown@2.0.0-rc.0 - @rocket.chat/ui-video-conf@2.0.0-rc.0 + ## 1.0.6 ### Patch Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index cb28e0699874..b6e4112d9be6 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "2.0.0-rc.1", + "version": "2.0.0-rc.2", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -46,9 +46,9 @@ "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.1", + "@rocket.chat/ui-contexts": "2.0.0-rc.2", "@rocket.chat/ui-kit": "*", - "@rocket.chat/ui-video-conf": "2.0.0-rc.1", + "@rocket.chat/ui-video-conf": "2.0.0-rc.2", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index 8eb779c96326..6e9f2877d0f1 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/gazzodown +## 2.0.0-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/ui-contexts@2.0.0-rc.2 +- @rocket.chat/ui-client@2.0.0-rc.2 + ## 2.0.0-rc.1 ### Patch Changes @@ -25,6 +33,7 @@ - @rocket.chat/core-typings@6.4.0-rc.0 - @rocket.chat/ui-client@2.0.0-rc.0 - @rocket.chat/ui-contexts@2.0.0-rc.0 + ## 1.0.6 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index 6f0d63803d66..4b7c54ccb109 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "2.0.0-rc.1", + "version": "2.0.0-rc.2", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.4.0-rc.1", + "@rocket.chat/core-typings": "6.4.0-rc.2", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "2.0.0-rc.1", - "@rocket.chat/ui-contexts": "2.0.0-rc.1", + "@rocket.chat/ui-client": "2.0.0-rc.2", + "@rocket.chat/ui-contexts": "2.0.0-rc.2", "katex": "*", "react": "*" }, diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index b060e21ba05a..48033e6f92f8 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/instance-status +## 0.0.13-rc.2 + +### Patch Changes + +- @rocket.chat/models@0.0.13-rc.2 + ## 0.0.13-rc.1 ### Patch Changes @@ -11,6 +17,7 @@ ### Patch Changes - @rocket.chat/models@0.0.13-rc.0 + ## 0.0.12 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 6fe5e2ecbd36..9a71c6203e5c 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.13-rc.1", + "version": "0.0.13-rc.2", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/livechat/CHANGELOG.md b/packages/livechat/CHANGELOG.md index 08ebfcb6dc18..e17e7c9a62f2 100644 --- a/packages/livechat/CHANGELOG.md +++ b/packages/livechat/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/livechat Change Log +## 1.14.0-rc.2 + +### Patch Changes + +- @rocket.chat/gazzodown@2.0.0-rc.2 + ## 1.14.0-rc.1 ### Patch Changes diff --git a/packages/livechat/package.json b/packages/livechat/package.json index b2ebd22a89f2..132297d59a48 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/livechat", - "version": "1.14.0-rc.1", + "version": "1.14.0-rc.2", "files": [ "/build" ], diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index bf8c21bf1eeb..71eb6c6aad76 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/model-typings +## 0.1.0-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 + ## 0.1.0-rc.1 ### Patch Changes @@ -31,6 +37,7 @@ - Updated dependencies [61128364d6] - Updated dependencies [d45365436e] - @rocket.chat/core-typings@6.4.0-rc.0 + ## 0.0.12 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index f9cbc45b910c..085eb12383b8 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.1.0-rc.1", + "version": "0.1.0-rc.2", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index f116a2b9f4fa..36e47f1babf6 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/models +## 0.0.13-rc.2 + +### Patch Changes + +- @rocket.chat/model-typings@0.1.0-rc.2 + ## 0.0.13-rc.1 ### Patch Changes @@ -18,6 +24,7 @@ - Updated dependencies [ead7c7bef2] - Updated dependencies [61128364d6] - @rocket.chat/model-typings@0.1.0-rc.0 + ## 0.0.12 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index 8ac94514b627..92c3abe80365 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.13-rc.1", + "version": "0.0.13-rc.2", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index 479c5baac925..bf4031c7a231 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/rest-typings +## 6.4.0-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 + ## 6.4.0-rc.1 ### Patch Changes @@ -30,6 +36,7 @@ - Updated dependencies [61128364d6] - Updated dependencies [d45365436e] - @rocket.chat/core-typings@6.4.0-rc.0 + ## 6.3.6 ### Patch Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 26b7de5653d3..468533a42928 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/rest-typings", - "version": "6.4.0-rc.1", + "version": "6.4.0-rc.2", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.3", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index 4141b97d6ff1..db0b15948348 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-client +## 2.0.0-rc.2 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.2 + ## 2.0.0-rc.1 ### Patch Changes @@ -19,6 +25,7 @@ - Updated dependencies [074db3b419] - Updated dependencies [b8f3d5014f] - @rocket.chat/ui-contexts@2.0.0-rc.0 + ## 1.0.6 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 4bfa46253f8e..4334fd3df806 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "2.0.0-rc.1", + "version": "2.0.0-rc.2", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -61,7 +61,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.1", + "@rocket.chat/ui-contexts": "2.0.0-rc.2", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index fa432dfd6c66..39e21c8d9b37 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/ui-contexts +## 2.0.0-rc.2 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.2 +- @rocket.chat/rest-typings@6.4.0-rc.2 +- @rocket.chat/ddp-client@0.2.0-rc.2 + ## 2.0.0-rc.1 ### Patch Changes @@ -34,6 +42,7 @@ - @rocket.chat/core-typings@6.4.0-rc.0 - @rocket.chat/rest-typings@6.4.0-rc.0 - @rocket.chat/ddp-client@0.2.0-rc.0 + ## 1.0.6 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 49c9fc82227a..e06fc1d1b201 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "2.0.0-rc.1", + "version": "2.0.0-rc.2", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index 3d39f00d7673..b715e3c0528a 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-video-conf +## 2.0.0-rc.2 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.2 + ## 2.0.0-rc.1 ### Patch Changes @@ -13,6 +19,7 @@ - Updated dependencies [074db3b419] - Updated dependencies [b8f3d5014f] - @rocket.chat/ui-contexts@2.0.0-rc.0 + ## 1.0.6 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index 5c01a6db8f21..9a3a30698cb4 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "2.0.0-rc.1", + "version": "2.0.0-rc.2", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.1", + "@rocket.chat/ui-contexts": "2.0.0-rc.2", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index e1a0394597ff..305ecfff36cd 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/uikit-playground +## 0.2.0-rc.2 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.2 +- @rocket.chat/fuselage-ui-kit@2.0.0-rc.2 + ## 0.2.0-rc.1 ### Patch Changes @@ -25,6 +32,7 @@ - Updated dependencies [b8f3d5014f] - @rocket.chat/fuselage-ui-kit@2.0.0-rc.0 - @rocket.chat/ui-contexts@2.0.0-rc.0 + ## 0.1.6 ### Patch Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index 1e3998359a66..0a61046a1cbb 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.2.0-rc.1", + "version": "0.2.0-rc.2", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index 2a76811d031a..6ae99770d2ad 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/web-ui-registration +## 2.0.0-rc.2 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.2 + ## 2.0.0-rc.1 ### Patch Changes @@ -14,6 +20,7 @@ - Updated dependencies [074db3b419] - Updated dependencies [b8f3d5014f] - @rocket.chat/ui-contexts@2.0.0-rc.0 + ## 1.0.6 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index 2f31e571ca8c..68b7aef1d211 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "2.0.0-rc.1", + "version": "2.0.0-rc.2", "private": true, "homepage": "https://rocket.chat", "main": "./dist/index.js", @@ -49,7 +49,7 @@ }, "peerDependencies": { "@rocket.chat/layout": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.1", + "@rocket.chat/ui-contexts": "2.0.0-rc.2", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", From 9a90bfffa8ac5b4f9ba9c18818379baa19a72b2b Mon Sep 17 00:00:00 2001 From: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:54:49 -0300 Subject: [PATCH 150/275] fix: Presence broadcast isn't enabled after license validation (#30282) Co-authored-by: Diego Sampaio --- .changeset/tall-pumpkins-cross.md | 5 +++++ ee/packages/presence/src/Presence.ts | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .changeset/tall-pumpkins-cross.md diff --git a/.changeset/tall-pumpkins-cross.md b/.changeset/tall-pumpkins-cross.md new file mode 100644 index 000000000000..e6cfd8a309b9 --- /dev/null +++ b/.changeset/tall-pumpkins-cross.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/presence": patch +--- + +Fixed presence broadcast being disabled on server restart diff --git a/ee/packages/presence/src/Presence.ts b/ee/packages/presence/src/Presence.ts index 2f30a2ea8912..238cd445def4 100755 --- a/ee/packages/presence/src/Presence.ts +++ b/ee/packages/presence/src/Presence.ts @@ -39,9 +39,14 @@ export class Presence extends ServiceClass implements IPresence { } }); - this.onEvent('license.module', ({ module, valid }) => { + this.onEvent('license.module', async ({ module, valid }) => { if (module === 'scalability') { this.hasLicense = valid; + + // broadcast should always be enabled if license is active (unless the troubleshoot setting is on) + if (!this.broadcastEnabled && valid) { + await this.toggleBroadcast(true); + } } }); } @@ -58,9 +63,9 @@ export class Presence extends ServiceClass implements IPresence { }, 10000); try { - this.hasLicense = await License.hasLicense('scalability'); - await Settings.updateValueById('Presence_broadcast_disabled', false); + + this.hasLicense = await License.hasLicense('scalability'); } catch (e: unknown) { // ignore } From d9a150000d6a277f03c0fa2b8aee5b1d921baf39 Mon Sep 17 00:00:00 2001 From: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:54:49 -0300 Subject: [PATCH 151/275] fix: Presence broadcast isn't enabled after license validation (#30282) Co-authored-by: Diego Sampaio --- .changeset/tall-pumpkins-cross.md | 5 +++++ ee/packages/presence/src/Presence.ts | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .changeset/tall-pumpkins-cross.md diff --git a/.changeset/tall-pumpkins-cross.md b/.changeset/tall-pumpkins-cross.md new file mode 100644 index 000000000000..e6cfd8a309b9 --- /dev/null +++ b/.changeset/tall-pumpkins-cross.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/presence": patch +--- + +Fixed presence broadcast being disabled on server restart diff --git a/ee/packages/presence/src/Presence.ts b/ee/packages/presence/src/Presence.ts index 2f30a2ea8912..238cd445def4 100755 --- a/ee/packages/presence/src/Presence.ts +++ b/ee/packages/presence/src/Presence.ts @@ -39,9 +39,14 @@ export class Presence extends ServiceClass implements IPresence { } }); - this.onEvent('license.module', ({ module, valid }) => { + this.onEvent('license.module', async ({ module, valid }) => { if (module === 'scalability') { this.hasLicense = valid; + + // broadcast should always be enabled if license is active (unless the troubleshoot setting is on) + if (!this.broadcastEnabled && valid) { + await this.toggleBroadcast(true); + } } }); } @@ -58,9 +63,9 @@ export class Presence extends ServiceClass implements IPresence { }, 10000); try { - this.hasLicense = await License.hasLicense('scalability'); - await Settings.updateValueById('Presence_broadcast_disabled', false); + + this.hasLicense = await License.hasLicense('scalability'); } catch (e: unknown) { // ignore } From c655be17ca2eb7272c1d9aa44f19eecb3b3d67df Mon Sep 17 00:00:00 2001 From: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com> Date: Mon, 18 Sep 2023 09:54:49 -0300 Subject: [PATCH 152/275] fix: Presence broadcast isn't enabled after license validation (#30282) Co-authored-by: Diego Sampaio --- .changeset/tall-pumpkins-cross.md | 5 +++++ ee/packages/presence/src/Presence.ts | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .changeset/tall-pumpkins-cross.md diff --git a/.changeset/tall-pumpkins-cross.md b/.changeset/tall-pumpkins-cross.md new file mode 100644 index 000000000000..e6cfd8a309b9 --- /dev/null +++ b/.changeset/tall-pumpkins-cross.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/presence": patch +--- + +Fixed presence broadcast being disabled on server restart diff --git a/ee/packages/presence/src/Presence.ts b/ee/packages/presence/src/Presence.ts index 9bb29b011c26..62fdc87fa9eb 100755 --- a/ee/packages/presence/src/Presence.ts +++ b/ee/packages/presence/src/Presence.ts @@ -39,9 +39,14 @@ export class Presence extends ServiceClass implements IPresence { } }); - this.onEvent('license.module', ({ module, valid }) => { + this.onEvent('license.module', async ({ module, valid }) => { if (module === 'scalability') { this.hasLicense = valid; + + // broadcast should always be enabled if license is active (unless the troubleshoot setting is on) + if (!this.broadcastEnabled && valid) { + await this.toggleBroadcast(true); + } } }); } @@ -58,9 +63,9 @@ export class Presence extends ServiceClass implements IPresence { }, 10000); try { - this.hasLicense = await License.hasLicense('scalability'); - await Settings.updateValueById('Presence_broadcast_disabled', false); + + this.hasLicense = await License.hasLicense('scalability'); } catch (e: unknown) { // ignore } From b1c2a4c71283da38baf6b58f7a6856aa4f442b92 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Mon, 18 Sep 2023 11:37:51 -0300 Subject: [PATCH 153/275] fix: increase cron job check delay to 1 min (#30402) --- .changeset/three-ants-give.md | 8 ++++++++ packages/cron/src/index.ts | 1 + 2 files changed, 9 insertions(+) create mode 100644 .changeset/three-ants-give.md diff --git a/.changeset/three-ants-give.md b/.changeset/three-ants-give.md new file mode 100644 index 000000000000..4d33fad05f39 --- /dev/null +++ b/.changeset/three-ants-give.md @@ -0,0 +1,8 @@ +--- +"@rocket.chat/cron": patch +"@rocket.chat/meteor": patch +--- + +Increase cron job check delay to 1 min from 5s. + +This reduces MongoDB requests introduced on 6.3. diff --git a/packages/cron/src/index.ts b/packages/cron/src/index.ts index 62bc0512bac6..dcd4dc5745d8 100644 --- a/packages/cron/src/index.ts +++ b/packages/cron/src/index.ts @@ -64,6 +64,7 @@ export class AgendaCronJobs { mongo, db: { collection: 'rocketchat_cron' }, defaultConcurrency: 1, + processEvery: '1 minute', }); await this.scheduler.start(); From deffcb187ce9ea32ce3b9ae2602d6eb2e2fedaf2 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Mon, 18 Sep 2023 11:37:51 -0300 Subject: [PATCH 154/275] fix: increase cron job check delay to 1 min (#30402) --- .changeset/three-ants-give.md | 8 ++++++++ packages/cron/src/index.ts | 1 + 2 files changed, 9 insertions(+) create mode 100644 .changeset/three-ants-give.md diff --git a/.changeset/three-ants-give.md b/.changeset/three-ants-give.md new file mode 100644 index 000000000000..4d33fad05f39 --- /dev/null +++ b/.changeset/three-ants-give.md @@ -0,0 +1,8 @@ +--- +"@rocket.chat/cron": patch +"@rocket.chat/meteor": patch +--- + +Increase cron job check delay to 1 min from 5s. + +This reduces MongoDB requests introduced on 6.3. diff --git a/packages/cron/src/index.ts b/packages/cron/src/index.ts index 8158971219ea..64b479d66dbc 100644 --- a/packages/cron/src/index.ts +++ b/packages/cron/src/index.ts @@ -64,6 +64,7 @@ export class AgendaCronJobs { mongo, db: { collection: 'rocketchat_cron' }, defaultConcurrency: 1, + processEvery: '1 minute', }); await this.scheduler.start(); From 61a106fbf232d703181f45e7ca3ee2368b95e849 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Mon, 18 Sep 2023 11:37:51 -0300 Subject: [PATCH 155/275] fix: increase cron job check delay to 1 min (#30402) --- .changeset/three-ants-give.md | 8 ++++++++ packages/cron/src/index.ts | 1 + 2 files changed, 9 insertions(+) create mode 100644 .changeset/three-ants-give.md diff --git a/.changeset/three-ants-give.md b/.changeset/three-ants-give.md new file mode 100644 index 000000000000..4d33fad05f39 --- /dev/null +++ b/.changeset/three-ants-give.md @@ -0,0 +1,8 @@ +--- +"@rocket.chat/cron": patch +"@rocket.chat/meteor": patch +--- + +Increase cron job check delay to 1 min from 5s. + +This reduces MongoDB requests introduced on 6.3. diff --git a/packages/cron/src/index.ts b/packages/cron/src/index.ts index 62bc0512bac6..dcd4dc5745d8 100644 --- a/packages/cron/src/index.ts +++ b/packages/cron/src/index.ts @@ -64,6 +64,7 @@ export class AgendaCronJobs { mongo, db: { collection: 'rocketchat_cron' }, defaultConcurrency: 1, + processEvery: '1 minute', }); await this.scheduler.start(); From 5ce4c41f7b29e903f39bf3054bd854c936a07162 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Jaeger=20Foresti?= <60678893+juliajforesti@users.noreply.github.com> Date: Mon, 18 Sep 2023 12:26:35 -0300 Subject: [PATCH 156/275] chore: color palette changes (#30385) --- ee/packages/ui-theming/src/PaletteStyleTag.tsx | 5 ++--- ee/packages/ui-theming/src/paletteDark.ts | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/ee/packages/ui-theming/src/PaletteStyleTag.tsx b/ee/packages/ui-theming/src/PaletteStyleTag.tsx index 52d912388987..ce911ce4a122 100644 --- a/ee/packages/ui-theming/src/PaletteStyleTag.tsx +++ b/ee/packages/ui-theming/src/PaletteStyleTag.tsx @@ -3,7 +3,6 @@ import { createPortal } from 'react-dom'; import { codeBlock } from './codeBlockStyles'; import { convertToCss } from './helpers/convertToCss'; -import { filterOnlyChangedColors } from './helpers/filterOnlyChangedColors'; import { useCreateStyleContainer } from './hooks/useCreateStyleContainer'; import { useThemeMode } from './hooks/useThemeMode'; import { defaultPalette } from './palette'; @@ -20,9 +19,9 @@ export const PaletteStyleTag = memo(function PaletteStyleTag() { if (theme === 'high-contrast') { return paletteHighContrast; } - return {}; + return defaultPalette; }; - const palette = convertToCss(filterOnlyChangedColors(defaultPalette, getPalette()), '.rcx-content--main'); + const palette = convertToCss(getPalette(), '.rcx-content--main, .rcx-tile'); return createPortal(theme === 'dark' ? palette + codeBlock : palette, useCreateStyleContainer('main-palette')); }); diff --git a/ee/packages/ui-theming/src/paletteDark.ts b/ee/packages/ui-theming/src/paletteDark.ts index 9898c7fe95f9..cdb60efffeac 100644 --- a/ee/packages/ui-theming/src/paletteDark.ts +++ b/ee/packages/ui-theming/src/paletteDark.ts @@ -51,7 +51,7 @@ export const palette = [ { name: 'font-default', token: 'N400', color: '#E4E7EA' }, { name: 'font-titles-labels', token: '', color: '#F2F3F5' }, { name: 'font-info', token: '', color: '#739EDE' }, - { name: 'font-danger', token: '', color: '#CF6E7A' }, + { name: 'font-danger', token: '', color: '#D88892' }, { name: 'font-pure-black', token: '', color: '#2F343D' }, { name: 'font-pure-white', token: '', color: '#FFFFFF' }, ], From e554607d3c52f4d480e7c3404853e604115c256a Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Mon, 18 Sep 2023 12:54:15 -0300 Subject: [PATCH 157/275] regression: fix Issues with livechat queue (#30400) --- packages/livechat/src/lib/api.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/livechat/src/lib/api.js b/packages/livechat/src/lib/api.js index 7f4c5ca340a4..ac7df77072b4 100644 --- a/packages/livechat/src/lib/api.js +++ b/packages/livechat/src/lib/api.js @@ -8,9 +8,9 @@ export const normalizeQueueAlert = async (queueInfo) => { if (!queueInfo) { return; } - const formatDistance = await import('date-fns/formatDistance'); + const { default: formatDistance } = await import('date-fns/formatDistance'); const { spot, estimatedWaitTimeSeconds } = queueInfo; - const locale = getDateFnsLocale(); + const locale = await getDateFnsLocale(); const estimatedWaitTime = estimatedWaitTimeSeconds && formatDistance(new Date().setSeconds(estimatedWaitTimeSeconds), new Date(), { locale }); return ( From 76083c810083b064ac138d85d716cc4c285e599f Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Mon, 18 Sep 2023 13:31:43 -0300 Subject: [PATCH 158/275] chore: Webhooks page refactor (#30274) --- .../app/livechat/server/api/v1/webhooks.ts | 2 +- .../omnichannel/webhooks/WebhooksPage.js | 170 ------------- .../omnichannel/webhooks/WebhooksPage.tsx | 233 ++++++++++++++++++ ...Container.js => WebhooksPageContainer.tsx} | 23 +- .../rocketchat-i18n/i18n/en.i18n.json | 1 + .../rocketchat-i18n/i18n/pt-BR.i18n.json | 1 + packages/rest-typings/src/v1/omnichannel.ts | 5 +- 7 files changed, 254 insertions(+), 181 deletions(-) delete mode 100644 apps/meteor/client/views/omnichannel/webhooks/WebhooksPage.js create mode 100644 apps/meteor/client/views/omnichannel/webhooks/WebhooksPage.tsx rename apps/meteor/client/views/omnichannel/webhooks/{WebhooksPageContainer.js => WebhooksPageContainer.tsx} (51%) diff --git a/apps/meteor/app/livechat/server/api/v1/webhooks.ts b/apps/meteor/app/livechat/server/api/v1/webhooks.ts index dceb19ed0420..e282e2bd548b 100644 --- a/apps/meteor/app/livechat/server/api/v1/webhooks.ts +++ b/apps/meteor/app/livechat/server/api/v1/webhooks.ts @@ -66,7 +66,7 @@ API.v1.addRoute( const webhookUrl = settings.get('Livechat_webhookUrl'); if (!webhookUrl) { - return API.v1.failure('Webhook URL is not set'); + return API.v1.failure('Webhook_URL_not_set'); } try { diff --git a/apps/meteor/client/views/omnichannel/webhooks/WebhooksPage.js b/apps/meteor/client/views/omnichannel/webhooks/WebhooksPage.js deleted file mode 100644 index 03de7930f3ff..000000000000 --- a/apps/meteor/client/views/omnichannel/webhooks/WebhooksPage.js +++ /dev/null @@ -1,170 +0,0 @@ -import { Box, FieldGroup, Field, TextInput, MultiSelect, Button, ButtonGroup, NumberInput } from '@rocket.chat/fuselage'; -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; -import { ExternalLink } from '@rocket.chat/ui-client'; -import { useToastMessageDispatch, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts'; -import React, { useMemo } from 'react'; - -import Page from '../../../components/Page'; -import { useForm } from '../../../hooks/useForm'; - -const reduceSendOptions = (options) => - Object.entries(options).reduce((acc, [key, val]) => { - if (val) { - acc = [...acc, key]; - } - return acc; - }, []); - -const integrationsUrl = 'https://docs.rocket.chat/use-rocket.chat/omnichannel/webhooks'; - -const getInitialValues = ({ - Livechat_webhookUrl, - Livechat_secret_token, - Livechat_webhook_on_start, - Livechat_webhook_on_close, - Livechat_webhook_on_chat_taken, - Livechat_webhook_on_chat_queued, - Livechat_webhook_on_forward, - Livechat_webhook_on_offline_msg, - Livechat_webhook_on_visitor_message, - Livechat_webhook_on_agent_message, - Livechat_http_timeout, -}) => { - const sendOptions = { - Livechat_webhook_on_start, - Livechat_webhook_on_close, - Livechat_webhook_on_chat_taken, - Livechat_webhook_on_chat_queued, - Livechat_webhook_on_forward, - Livechat_webhook_on_offline_msg, - Livechat_webhook_on_visitor_message, - Livechat_webhook_on_agent_message, - }; - - const mappedSendOptions = reduceSendOptions(sendOptions); - - return { - Livechat_webhookUrl, - Livechat_secret_token, - Livechat_http_timeout, - sendOn: mappedSendOptions, - }; -}; - -const WebhooksPage = ({ settings }) => { - const t = useTranslation(); - const dispatchToastMessage = useToastMessageDispatch(); - - const { values, handlers, hasUnsavedChanges, reset, commit } = useForm(getInitialValues(settings)); - - const save = useEndpoint('POST', '/v1/omnichannel/integrations'); - const test = useEndpoint('POST', '/v1/livechat/webhook.test'); - - const { Livechat_webhookUrl, Livechat_secret_token, Livechat_http_timeout, sendOn } = values; - - const { handleLivechat_webhookUrl, handleLivechat_secret_token, handleLivechat_http_timeout, handleSendOn } = handlers; - - const sendOptions = useMemo( - () => [ - ['Livechat_webhook_on_start', t('Chat_start')], - ['Livechat_webhook_on_close', t('Chat_close')], - ['Livechat_webhook_on_chat_taken', t('Chat_taken')], - ['Livechat_webhook_on_chat_queued', t('Chat_queued')], - ['Livechat_webhook_on_forward', t('Forwarding')], - ['Livechat_webhook_on_offline_msg', t('Offline_messages')], - ['Livechat_webhook_on_visitor_message', t('Visitor_message')], - ['Livechat_webhook_on_agent_message', t('Agent_messages')], - ], - [t], - ); - - const handleSave = useMutableCallback(async () => { - try { - await save({ - LivechatWebhookUrl: Livechat_webhookUrl, - LivechatSecretToken: Livechat_secret_token, - LivechatHttpTimeout: Livechat_http_timeout, - LivechatWebhookOnStart: sendOn.includes('Livechat_webhook_on_start'), - LivechatWebhookOnClose: sendOn.includes('Livechat_webhook_on_close'), - LivechatWebhookOnChatTaken: sendOn.includes('Livechat_webhook_on_chat_taken'), - LivechatWebhookOnChatQueued: sendOn.includes('Livechat_webhook_on_chat_queued'), - LivechatWebhookOnForward: sendOn.includes('Livechat_webhook_on_forward'), - LivechatWebhookOnOfflineMsg: sendOn.includes('Livechat_webhook_on_offline_msg'), - LivechatWebhookOnVisitorMessage: sendOn.includes('Livechat_webhook_on_visitor_message'), - LivechatWebhookOnAgentMessage: sendOn.includes('Livechat_webhook_on_agent_message'), - }); - dispatchToastMessage({ type: 'success', message: t('Saved') }); - commit(); - } catch (error) { - dispatchToastMessage({ type: 'error', message: error }); - } - }); - - const handleTest = useMutableCallback(async () => { - try { - await test(); - dispatchToastMessage({ type: 'success', message: t('It_works') }); - commit(); - } catch (error) { - dispatchToastMessage({ type: 'error', message: error }); - } - }); - - return ( - - - - - - - - - - -

{t('You_can_use_webhooks_to_easily_integrate_livechat_with_your_CRM')}

-

- {t('Click_here')} {t('to_see_more_details_on_how_to_integrate')} -

- - - {t('Webhook_URL')} - - - - - - {t('Secret_token')} - - - - - - {t('Send_request_on')} - - - - - - - - {t('Http_timeout')} - - - - - -
-
-
- ); -}; - -export default WebhooksPage; diff --git a/apps/meteor/client/views/omnichannel/webhooks/WebhooksPage.tsx b/apps/meteor/client/views/omnichannel/webhooks/WebhooksPage.tsx new file mode 100644 index 000000000000..437c4a9a2afc --- /dev/null +++ b/apps/meteor/client/views/omnichannel/webhooks/WebhooksPage.tsx @@ -0,0 +1,233 @@ +import type { SettingValue } from '@rocket.chat/core-typings'; +import type { SelectOption } from '@rocket.chat/fuselage'; +import { + Box, + FieldGroup, + Field, + FieldRow, + TextInput, + MultiSelect, + Button, + ButtonGroup, + NumberInput, + FieldLabel, +} from '@rocket.chat/fuselage'; +import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import { ExternalLink } from '@rocket.chat/ui-client'; +import { useToastMessageDispatch, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts'; +import { useMutation } from '@tanstack/react-query'; +import React, { useMemo } from 'react'; +import { Controller, useForm, useWatch } from 'react-hook-form'; + +import Page from '../../../components/Page'; + +type WebhooksPageProps = { + settings: Record; +}; + +type SendOnOptions = + | 'Livechat_webhook_on_start' + | 'Livechat_webhook_on_close' + | 'Livechat_webhook_on_chat_taken' + | 'Livechat_webhook_on_chat_queued' + | 'Livechat_webhook_on_forward' + | 'Livechat_webhook_on_offline_msg' + | 'Livechat_webhook_on_visitor_message' + | 'Livechat_webhook_on_agent_message'; + +type WebhookFormValues = { + Livechat_webhookUrl: string | undefined; + Livechat_secret_token: string | undefined; + Livechat_http_timeout: string | undefined; + sendOn: SendOnOptions[]; +}; + +const reduceSendOptions = (options: Record) => + Object.entries(options).reduce((acc, [key, val]) => { + if (val) { + acc = [...acc, key]; + } + return acc; + }, []); + +const INTEGRATION_URL = 'https://docs.rocket.chat/use-rocket.chat/omnichannel/webhooks'; + +const getInitialValues = ({ + Livechat_webhookUrl, + Livechat_secret_token, + Livechat_webhook_on_start, + Livechat_webhook_on_close, + Livechat_webhook_on_chat_taken, + Livechat_webhook_on_chat_queued, + Livechat_webhook_on_forward, + Livechat_webhook_on_offline_msg, + Livechat_webhook_on_visitor_message, + Livechat_webhook_on_agent_message, + Livechat_http_timeout, +}: WebhooksPageProps['settings']): WebhookFormValues => { + const mappedSendOptions = reduceSendOptions({ + Livechat_webhook_on_start, + Livechat_webhook_on_close, + Livechat_webhook_on_chat_taken, + Livechat_webhook_on_chat_queued, + Livechat_webhook_on_forward, + Livechat_webhook_on_offline_msg, + Livechat_webhook_on_visitor_message, + Livechat_webhook_on_agent_message, + }); + + return { + Livechat_webhookUrl, + Livechat_secret_token, + Livechat_http_timeout, + sendOn: mappedSendOptions, + } as WebhookFormValues; +}; + +const WebhooksPage = ({ settings }: WebhooksPageProps) => { + const t = useTranslation(); + const dispatchToastMessage = useToastMessageDispatch(); + const defaultValues = getInitialValues(settings); + const { + control, + reset, + formState: { isDirty, isSubmitting }, + handleSubmit, + } = useForm({ + defaultValues, + }); + + const save = useEndpoint('POST', '/v1/omnichannel/integrations'); + const test = useEndpoint('POST', '/v1/livechat/webhook.test'); + + const livechatWebhookUrl = useWatch({ name: 'Livechat_webhookUrl', control }); + const canTest = !(livechatWebhookUrl && !isDirty); + + const sendOptions = useMemo( + () => [ + ['Livechat_webhook_on_start', t('Chat_start')], + ['Livechat_webhook_on_close', t('Chat_close')], + ['Livechat_webhook_on_chat_taken', t('Chat_taken')], + ['Livechat_webhook_on_chat_queued', t('Chat_queued')], + ['Livechat_webhook_on_forward', t('Forwarding')], + ['Livechat_webhook_on_offline_msg', t('Offline_messages')], + ['Livechat_webhook_on_visitor_message', t('Visitor_message')], + ['Livechat_webhook_on_agent_message', t('Agent_messages')], + ], + [t], + ); + + const handleSave = useMutableCallback(async (values) => { + const { sendOn, Livechat_webhookUrl, Livechat_secret_token, Livechat_http_timeout } = values; + try { + await save({ + LivechatWebhookUrl: Livechat_webhookUrl, + LivechatSecretToken: Livechat_secret_token, + LivechatHttpTimeout: Livechat_http_timeout, + LivechatWebhookOnStart: sendOn.includes('Livechat_webhook_on_start'), + LivechatWebhookOnClose: sendOn.includes('Livechat_webhook_on_close'), + LivechatWebhookOnChatTaken: sendOn.includes('Livechat_webhook_on_chat_taken'), + LivechatWebhookOnChatQueued: sendOn.includes('Livechat_webhook_on_chat_queued'), + LivechatWebhookOnForward: sendOn.includes('Livechat_webhook_on_forward'), + LivechatWebhookOnOfflineMsg: sendOn.includes('Livechat_webhook_on_offline_msg'), + LivechatWebhookOnVisitorMessage: sendOn.includes('Livechat_webhook_on_visitor_message'), + LivechatWebhookOnAgentMessage: sendOn.includes('Livechat_webhook_on_agent_message'), + }); + + reset(values); + dispatchToastMessage({ type: 'success', message: t('Saved') }); + } catch (error) { + dispatchToastMessage({ type: 'error', message: error }); + } + }); + + const testWebhook = useMutation({ + mutationFn: () => test(), + onSuccess: () => dispatchToastMessage({ type: 'success', message: t('It_works') }), + onError: (error) => dispatchToastMessage({ type: 'error', message: error }), + }); + + return ( + + + + + + + + + + +

{t('You_can_use_webhooks_to_easily_integrate_livechat_with_your_CRM')}

+

+ {t('Click_here')} {t('to_see_more_details_on_how_to_integrate')} +

+ + + {t('Webhook_URL')} + + ( + + )} + /> + + + + {t('Secret_token')} + + ( + + )} + /> + + + + {t('Send_request_on')} + + + ( + + )} + /> + + + + + {t('Http_timeout')} + + ( + + )} + /> + + + +
+
+
+ ); +}; + +export default WebhooksPage; diff --git a/apps/meteor/client/views/omnichannel/webhooks/WebhooksPageContainer.js b/apps/meteor/client/views/omnichannel/webhooks/WebhooksPageContainer.tsx similarity index 51% rename from apps/meteor/client/views/omnichannel/webhooks/WebhooksPageContainer.js rename to apps/meteor/client/views/omnichannel/webhooks/WebhooksPageContainer.tsx index d1e7379e1c3c..5442f3d27c90 100644 --- a/apps/meteor/client/views/omnichannel/webhooks/WebhooksPageContainer.js +++ b/apps/meteor/client/views/omnichannel/webhooks/WebhooksPageContainer.tsx @@ -1,16 +1,16 @@ +import type { ISetting, Serialized, SettingValue } from '@rocket.chat/core-typings'; import { Callout } from '@rocket.chat/fuselage'; -import { usePermission, useTranslation } from '@rocket.chat/ui-contexts'; +import { useEndpoint, usePermission, useTranslation } from '@rocket.chat/ui-contexts'; +import { useQuery } from '@tanstack/react-query'; import React from 'react'; import Page from '../../../components/Page'; import PageSkeleton from '../../../components/PageSkeleton'; -import { AsyncStatePhase } from '../../../hooks/useAsyncState'; -import { useEndpointData } from '../../../hooks/useEndpointData'; import NotAuthorizedPage from '../../notAuthorized/NotAuthorizedPage'; import WebhooksPage from './WebhooksPage'; -const reduceSettings = (settings) => - settings.reduce((acc, { _id, value }) => { +const reduceSettings = (settings: Serialized[]) => + settings.reduce>((acc, { _id, value }) => { acc = { ...acc, [_id]: value }; return acc; }, {}); @@ -18,7 +18,12 @@ const reduceSettings = (settings) => const WebhooksPageContainer = () => { const t = useTranslation(); - const { value: data, phase: state, error } = useEndpointData('/v1/livechat/integrations.settings'); + const getIntegrationsSettings = useEndpoint('GET', '/v1/livechat/integrations.settings'); + + const { data, isLoading, isError } = useQuery(['/v1/livechat/integrations.settings'], async () => { + const { settings, success } = await getIntegrationsSettings(); + return { settings: reduceSettings(settings), success }; + }); const canViewLivechatWebhooks = usePermission('view-livechat-webhooks'); @@ -26,11 +31,11 @@ const WebhooksPageContainer = () => { return ; } - if (state === AsyncStatePhase.LOADING) { + if (isLoading) { return ; } - if (!data || !data.success || !data.settings || error) { + if (!data?.success || !data?.settings || isError) { return ( @@ -41,7 +46,7 @@ const WebhooksPageContainer = () => { ); } - return ; + return ; }; export default WebhooksPageContainer; diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index a0f6d0e0c6a8..e8b2a9fcdebf 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -5665,6 +5665,7 @@ "webdav-server-not-found": "WebDAV server not found", "Webhook_Details": "WebHook Details", "Webhook_URL": "Webhook URL", + "Webhook_URL_not_set": "Webhook URL is not set", "Webhooks": "Webhooks", "WebRTC": "WebRTC", "WebRTC_Description": "Broadcast audio and/or video material, as well as transmit arbitrary data between browsers without the need for a middleman.", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json index de5c2356a6b9..1b24ab3c4129 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json @@ -4752,6 +4752,7 @@ "webdav-account-updated": "Conta WebDAV atualizada", "Webhook_Details": "Detalhes do WebHook", "Webhook_URL": "URL do webhook", + "Webhook_URL_not_set": "A URL do webhook não foi definida", "Webhooks": "Webhooks", "WebRTC_Call": "Chamada WebRTC", "WebRTC_direct_audio_call_from_%s": "Chamada de áudio direta de %s", diff --git a/packages/rest-typings/src/v1/omnichannel.ts b/packages/rest-typings/src/v1/omnichannel.ts index f85358c38ee9..60f6ed7ace08 100644 --- a/packages/rest-typings/src/v1/omnichannel.ts +++ b/packages/rest-typings/src/v1/omnichannel.ts @@ -3607,7 +3607,7 @@ export type OmnichannelEndpoints = { }>; }; '/v1/livechat/integrations.settings': { - GET: () => { settings: ISetting[] }; + GET: () => { settings: ISetting[]; success: boolean }; }; '/v1/livechat/upload/:rid': { POST: (params: { file: File }) => IMessage & { newRoom: boolean; showConnecting: boolean }; @@ -3804,4 +3804,7 @@ export type OmnichannelEndpoints = { '/v1/livechat/analytics/dashboards/conversations-by-agent': { GET: (params: GETDashboardConversationsByType) => ReportWithUnmatchingElements; }; + '/v1/livechat/webhook.test': { + POST: () => void; + }; }; From 7c8c4b4394b46fd93fb5227783cfff9836ecd1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Jaeger=20Foresti?= <60678893+juliajforesti@users.noreply.github.com> Date: Mon, 18 Sep 2023 13:48:02 -0300 Subject: [PATCH 159/275] chore: bump fuselage packages (#30424) --- .../RoomAutoCompleteMultiple.tsx | 4 +- .../UserAutoCompleteMultiple.tsx | 2 +- .../actions/hooks/useGroupingListItems.tsx | 6 +- .../header/actions/hooks/useSortModeItems.tsx | 4 +- .../header/actions/hooks/useViewModeItems.tsx | 8 +- apps/meteor/ee/server/services/package.json | 4 +- apps/meteor/package.json | 12 +- ee/packages/ui-theming/package.json | 6 +- packages/core-services/package.json | 4 +- packages/core-typings/package.json | 4 +- packages/fuselage-ui-kit/package.json | 10 +- packages/gazzodown/package.json | 2 +- packages/livechat/package.json | 4 +- packages/rest-typings/package.json | 2 +- packages/ui-client/package.json | 6 +- packages/ui-composer/package.json | 4 +- packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/package.json | 6 +- packages/uikit-playground/package.json | 8 +- yarn.lock | 232 +++++++++--------- 20 files changed, 165 insertions(+), 165 deletions(-) diff --git a/apps/meteor/client/components/RoomAutoCompleteMultiple/RoomAutoCompleteMultiple.tsx b/apps/meteor/client/components/RoomAutoCompleteMultiple/RoomAutoCompleteMultiple.tsx index 7026c6cab35f..eb0414e7da14 100644 --- a/apps/meteor/client/components/RoomAutoCompleteMultiple/RoomAutoCompleteMultiple.tsx +++ b/apps/meteor/client/components/RoomAutoCompleteMultiple/RoomAutoCompleteMultiple.tsx @@ -49,8 +49,8 @@ const RoomAutoCompleteMultiple = ({ value, onChange, ...props }: RoomAutoComplet filter={filter} setFilter={setFilter} multiple - renderSelected={({ selected: { value, label }, onRemove }): ReactElement => ( - + renderSelected={({ selected: { value, label }, onRemove, ...props }): ReactElement => ( + {label?.name} diff --git a/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultiple.tsx b/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultiple.tsx index dfda12cdd2e4..857af5e9c43f 100644 --- a/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultiple.tsx +++ b/apps/meteor/client/components/UserAutoCompleteMultiple/UserAutoCompleteMultiple.tsx @@ -31,7 +31,7 @@ const UserAutoCompleteMultiple = ({ onChange, ...props }: UserAutoCompleteMultip setFilter={setFilter} onChange={onChange} multiple - renderSelected={({ selected: { value, label }, onRemove }): ReactElement => ( + renderSelected={({ selected: { value, label }, onRemove, ...props }): ReactElement => ( diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useGroupingListItems.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useGroupingListItems.tsx index 20006cf01588..646b85c838be 100644 --- a/apps/meteor/client/sidebar/header/actions/hooks/useGroupingListItems.tsx +++ b/apps/meteor/client/sidebar/header/actions/hooks/useGroupingListItems.tsx @@ -25,19 +25,19 @@ export const useGroupingListItems = (): GenericMenuItemProps[] => { id: 'unread', content: t('Unread'), icon: 'flag', - addon: , + addon: , }, { id: 'favorites', content: t('Favorites'), icon: 'star', - addon: , + addon: , }, { id: 'types', content: t('Types'), icon: 'group-by-type', - addon: , + addon: , }, ]; }; diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useSortModeItems.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useSortModeItems.tsx index b9432f821373..56041ab4e571 100644 --- a/apps/meteor/client/sidebar/header/actions/hooks/useSortModeItems.tsx +++ b/apps/meteor/client/sidebar/header/actions/hooks/useSortModeItems.tsx @@ -26,14 +26,14 @@ export const useSortModeItems = (): GenericMenuItemProps[] => { id: 'activity', content: t('Activity'), icon: 'clock', - addon: , + addon: , description: sidebarSortBy === 'activity' && isOmnichannelEnabled && , }, { id: 'name', content: t('Name'), icon: 'sort-az', - addon: , + addon: , description: sidebarSortBy === 'alphabetical' && isOmnichannelEnabled && , }, ]; diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useViewModeItems.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useViewModeItems.tsx index 3e27dd22c7fa..ca2855d09db5 100644 --- a/apps/meteor/client/sidebar/header/actions/hooks/useViewModeItems.tsx +++ b/apps/meteor/client/sidebar/header/actions/hooks/useViewModeItems.tsx @@ -29,25 +29,25 @@ export const useViewModeItems = (): GenericMenuItemProps[] => { id: 'extended', content: t('Extended'), icon: 'extended-view', - addon: , + addon: , }, { id: 'medium', content: t('Medium'), icon: 'medium-view', - addon: , + addon: , }, { id: 'condensed', content: t('Condensed'), icon: 'condensed-view', - addon: , + addon: , }, { id: 'avatars', content: t('Avatars'), icon: 'user-rounded', - addon: , + addon: , }, ]; }; diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 3ab8bd2abfd3..3466067fd742 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -27,7 +27,7 @@ "@rocket.chat/models": "workspace:^", "@rocket.chat/rest-typings": "workspace:^", "@rocket.chat/string-helpers": "next", - "@rocket.chat/ui-kit": "next", + "@rocket.chat/ui-kit": "^0.32.1", "ajv": "^8.11.0", "bcrypt": "^5.0.1", "body-parser": "^1.20.2", @@ -50,7 +50,7 @@ "ws": "^8.8.1" }, "devDependencies": { - "@rocket.chat/icons": "next", + "@rocket.chat/icons": "^0.32.0", "@types/cookie": "^0.5.1", "@types/cookie-parser": "^1.4.3", "@types/ejson": "^2.2.0", diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 4954c22a319b..030b77fd7814 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -236,27 +236,27 @@ "@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": "^0.32.1", + "@rocket.chat/fuselage-hooks": "^0.32.1", "@rocket.chat/fuselage-polyfills": "next", "@rocket.chat/fuselage-toastbar": "next", "@rocket.chat/fuselage-tokens": "next", "@rocket.chat/fuselage-ui-kit": "workspace:^", "@rocket.chat/gazzodown": "workspace:^", "@rocket.chat/i18n": "workspace:^", - "@rocket.chat/icons": "next", + "@rocket.chat/icons": "^0.32.0", "@rocket.chat/instance-status": "workspace:^", "@rocket.chat/layout": "next", "@rocket.chat/log-format": "workspace:^", "@rocket.chat/logger": "workspace:^", - "@rocket.chat/logo": "next", + "@rocket.chat/logo": "^0.31.27", "@rocket.chat/memo": "next", "@rocket.chat/message-parser": "next", "@rocket.chat/model-typings": "workspace:^", "@rocket.chat/models": "workspace:^", "@rocket.chat/mp3-encoder": "0.24.0", "@rocket.chat/omnichannel-services": "workspace:^", - "@rocket.chat/onboarding-ui": "next", + "@rocket.chat/onboarding-ui": "^0.32.1", "@rocket.chat/password-policies": "workspace:^", "@rocket.chat/pdf-worker": "workspace:^", "@rocket.chat/poplib": "workspace:^", @@ -270,7 +270,7 @@ "@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.32.1", "@rocket.chat/ui-theming": "workspace:^", "@rocket.chat/ui-video-conf": "workspace:^", "@rocket.chat/web-ui-registration": "workspace:^", diff --git a/ee/packages/ui-theming/package.json b/ee/packages/ui-theming/package.json index 4e6c5c42aec7..a378fee8f896 100644 --- a/ee/packages/ui-theming/package.json +++ b/ee/packages/ui-theming/package.json @@ -4,9 +4,9 @@ "private": true, "devDependencies": { "@rocket.chat/css-in-js": "next", - "@rocket.chat/fuselage": "next", - "@rocket.chat/fuselage-hooks": "next", - "@rocket.chat/icons": "next", + "@rocket.chat/fuselage": "^0.32.1", + "@rocket.chat/fuselage-hooks": "^0.32.1", + "@rocket.chat/icons": "^0.32.0", "@rocket.chat/ui-contexts": "workspace:~", "@storybook/addon-actions": "~6.5.16", "@storybook/addon-docs": "~6.5.16", diff --git a/packages/core-services/package.json b/packages/core-services/package.json index c5185a20d394..f4e05cf08e5b 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -33,11 +33,11 @@ "dependencies": { "@rocket.chat/apps-engine": "1.41.0-alpha.290", "@rocket.chat/core-typings": "workspace:^", - "@rocket.chat/icons": "next", + "@rocket.chat/icons": "^0.32.0", "@rocket.chat/message-parser": "next", "@rocket.chat/models": "workspace:^", "@rocket.chat/rest-typings": "workspace:^", - "@rocket.chat/ui-kit": "next", + "@rocket.chat/ui-kit": "^0.32.1", "@types/fibers": "^3.1.1", "fibers": "^5.0.3" } diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 5512e8fb5df4..b582e15f3118 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -22,9 +22,9 @@ ], "dependencies": { "@rocket.chat/apps-engine": "1.41.0-alpha.290", - "@rocket.chat/icons": "next", + "@rocket.chat/icons": "^0.32.0", "@rocket.chat/message-parser": "next", - "@rocket.chat/ui-kit": "next" + "@rocket.chat/ui-kit": "^0.32.1" }, "volta": { "extends": "../../package.json" diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index cb28e0699874..fe0d4f02a5cf 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -56,14 +56,14 @@ "devDependencies": { "@rocket.chat/apps-engine": "1.41.0-alpha.290", "@rocket.chat/eslint-config": "workspace:^", - "@rocket.chat/fuselage": "next", - "@rocket.chat/fuselage-hooks": "next", + "@rocket.chat/fuselage": "^0.32.1", + "@rocket.chat/fuselage-hooks": "^0.32.1", "@rocket.chat/fuselage-polyfills": "next", - "@rocket.chat/icons": "next", + "@rocket.chat/icons": "^0.32.0", "@rocket.chat/prettier-config": "next", "@rocket.chat/styled": "next", "@rocket.chat/ui-contexts": "workspace:^", - "@rocket.chat/ui-kit": "next", + "@rocket.chat/ui-kit": "^0.32.1", "@rocket.chat/ui-video-conf": "workspace:^", "@storybook/addon-essentials": "~6.5.16", "@storybook/addons": "~6.5.16", @@ -89,7 +89,7 @@ }, "dependencies": { "@rocket.chat/gazzodown": "workspace:^", - "@rocket.chat/ui-kit": "next", + "@rocket.chat/ui-kit": "^0.32.1", "tslib": "^2.5.3" }, "volta": { diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index 6f0d63803d66..db80f6e36266 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -6,7 +6,7 @@ "@babel/core": "~7.22.9", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/css-in-js": "next", - "@rocket.chat/fuselage": "next", + "@rocket.chat/fuselage": "^0.32.1", "@rocket.chat/fuselage-tokens": "next", "@rocket.chat/message-parser": "next", "@rocket.chat/styled": "next", diff --git a/packages/livechat/package.json b/packages/livechat/package.json index b2ebd22a89f2..bf151cdad809 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -31,7 +31,7 @@ "@rocket.chat/ddp-client": "workspace:^", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/fuselage-tokens": "next", - "@rocket.chat/logo": "next", + "@rocket.chat/logo": "^0.31.27", "@storybook/addon-essentials": "~6.5.16", "@storybook/addon-postcss": "~2.0.0", "@storybook/preact": "~6.5.16", @@ -98,7 +98,7 @@ "@rocket.chat/message-parser": "next", "@rocket.chat/random": "workspace:~", "@rocket.chat/sdk": "^1.0.0-alpha.42", - "@rocket.chat/ui-kit": "next", + "@rocket.chat/ui-kit": "^0.32.1", "css-vars-ponyfill": "^2.4.8", "date-fns": "^2.15.0", "emoji-mart": "^3.0.1", diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 26b7de5653d3..cc12bd6d901d 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -27,7 +27,7 @@ "@rocket.chat/apps-engine": "1.41.0-alpha.290", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/message-parser": "next", - "@rocket.chat/ui-kit": "next", + "@rocket.chat/ui-kit": "^0.32.1", "ajv": "^8.11.0", "ajv-formats": "^2.1.1" }, diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 4bfa46253f8e..9fc0b7f3617c 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -5,9 +5,9 @@ "devDependencies": { "@babel/core": "~7.22.9", "@rocket.chat/css-in-js": "next", - "@rocket.chat/fuselage": "next", - "@rocket.chat/fuselage-hooks": "next", - "@rocket.chat/icons": "next", + "@rocket.chat/fuselage": "^0.32.1", + "@rocket.chat/fuselage-hooks": "^0.32.1", + "@rocket.chat/icons": "^0.32.0", "@rocket.chat/mock-providers": "workspace:^", "@rocket.chat/ui-contexts": "workspace:~", "@storybook/addon-actions": "~6.5.16", diff --git a/packages/ui-composer/package.json b/packages/ui-composer/package.json index 40c5c052874e..abf79394f171 100644 --- a/packages/ui-composer/package.json +++ b/packages/ui-composer/package.json @@ -5,8 +5,8 @@ "devDependencies": { "@babel/core": "~7.22.9", "@rocket.chat/eslint-config": "workspace:^", - "@rocket.chat/fuselage": "next", - "@rocket.chat/icons": "next", + "@rocket.chat/fuselage": "^0.32.1", + "@rocket.chat/icons": "^0.32.0", "@storybook/addon-actions": "~6.5.16", "@storybook/addon-docs": "~6.5.16", "@storybook/addon-essentials": "~6.5.16", diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index f9bb30499b28..ce84a75089b3 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -5,7 +5,7 @@ "devDependencies": { "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/emitter": "next", - "@rocket.chat/fuselage-hooks": "next", + "@rocket.chat/fuselage-hooks": "^0.32.1", "@rocket.chat/rest-typings": "workspace:^", "@types/jest": "~29.5.3", "@types/react": "~17.0.62", diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index 5c01a6db8f21..91ffd97b27d7 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -6,9 +6,9 @@ "@babel/core": "~7.22.9", "@rocket.chat/css-in-js": "next", "@rocket.chat/eslint-config": "workspace:^", - "@rocket.chat/fuselage": "next", - "@rocket.chat/fuselage-hooks": "next", - "@rocket.chat/icons": "next", + "@rocket.chat/fuselage": "^0.32.1", + "@rocket.chat/fuselage-hooks": "^0.32.1", + "@rocket.chat/icons": "^0.32.0", "@rocket.chat/styled": "next", "@rocket.chat/ui-contexts": "workspace:^", "@storybook/addon-actions": "~6.5.16", diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index 1e3998359a66..d9b9587f5cf3 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -15,13 +15,13 @@ "@codemirror/tooltip": "^0.19.16", "@lezer/highlight": "^1.1.6", "@rocket.chat/css-in-js": "next", - "@rocket.chat/fuselage": "next", - "@rocket.chat/fuselage-hooks": "next", + "@rocket.chat/fuselage": "^0.32.1", + "@rocket.chat/fuselage-hooks": "^0.32.1", "@rocket.chat/fuselage-polyfills": "next", "@rocket.chat/fuselage-tokens": "next", "@rocket.chat/fuselage-ui-kit": "workspace:~", - "@rocket.chat/icons": "next", - "@rocket.chat/logo": "next", + "@rocket.chat/icons": "^0.32.0", + "@rocket.chat/logo": "^0.31.27", "@rocket.chat/styled": "next", "@rocket.chat/ui-contexts": "workspace:~", "codemirror": "^6.0.1", diff --git a/yarn.lock b/yarn.lock index 851694f201fc..80c6598eb02c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7863,11 +7863,11 @@ __metadata: "@rocket.chat/apps-engine": 1.41.0-alpha.290 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/icons": next + "@rocket.chat/icons": ^0.32.0 "@rocket.chat/message-parser": next "@rocket.chat/models": "workspace:^" "@rocket.chat/rest-typings": "workspace:^" - "@rocket.chat/ui-kit": next + "@rocket.chat/ui-kit": ^0.32.1 "@types/babel__core": ^7 "@types/babel__preset-env": ^7 "@types/fibers": ^3.1.1 @@ -7888,9 +7888,9 @@ __metadata: dependencies: "@rocket.chat/apps-engine": 1.41.0-alpha.290 "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/icons": next + "@rocket.chat/icons": ^0.32.0 "@rocket.chat/message-parser": next - "@rocket.chat/ui-kit": next + "@rocket.chat/ui-kit": ^0.32.1 eslint: ~8.45.0 mongodb: ^4.12.1 prettier: ~2.8.8 @@ -7915,6 +7915,19 @@ __metadata: languageName: unknown linkType: soft +"@rocket.chat/css-in-js@npm:^0.31.25": + version: 0.31.25 + resolution: "@rocket.chat/css-in-js@npm:0.31.25" + dependencies: + "@emotion/hash": ^0.9.0 + "@rocket.chat/css-supports": ^0.31.25 + "@rocket.chat/memo": ^0.31.25 + "@rocket.chat/stylis-logical-props-middleware": ^0.31.25 + stylis: ~4.1.3 + checksum: c9c60816a2517ed8fff7289587301421f0f36c064b7d8b99698470c8676b17f339be799a5703e9575437ccf1e4dafe2c12ca96264ef711d96388e196b8a38123 + languageName: node + linkType: hard + "@rocket.chat/css-in-js@npm:next, @rocket.chat/css-in-js@npm:~0.31.26-dev.19": version: 0.31.26-dev.19 resolution: "@rocket.chat/css-in-js@npm:0.31.26-dev.19" @@ -7928,16 +7941,12 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/css-in-js@npm:~0.31.26-dev.23": - version: 0.31.26-dev.23 - resolution: "@rocket.chat/css-in-js@npm:0.31.26-dev.23" +"@rocket.chat/css-supports@npm:^0.31.25": + version: 0.31.25 + resolution: "@rocket.chat/css-supports@npm:0.31.25" dependencies: - "@emotion/hash": ^0.9.0 - "@rocket.chat/css-supports": ~0.31.26-dev.23 - "@rocket.chat/memo": ~0.31.26-dev.23 - "@rocket.chat/stylis-logical-props-middleware": ~0.31.26-dev.23 - stylis: ~4.1.3 - checksum: 6d71bd0f232c8ea3fc2711347064ddd14925b1c2b8713f6d7649b98679455029a53ee41d08b98d010da3ea4789afa21a15901a92efef61dee7b32d6965157445 + "@rocket.chat/memo": ^0.31.25 + checksum: fb7fde175475af41a77c105bacbc10b56d883b75046eb1c15c65d977a2388166d927afa4953296a133037a78eae41c628c376ca4a155a0254930b64a9b3bc12b languageName: node linkType: hard @@ -7950,15 +7959,6 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/css-supports@npm:~0.31.26-dev.23": - version: 0.31.26-dev.23 - resolution: "@rocket.chat/css-supports@npm:0.31.26-dev.23" - dependencies: - "@rocket.chat/memo": ~0.31.26-dev.23 - checksum: a4f25562df67214b1c92c85a1cd16eb03fc2aea385f48cdde42ad0053b9e03a92ca9e3486d1387c7a31cf68f47fa888825f31acae8f4700ee2b9f03495286a12 - languageName: node - linkType: hard - "@rocket.chat/ddp-client@workspace:^, @rocket.chat/ddp-client@workspace:ee/packages/ddp-client": version: 0.0.0-use.local resolution: "@rocket.chat/ddp-client@workspace:ee/packages/ddp-client" @@ -8124,15 +8124,15 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/fuselage-hooks@npm:next, @rocket.chat/fuselage-hooks@npm:~0.32.0-dev.342": - version: 0.32.0-dev.342 - resolution: "@rocket.chat/fuselage-hooks@npm:0.32.0-dev.342" +"@rocket.chat/fuselage-hooks@npm:^0.32.1": + version: 0.32.1 + resolution: "@rocket.chat/fuselage-hooks@npm:0.32.1" dependencies: use-sync-external-store: ~1.2.0 peerDependencies: "@rocket.chat/fuselage-tokens": "*" react: ^17.0.2 - checksum: aa5f10490cc2e11f3ca30a20bac945e543d9e1760a4c08168314e4df7f67da347c597edb63e452ad80b68f13721f2c7ac6ceae36b168a93edfae5146247240c5 + checksum: caf9b7e999f02cc0cbc3ca23e903cbd5da4b1870278d903aafadcb67df00f709ea055dc1bd8facd6d572851fcbb01317029131cc40239e29f61797685b37292a languageName: node linkType: hard @@ -8164,6 +8164,13 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/fuselage-tokens@npm:^0.31.25": + version: 0.31.25 + resolution: "@rocket.chat/fuselage-tokens@npm:0.31.25" + checksum: d05460f2f7b7f01b1498aab6fb7d932b7d752d55ce5a6bad6e7a42f2c1f056164ff8caa7dd8ec11bc0f4441a83d8aad0b8aab5e02c03f3452c4583d159b1a2f7 + languageName: node + linkType: hard + "@rocket.chat/fuselage-tokens@npm:next": version: 0.32.0-dev.379 resolution: "@rocket.chat/fuselage-tokens@npm:0.32.0-dev.379" @@ -8171,28 +8178,21 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/fuselage-tokens@npm:~0.32.0-dev.383": - version: 0.32.0-dev.383 - resolution: "@rocket.chat/fuselage-tokens@npm:0.32.0-dev.383" - checksum: bd3504fa6a7ce4ed6fc91246c4c8a4e3e3da8bc5e2c5590e7f913bc1fd6f08896aa4a6c4b1d01dccf78267ade9ad5a831c788cb17a4eb744deefb45032a34894 - languageName: node - linkType: hard - "@rocket.chat/fuselage-ui-kit@workspace:^, @rocket.chat/fuselage-ui-kit@workspace:packages/fuselage-ui-kit, @rocket.chat/fuselage-ui-kit@workspace:~": version: 0.0.0-use.local resolution: "@rocket.chat/fuselage-ui-kit@workspace:packages/fuselage-ui-kit" dependencies: "@rocket.chat/apps-engine": 1.41.0-alpha.290 "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/fuselage": next - "@rocket.chat/fuselage-hooks": next + "@rocket.chat/fuselage": ^0.32.1 + "@rocket.chat/fuselage-hooks": ^0.32.1 "@rocket.chat/fuselage-polyfills": next "@rocket.chat/gazzodown": "workspace:^" - "@rocket.chat/icons": next + "@rocket.chat/icons": ^0.32.0 "@rocket.chat/prettier-config": next "@rocket.chat/styled": next "@rocket.chat/ui-contexts": "workspace:^" - "@rocket.chat/ui-kit": next + "@rocket.chat/ui-kit": ^0.32.1 "@rocket.chat/ui-video-conf": "workspace:^" "@storybook/addon-essentials": ~6.5.16 "@storybook/addons": ~6.5.16 @@ -8233,15 +8233,15 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/fuselage@npm:next": - version: 0.32.0-dev.433 - resolution: "@rocket.chat/fuselage@npm:0.32.0-dev.433" +"@rocket.chat/fuselage@npm:^0.32.1": + version: 0.32.1 + resolution: "@rocket.chat/fuselage@npm:0.32.1" dependencies: - "@rocket.chat/css-in-js": ~0.31.26-dev.23 - "@rocket.chat/css-supports": ~0.31.26-dev.23 - "@rocket.chat/fuselage-tokens": ~0.32.0-dev.383 - "@rocket.chat/memo": ~0.31.26-dev.23 - "@rocket.chat/styled": ~0.31.26-dev.23 + "@rocket.chat/css-in-js": ^0.31.25 + "@rocket.chat/css-supports": ^0.31.25 + "@rocket.chat/fuselage-tokens": ^0.31.25 + "@rocket.chat/memo": ^0.31.25 + "@rocket.chat/styled": ^0.31.25 invariant: ^2.2.4 react-aria: ~3.23.1 react-keyed-flatten-children: ^1.3.0 @@ -8253,7 +8253,7 @@ __metadata: react: ^17.0.2 react-dom: ^17.0.2 react-virtuoso: 1.2.4 - checksum: 2696da3e5cdf9d21c9c96ba069a3ef44b946ce832796ed10047666da780ee3ae88d679f3c3222fe6c6d88b1bdc0b7dab97c83d0acfbb67ca330a14b6e4739aa9 + checksum: d3937be369a4b8e0d9849f5131a0143defcc313a38c2f4055a4d9bf2be6234c09244e71fde6c0adc90fbdfac8a0d572122e5fbbdac5c83656ac27063042ec94c languageName: node linkType: hard @@ -8264,7 +8264,7 @@ __metadata: "@babel/core": ~7.22.9 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/css-in-js": next - "@rocket.chat/fuselage": next + "@rocket.chat/fuselage": ^0.32.1 "@rocket.chat/fuselage-tokens": next "@rocket.chat/message-parser": next "@rocket.chat/styled": next @@ -8336,10 +8336,10 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/icons@npm:next": - version: 0.32.0-dev.411 - resolution: "@rocket.chat/icons@npm:0.32.0-dev.411" - checksum: edbb691e61bac3c8502f21fb8166af40c8fc48767e1feeeb7e9731c8761d1f7411aeca81e2ac8f23032a04f1e585c3d822a1a211d5f304287843916c26c8b4ba +"@rocket.chat/icons@npm:^0.32.0": + version: 0.32.0 + resolution: "@rocket.chat/icons@npm:0.32.0" + checksum: 013c819eaaa5a2abc6e35f237e904c35ba105eb0be101dadba678732815423c3a4e01e0e65d0301acfeac77bc59e3aa2bc997744e3c7611c0814c733118cb248 languageName: node linkType: hard @@ -8380,11 +8380,11 @@ __metadata: "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/fuselage-tokens": next "@rocket.chat/gazzodown": "workspace:^" - "@rocket.chat/logo": next + "@rocket.chat/logo": ^0.31.27 "@rocket.chat/message-parser": next "@rocket.chat/random": "workspace:~" "@rocket.chat/sdk": ^1.0.0-alpha.42 - "@rocket.chat/ui-kit": next + "@rocket.chat/ui-kit": ^0.32.1 "@storybook/addon-essentials": ~6.5.16 "@storybook/addon-postcss": ~2.0.0 "@storybook/preact": ~6.5.16 @@ -8491,16 +8491,23 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/logo@npm:next": - version: 0.32.0-dev.379 - resolution: "@rocket.chat/logo@npm:0.32.0-dev.379" +"@rocket.chat/logo@npm:^0.31.27": + version: 0.31.27 + resolution: "@rocket.chat/logo@npm:0.31.27" dependencies: - "@rocket.chat/fuselage-hooks": ~0.32.0-dev.342 - "@rocket.chat/styled": ~0.31.26-dev.19 + "@rocket.chat/fuselage-hooks": ^0.32.1 + "@rocket.chat/styled": ^0.31.25 peerDependencies: react: 17.0.2 react-dom: 17.0.2 - checksum: 6bba31313e2cc047bdae4e711a0411a2c786ca98ee12f1f597837fb74ec139d13ad75d2bcb419c7b4e798eb1a8ae06eeefcd039adda60fe7fb4024f53f0bc708 + checksum: acc56410813a0d4f634f9e847bc4b49275c26aff4e2f285720818cb012a2ad42554982fcc4078c485222a9c9a78244d1a4b16b60588b5c50441b8928c3957efb + languageName: node + linkType: hard + +"@rocket.chat/memo@npm:^0.31.25": + version: 0.31.25 + resolution: "@rocket.chat/memo@npm:0.31.25" + checksum: 92d595c68d76a5258fb37ed4639e2709ba290c5d240df1272d81a2ab6b4be28ee2dd5b721dad940fe2638a89e8d14e684a970c59890003a06ce6088c655b7c0e languageName: node linkType: hard @@ -8511,13 +8518,6 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/memo@npm:~0.31.26-dev.23": - version: 0.31.26-dev.23 - resolution: "@rocket.chat/memo@npm:0.31.26-dev.23" - checksum: 68301161d87ba25347f1d2ab85c139ba86c5fdd1101f41678808c19ba461772814f4bff048a30e4aefd08978fe2feb952c541bddc0beb6bc3cd190bd7852393b - languageName: node - linkType: hard - "@rocket.chat/message-parser@npm:next": version: 0.32.0-dev.377 resolution: "@rocket.chat/message-parser@npm:0.32.0-dev.377" @@ -8568,21 +8568,21 @@ __metadata: "@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": ^0.32.1 + "@rocket.chat/fuselage-hooks": ^0.32.1 "@rocket.chat/fuselage-polyfills": next "@rocket.chat/fuselage-toastbar": next "@rocket.chat/fuselage-tokens": next "@rocket.chat/fuselage-ui-kit": "workspace:^" "@rocket.chat/gazzodown": "workspace:^" "@rocket.chat/i18n": "workspace:^" - "@rocket.chat/icons": next + "@rocket.chat/icons": ^0.32.0 "@rocket.chat/instance-status": "workspace:^" "@rocket.chat/layout": next "@rocket.chat/livechat": "workspace:^" "@rocket.chat/log-format": "workspace:^" "@rocket.chat/logger": "workspace:^" - "@rocket.chat/logo": next + "@rocket.chat/logo": ^0.31.27 "@rocket.chat/memo": next "@rocket.chat/message-parser": next "@rocket.chat/mock-providers": "workspace:^" @@ -8590,7 +8590,7 @@ __metadata: "@rocket.chat/models": "workspace:^" "@rocket.chat/mp3-encoder": 0.24.0 "@rocket.chat/omnichannel-services": "workspace:^" - "@rocket.chat/onboarding-ui": next + "@rocket.chat/onboarding-ui": ^0.32.1 "@rocket.chat/password-policies": "workspace:^" "@rocket.chat/pdf-worker": "workspace:^" "@rocket.chat/poplib": "workspace:^" @@ -8604,7 +8604,7 @@ __metadata: "@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.32.1 "@rocket.chat/ui-theming": "workspace:^" "@rocket.chat/ui-video-conf": "workspace:^" "@rocket.chat/web-ui-registration": "workspace:^" @@ -9033,9 +9033,9 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/onboarding-ui@npm:next": - version: 0.32.0-dev.429 - resolution: "@rocket.chat/onboarding-ui@npm:0.32.0-dev.429" +"@rocket.chat/onboarding-ui@npm:^0.32.1": + version: 0.32.1 + resolution: "@rocket.chat/onboarding-ui@npm:0.32.1" dependencies: i18next: ~21.6.16 react-hook-form: ~7.27.1 @@ -9050,7 +9050,7 @@ __metadata: react: 17.0.2 react-dom: 17.0.2 react-i18next: ~11.15.4 - checksum: 659d97a38b4ce94b18a931087d948fcdc3caf98853d1402eef8867d4f26d8f083f50764b46c6fd18c91f193b6de248d80a3654e8e8a6673ebea3dafd2044b22e + checksum: 362938332de5d865e12b891288e631e579e1f6f0d8da99004d27d1fc5722e25821b68cb60de8cb51cf8768daae0f9bf68cbd374580e8e8bfdb292f8ed6ee8cb1 languageName: node linkType: hard @@ -9254,7 +9254,7 @@ __metadata: "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/message-parser": next - "@rocket.chat/ui-kit": next + "@rocket.chat/ui-kit": ^0.32.1 "@types/jest": ~29.5.3 ajv: ^8.11.0 ajv-formats: ^2.1.1 @@ -9354,7 +9354,16 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/styled@npm:next, @rocket.chat/styled@npm:~0.31.26-dev.19": +"@rocket.chat/styled@npm:^0.31.25": + version: 0.31.25 + resolution: "@rocket.chat/styled@npm:0.31.25" + dependencies: + "@rocket.chat/css-in-js": ^0.31.25 + checksum: 8b0a2b3d6248ab8256736da058061e5f1a2f6a4455a20d0e0b6b75887ac82a0bbfbfe91bd60e278f3462e849ef744f38093a9acc7c3ba5db46f00fd640d7a52e + languageName: node + linkType: hard + +"@rocket.chat/styled@npm:next": version: 0.31.26-dev.19 resolution: "@rocket.chat/styled@npm:0.31.26-dev.19" dependencies: @@ -9363,12 +9372,14 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/styled@npm:~0.31.26-dev.23": - version: 0.31.26-dev.23 - resolution: "@rocket.chat/styled@npm:0.31.26-dev.23" +"@rocket.chat/stylis-logical-props-middleware@npm:^0.31.25": + version: 0.31.25 + resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.25" dependencies: - "@rocket.chat/css-in-js": ~0.31.26-dev.23 - checksum: 0a1ff89b068f011097671c617844856b91f2477c16ff3771fcfc0bab62a905a9b21c7b79549ff028613700a72685fd591ba9cbeda6b5d3bd8becd3af7aef0498 + "@rocket.chat/css-supports": ^0.31.25 + peerDependencies: + stylis: 4.0.10 + checksum: b0bc2afa2f020d65dc4af3f0180c6b7538471b2deeef026421a57d89a6279596fe6be14ab96d1634229b27308a0867c11db2684f9a51e5bc07683b6d0dc96c91 languageName: node linkType: hard @@ -9383,17 +9394,6 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/stylis-logical-props-middleware@npm:~0.31.26-dev.23": - version: 0.31.26-dev.23 - resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.26-dev.23" - dependencies: - "@rocket.chat/css-supports": ~0.31.26-dev.23 - peerDependencies: - stylis: 4.0.10 - checksum: b2fbfad3b2f4dedd9023b30d4cdc51e76ae76faeeca5819cf697e896c02fd4bb2dde5bbc428b377d77f32011fd8cc82c6d98a84d66b93056ef981c13aee1dc67 - languageName: node - linkType: hard - "@rocket.chat/tools@workspace:^, @rocket.chat/tools@workspace:packages/tools": version: 0.0.0-use.local resolution: "@rocket.chat/tools@workspace:packages/tools" @@ -9413,9 +9413,9 @@ __metadata: dependencies: "@babel/core": ~7.22.9 "@rocket.chat/css-in-js": next - "@rocket.chat/fuselage": next - "@rocket.chat/fuselage-hooks": next - "@rocket.chat/icons": next + "@rocket.chat/fuselage": ^0.32.1 + "@rocket.chat/fuselage-hooks": ^0.32.1 + "@rocket.chat/icons": ^0.32.0 "@rocket.chat/mock-providers": "workspace:^" "@rocket.chat/ui-contexts": "workspace:~" "@storybook/addon-actions": ~6.5.16 @@ -9464,8 +9464,8 @@ __metadata: dependencies: "@babel/core": ~7.22.9 "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/fuselage": next - "@rocket.chat/icons": next + "@rocket.chat/fuselage": ^0.32.1 + "@rocket.chat/icons": ^0.32.0 "@storybook/addon-actions": ~6.5.16 "@storybook/addon-docs": ~6.5.16 "@storybook/addon-essentials": ~6.5.16 @@ -9497,7 +9497,7 @@ __metadata: dependencies: "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/emitter": next - "@rocket.chat/fuselage-hooks": next + "@rocket.chat/fuselage-hooks": ^0.32.1 "@rocket.chat/password-policies": "workspace:^" "@rocket.chat/rest-typings": "workspace:^" "@types/jest": ~29.5.3 @@ -9523,10 +9523,10 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/ui-kit@npm:next": - version: 0.32.0-dev.364 - resolution: "@rocket.chat/ui-kit@npm:0.32.0-dev.364" - checksum: 9ac84beb88d6c1c6519485510b0e0a8dfb94f5e090209484330d5e5c01766c1e9732fc833e489ea4a958a01d2ac1c0830420f8a2685a3ab4c636e8c0d341fdf1 +"@rocket.chat/ui-kit@npm:^0.32.1": + version: 0.32.1 + resolution: "@rocket.chat/ui-kit@npm:0.32.1" + checksum: dec0d2ebc23786dae2dc62d598b89482abbd810a71527ba99a5fb0f36e3de51647e4ab13a0bb514d760156f92780c22a88317701d886fd934d848c0fd5961579 languageName: node linkType: hard @@ -9535,9 +9535,9 @@ __metadata: resolution: "@rocket.chat/ui-theming@workspace:ee/packages/ui-theming" dependencies: "@rocket.chat/css-in-js": next - "@rocket.chat/fuselage": next - "@rocket.chat/fuselage-hooks": next - "@rocket.chat/icons": next + "@rocket.chat/fuselage": ^0.32.1 + "@rocket.chat/fuselage-hooks": ^0.32.1 + "@rocket.chat/icons": ^0.32.0 "@rocket.chat/ui-contexts": "workspace:~" "@storybook/addon-actions": ~6.5.16 "@storybook/addon-docs": ~6.5.16 @@ -9578,9 +9578,9 @@ __metadata: "@rocket.chat/css-in-js": next "@rocket.chat/emitter": next "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/fuselage": next - "@rocket.chat/fuselage-hooks": next - "@rocket.chat/icons": next + "@rocket.chat/fuselage": ^0.32.1 + "@rocket.chat/fuselage-hooks": ^0.32.1 + "@rocket.chat/icons": ^0.32.0 "@rocket.chat/styled": next "@rocket.chat/ui-contexts": "workspace:^" "@storybook/addon-actions": ~6.5.16 @@ -9621,13 +9621,13 @@ __metadata: "@codemirror/tooltip": ^0.19.16 "@lezer/highlight": ^1.1.6 "@rocket.chat/css-in-js": next - "@rocket.chat/fuselage": next - "@rocket.chat/fuselage-hooks": next + "@rocket.chat/fuselage": ^0.32.1 + "@rocket.chat/fuselage-hooks": ^0.32.1 "@rocket.chat/fuselage-polyfills": next "@rocket.chat/fuselage-tokens": next "@rocket.chat/fuselage-ui-kit": "workspace:~" - "@rocket.chat/icons": next - "@rocket.chat/logo": next + "@rocket.chat/icons": ^0.32.0 + "@rocket.chat/logo": ^0.31.27 "@rocket.chat/styled": next "@rocket.chat/ui-contexts": "workspace:~" "@types/react": ~17.0.62 @@ -34245,13 +34245,13 @@ __metadata: "@rocket.chat/core-services": "workspace:^" "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/emitter": next - "@rocket.chat/icons": next + "@rocket.chat/icons": ^0.32.0 "@rocket.chat/message-parser": next "@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/ui-kit": ^0.32.1 "@types/cookie": ^0.5.1 "@types/cookie-parser": ^1.4.3 "@types/ejson": ^2.2.0 From c4bcbb244d6b55e65ffbd15f8be7a2a371131094 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Mon, 18 Sep 2023 17:22:42 +0000 Subject: [PATCH 160/275] Release 6.3.7 [no ci] --- .changeset/bump-patch-1694803137282.md | 5 --- .changeset/heavy-baboons-laugh.md | 5 --- .changeset/tall-pumpkins-cross.md | 5 --- .changeset/three-ants-give.md | 8 ----- apps/meteor/.docker/Dockerfile.rhel | 2 +- apps/meteor/CHANGELOG.md | 32 +++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 10 ++++++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 10 ++++++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 10 ++++++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 12 +++++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 11 +++++++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 11 +++++++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 10 ++++++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 9 ++++++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 7 ++++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 7 ++++ ee/packages/ddp-client/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 11 +++++++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 6 ++++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 9 ++++++ ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 8 +++++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 2 ++ packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 11 +++++++ packages/cron/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 8 +++++ packages/fuselage-ui-kit/package.json | 6 ++-- packages/gazzodown/CHANGELOG.md | 8 +++++ packages/gazzodown/package.json | 8 ++--- packages/instance-status/CHANGELOG.md | 6 ++++ packages/instance-status/package.json | 2 +- packages/model-typings/CHANGELOG.md | 6 ++++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 6 ++++ packages/models/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 6 ++++ packages/rest-typings/package.json | 2 +- packages/ui-client/CHANGELOG.md | 6 ++++ packages/ui-client/package.json | 4 +-- packages/ui-contexts/CHANGELOG.md | 8 +++++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 6 ++++ packages/ui-video-conf/package.json | 4 +-- packages/uikit-playground/CHANGELOG.md | 7 ++++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 6 ++++ packages/web-ui-registration/package.json | 4 +-- 63 files changed, 288 insertions(+), 62 deletions(-) delete mode 100644 .changeset/bump-patch-1694803137282.md delete mode 100644 .changeset/heavy-baboons-laugh.md delete mode 100644 .changeset/tall-pumpkins-cross.md delete mode 100644 .changeset/three-ants-give.md diff --git a/.changeset/bump-patch-1694803137282.md b/.changeset/bump-patch-1694803137282.md deleted file mode 100644 index e1eaa7980afb..000000000000 --- a/.changeset/bump-patch-1694803137282.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Bump @rocket.chat/meteor version. diff --git a/.changeset/heavy-baboons-laugh.md b/.changeset/heavy-baboons-laugh.md deleted file mode 100644 index 5c32965dcf62..000000000000 --- a/.changeset/heavy-baboons-laugh.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -User information crashing for some locales diff --git a/.changeset/tall-pumpkins-cross.md b/.changeset/tall-pumpkins-cross.md deleted file mode 100644 index e6cfd8a309b9..000000000000 --- a/.changeset/tall-pumpkins-cross.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/presence": patch ---- - -Fixed presence broadcast being disabled on server restart diff --git a/.changeset/three-ants-give.md b/.changeset/three-ants-give.md deleted file mode 100644 index 4d33fad05f39..000000000000 --- a/.changeset/three-ants-give.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@rocket.chat/cron": patch -"@rocket.chat/meteor": patch ---- - -Increase cron job check delay to 1 min from 5s. - -This reduces MongoDB requests introduced on 6.3. diff --git a/apps/meteor/.docker/Dockerfile.rhel b/apps/meteor/.docker/Dockerfile.rhel index df3f57884ce1..d3e487d58732 100644 --- a/apps/meteor/.docker/Dockerfile.rhel +++ b/apps/meteor/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 6.3.6 +ENV RC_VERSION 6.3.7 MAINTAINER buildmaster@rocket.chat diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index 411d568aadb5..96d6fff6050b 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,37 @@ # @rocket.chat/meteor +## 6.3.7 + +### Patch Changes + +- f1e36a5e46: Bump @rocket.chat/meteor version. +- Bump @rocket.chat/meteor version. +- e1acdda0a3: User information crashing for some locales +- deffcb187c: Increase cron job check delay to 1 min from 5s. + + This reduces MongoDB requests introduced on 6.3. + +- Updated dependencies [c655be17ca] +- Updated dependencies [deffcb187c] + - @rocket.chat/presence@0.0.13 + - @rocket.chat/cron@0.0.9 + - @rocket.chat/core-typings@6.3.7 + - @rocket.chat/rest-typings@6.3.7 + - @rocket.chat/api-client@0.1.7 + - @rocket.chat/omnichannel-services@0.0.13 + - @rocket.chat/pdf-worker@0.0.13 + - @rocket.chat/core-services@0.1.7 + - @rocket.chat/gazzodown@1.0.7 + - @rocket.chat/model-typings@0.0.13 + - @rocket.chat/ui-contexts@1.0.7 + - @rocket.chat/fuselage-ui-kit@1.0.7 + - @rocket.chat/models@0.0.13 + - @rocket.chat/ui-theming@0.0.1 + - @rocket.chat/ui-client@1.0.7 + - @rocket.chat/ui-video-conf@1.0.7 + - @rocket.chat/web-ui-registration@1.0.7 + - @rocket.chat/instance-status@0.0.13 + ## 6.3.6 ### Patch Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index dd5225ccd8d7..b935af1f7ffb 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.3.6" + "version": "6.3.7" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index fef6a1afd627..23b4cd06356b 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,15 @@ # rocketchat-services +## 1.1.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 +- @rocket.chat/rest-typings@6.3.7 +- @rocket.chat/core-services@0.1.7 +- @rocket.chat/model-typings@0.0.13 +- @rocket.chat/models@0.0.13 + ## 1.1.6 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 9cd474d8d313..0c5852eb93ec 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.6", + "version": "1.1.7", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 03b83755faa5..b74c2f132ff0 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.3.6", + "version": "6.3.7", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index 9fabd0886289..9c51b05fd23f 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/account-service +## 0.2.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 +- @rocket.chat/rest-typings@6.3.7 +- @rocket.chat/core-services@0.1.7 +- @rocket.chat/model-typings@0.0.13 +- @rocket.chat/models@0.0.13 + ## 0.2.6 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index 4d987dd0a002..b4ac82ad1e7a 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.2.6", + "version": "0.2.7", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index 528320aa2622..7a8af00bc19f 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/authorization-service +## 0.2.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 +- @rocket.chat/rest-typings@6.3.7 +- @rocket.chat/core-services@0.1.7 +- @rocket.chat/model-typings@0.0.13 +- @rocket.chat/models@0.0.13 + ## 0.2.6 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index 60ca18dcd9dd..62aa5e90fb0e 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.2.6", + "version": "0.2.7", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index f5a32f533a43..9aaca27d880c 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/ddp-streamer +## 0.1.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 +- @rocket.chat/rest-typings@6.3.7 +- @rocket.chat/core-services@0.1.7 +- @rocket.chat/model-typings@0.0.13 +- @rocket.chat/ui-contexts@1.0.7 +- @rocket.chat/models@0.0.13 +- @rocket.chat/instance-status@0.0.13 + ## 0.1.6 ### Patch Changes diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 2db7333fe350..30536fcb016a 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.1.6", + "version": "0.1.7", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index dcb38ad24016..b80c4c4326cf 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-transcript +## 0.2.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 +- @rocket.chat/omnichannel-services@0.0.13 +- @rocket.chat/pdf-worker@0.0.13 +- @rocket.chat/core-services@0.1.7 +- @rocket.chat/model-typings@0.0.13 +- @rocket.chat/models@0.0.13 + ## 0.2.6 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index 4b6edef420de..3d4a7b94660e 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.2.6", + "version": "0.2.7", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index ac9e0c98c089..dda3e011bcd3 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/presence-service +## 0.2.7 + +### Patch Changes + +- Updated dependencies [c655be17ca] + - @rocket.chat/presence@0.0.13 + - @rocket.chat/core-typings@6.3.7 + - @rocket.chat/core-services@0.1.7 + - @rocket.chat/model-typings@0.0.13 + - @rocket.chat/models@0.0.13 + ## 0.2.6 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index a2c39e0518c2..a62c0ca13e30 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.2.6", + "version": "0.2.7", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index cb7e231f3aa6..9815146e9473 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/queue-worker +## 0.2.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 +- @rocket.chat/omnichannel-services@0.0.13 +- @rocket.chat/core-services@0.1.7 +- @rocket.chat/model-typings@0.0.13 +- @rocket.chat/models@0.0.13 + ## 0.2.6 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index 8c6df52977ce..d387cbacf672 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.2.6", + "version": "0.2.7", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index 2d03cc992eb3..fb085d7f33f6 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/stream-hub-service +## 0.2.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 +- @rocket.chat/core-services@0.1.7 +- @rocket.chat/model-typings@0.0.13 +- @rocket.chat/models@0.0.13 + ## 0.2.6 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index aacd997473e1..8c63d9139f58 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.2.6", + "version": "0.2.7", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index 7424a2793b7f..b2319217ca04 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/api-client +## 0.1.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 +- @rocket.chat/rest-typings@6.3.7 + ## 0.1.6 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index 463a1a835059..f495aad8c2cc 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/api-client", - "version": "0.1.6", + "version": "0.1.7", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index 067872b9102e..b2688046c3b4 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/ddp-client +## 0.1.7 + +### Patch Changes + +- @rocket.chat/rest-typings@6.3.7 +- @rocket.chat/api-client@0.1.7 + ## 0.1.6 ### Patch Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index da4701cfa450..2a3d6781604d 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ddp-client", - "version": "0.1.6", + "version": "0.1.7", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index 2978b6e0d040..571b5a37d8c8 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-services +## 0.0.13 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 +- @rocket.chat/rest-typings@6.3.7 +- @rocket.chat/pdf-worker@0.0.13 +- @rocket.chat/core-services@0.1.7 +- @rocket.chat/model-typings@0.0.13 +- @rocket.chat/models@0.0.13 + ## 0.0.12 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index b52222b745e6..6e8febc74c5c 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.0.12", + "version": "0.0.13", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index 854547b5f9ec..455f7a1c812a 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/pdf-worker +## 0.0.13 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 + ## 0.0.12 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index 5523064812b7..bead0f932479 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.12", + "version": "0.0.13", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index bb5797aa4bf0..1f016c3444f3 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/presence +## 0.0.13 + +### Patch Changes + +- c655be17ca: Fixed presence broadcast being disabled on server restart + - @rocket.chat/core-typings@6.3.7 + - @rocket.chat/core-services@0.1.7 + - @rocket.chat/models@0.0.13 + ## 0.0.12 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 5c4d5ff68864..2673492d3478 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.0.12", + "version": "0.0.13", "private": true, "devDependencies": { "@babel/core": "~7.22.5", diff --git a/package.json b/package.json index 4674313c5096..5694c9fbb272 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.3.6", + "version": "6.3.7", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index e3f1dae4abc0..fd41b1590561 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/core-services +## 0.1.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 +- @rocket.chat/rest-typings@6.3.7 +- @rocket.chat/models@0.0.13 + ## 0.1.6 ### Patch Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 2222ac18e05a..9cd516f40482 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.1.6", + "version": "0.1.7", "private": true, "devDependencies": { "@babel/core": "^7.21.4", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index 94c719551e59..61d75230a51a 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,7 @@ # @rocket.chat/core-typings +## 6.3.7 + ## 6.3.6 ## 6.3.5 diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 3cd0a312aa4b..e7e14a015f5d 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-typings", - "version": "6.3.6", + "version": "6.3.7", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.43.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index 2bee9aea43fe..cd1e4fa30fdb 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/cron +## 0.0.9 + +### Patch Changes + +- deffcb187c: Increase cron job check delay to 1 min from 5s. + + This reduces MongoDB requests introduced on 6.3. + + - @rocket.chat/core-typings@6.3.7 + - @rocket.chat/models@0.0.13 + ## 0.0.8 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index ffec42e7056a..4d47f033c2e9 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.8", + "version": "0.0.9", "private": true, "devDependencies": { "@types/jest": "^27.4.1", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index 4f4601173288..7166ffa4156c 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 1.0.7 + +### Patch Changes + +- @rocket.chat/gazzodown@1.0.7 +- @rocket.chat/ui-contexts@1.0.7 +- @rocket.chat/ui-video-conf@1.0.7 + ## 1.0.6 ### Patch Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 2330e2825076..0f1e51236701 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "1.0.6", + "version": "1.0.7", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -47,9 +47,9 @@ "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "1.0.6", + "@rocket.chat/ui-contexts": "1.0.7", "@rocket.chat/ui-kit": "*", - "@rocket.chat/ui-video-conf": "1.0.6", + "@rocket.chat/ui-video-conf": "1.0.7", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index 8eadf7c8ee12..8cf02c341289 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/gazzodown +## 1.0.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 +- @rocket.chat/ui-contexts@1.0.7 +- @rocket.chat/ui-client@1.0.7 + ## 1.0.6 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index 00acba4363c7..52920f1ab0eb 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "1.0.6", + "version": "1.0.7", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.3.6", + "@rocket.chat/core-typings": "6.3.7", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "1.0.6", - "@rocket.chat/ui-contexts": "1.0.6", + "@rocket.chat/ui-client": "1.0.7", + "@rocket.chat/ui-contexts": "1.0.7", "katex": "*", "react": "*" }, diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index 830f4b9304a7..da85d7db80a9 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/instance-status +## 0.0.13 + +### Patch Changes + +- @rocket.chat/models@0.0.13 + ## 0.0.12 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index b47b71936a9f..25fb1c9d2d66 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.12", + "version": "0.0.13", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index 26ccaa9524bf..93da1df73b53 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/model-typings +## 0.0.13 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 + ## 0.0.12 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index 2029970c8a62..7ff5137d3cf8 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.0.12", + "version": "0.0.13", "private": true, "devDependencies": { "@types/jest": "~29.5.2", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index 3f7d7e9456bd..bb0b5fcbeae4 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/models +## 0.0.13 + +### Patch Changes + +- @rocket.chat/model-typings@0.0.13 + ## 0.0.12 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index f4991ae85db1..afbeb9a4a064 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.12", + "version": "0.0.13", "private": true, "devDependencies": { "@types/jest": "~29.5.2", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index b708dfc8ac89..e4b1f8404baa 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/rest-typings +## 6.3.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 + ## 6.3.6 ### Patch Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index f4d6c8c6beb8..ace18183d75a 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/rest-typings", - "version": "6.3.6", + "version": "6.3.7", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.2", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index 3dc07e124e60..13f7f1e15c47 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-client +## 1.0.7 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.7 + ## 1.0.6 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 6b5b5959a4bf..005b5f907fcf 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "1.0.6", + "version": "1.0.7", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -53,7 +53,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "1.0.6", + "@rocket.chat/ui-contexts": "1.0.7", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index dd6bf6a33e6e..7ad26d9922f9 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/ui-contexts +## 1.0.7 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.7 +- @rocket.chat/rest-typings@6.3.7 +- @rocket.chat/ddp-client@0.1.7 + ## 1.0.6 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 979442310f20..7593c5cfbed7 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "1.0.6", + "version": "1.0.7", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index a0b379bf3b6b..065b35d06a5b 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-video-conf +## 1.0.7 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.7 + ## 1.0.6 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index fbd8c6843909..ef91ecfbd614 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "1.0.6", + "version": "1.0.7", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "1.0.6", + "@rocket.chat/ui-contexts": "1.0.7", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index 0f539a5fdbb9..c5affc035808 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/uikit-playground +## 0.1.7 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.7 +- @rocket.chat/fuselage-ui-kit@1.0.7 + ## 0.1.6 ### Patch Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index 58930541bedd..a54583fefcb1 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.1.6", + "version": "0.1.7", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index c87f91401ab9..09391c50e1fe 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/web-ui-registration +## 1.0.7 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.7 + ## 1.0.6 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index 686ddff549b4..d14a406bb1e1 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "1.0.6", + "version": "1.0.7", "private": true, "devDependencies": { "@rocket.chat/layout": "next", @@ -17,7 +17,7 @@ }, "peerDependencies": { "@rocket.chat/layout": "*", - "@rocket.chat/ui-contexts": "1.0.6", + "@rocket.chat/ui-contexts": "1.0.7", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", From 614a9b8fc83588b16d8860fd1b111c6c1e14948d Mon Sep 17 00:00:00 2001 From: Yash Rajpal <58601732+yash-rajpal@users.noreply.github.com> Date: Mon, 18 Sep 2023 23:16:58 +0530 Subject: [PATCH 161/275] regression: Show correct date for last day time (#30407) --- .changeset/heavy-zebras-wonder.md | 5 +++++ apps/meteor/client/hooks/useTimeAgo.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/heavy-zebras-wonder.md diff --git a/.changeset/heavy-zebras-wonder.md b/.changeset/heavy-zebras-wonder.md new file mode 100644 index 000000000000..a1904a81c514 --- /dev/null +++ b/.changeset/heavy-zebras-wonder.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Show correct date for last day time diff --git a/apps/meteor/client/hooks/useTimeAgo.ts b/apps/meteor/client/hooks/useTimeAgo.ts index 2b661ae89cf3..724f61d8c7c8 100644 --- a/apps/meteor/client/hooks/useTimeAgo.ts +++ b/apps/meteor/client/hooks/useTimeAgo.ts @@ -14,7 +14,7 @@ export const useTimeAgo = (): ((time: Date | number | string) => string) => { (time) => { return moment(time).calendar(null, { sameDay: format, - lastDay: moment().calendar('lastDay').replace('LT', format), + lastDay: moment(time).calendar('lastDay').replace('LT', format), lastWeek: `dddd ${format}`, sameElse: 'LL', }); From c15b1b7474e83615ae11436d5bedbb47ab8d0a6f Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Mon, 18 Sep 2023 16:37:31 -0300 Subject: [PATCH 162/275] chore: remove Troubleshoot options (#30429) --- apps/meteor/app/cloud/server/index.ts | 26 +++++-------------- .../rocketchat-i18n/i18n/en.i18n.json | 4 --- apps/meteor/server/cron/statistics.ts | 24 +++-------------- apps/meteor/server/settings/troubleshoot.ts | 26 +++++++++++++------ 4 files changed, 27 insertions(+), 53 deletions(-) diff --git a/apps/meteor/app/cloud/server/index.ts b/apps/meteor/app/cloud/server/index.ts index 4bb1f634978e..c7e783d4d5aa 100644 --- a/apps/meteor/app/cloud/server/index.ts +++ b/apps/meteor/app/cloud/server/index.ts @@ -2,7 +2,6 @@ import { cronJobs } from '@rocket.chat/cron'; import { Meteor } from 'meteor/meteor'; import { SystemLogger } from '../../../server/lib/logger/system'; -import { settings } from '../../settings/server'; import { connectWorkspace } from './functions/connectWorkspace'; import { getWorkspaceAccessToken } from './functions/getWorkspaceAccessToken'; import { getWorkspaceAccessTokenWithScope } from './functions/getWorkspaceAccessTokenWithScope'; @@ -13,24 +12,6 @@ import './methods'; const licenseCronName = 'Cloud Workspace Sync'; Meteor.startup(async () => { - // run token/license sync if registered - let TroubleshootDisableWorkspaceSync: boolean; - settings.watch('Troubleshoot_Disable_Workspace_Sync', async (value) => { - if (TroubleshootDisableWorkspaceSync === value) { - return; - } - TroubleshootDisableWorkspaceSync = value; - - if (value) { - return cronJobs.remove(licenseCronName); - } - - setImmediate(() => syncWorkspace()); - await cronJobs.add(licenseCronName, '0 */12 * * *', async () => { - await syncWorkspace(); - }); - }); - const { workspaceRegistered } = await retrieveRegistrationStatus(); if (process.env.REG_TOKEN && process.env.REG_TOKEN !== '' && !workspaceRegistered) { @@ -43,9 +24,14 @@ Meteor.startup(async () => { console.log('Successfully registered with token provided by REG_TOKEN!'); } catch (e: any) { - SystemLogger.error('An error occured registering with token.', e.message); + SystemLogger.error('An error occurred registering with token.', e.message); } } + + setImmediate(() => syncWorkspace()); + await cronJobs.add(licenseCronName, '0 */12 * * *', async () => { + await syncWorkspace(); + }); }); export { getWorkspaceAccessToken, getWorkspaceAccessTokenWithScope }; diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index e8b2a9fcdebf..1ad2e3702b63 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -5174,10 +5174,6 @@ "Troubleshoot_Disable_Presence_Broadcast_Alert": "This setting prevents all instances form sending the status changes of the users to their clients keeping all the users with their presence status from the first load!", "Troubleshoot_Disable_Sessions_Monitor": "Disable Sessions Monitor", "Troubleshoot_Disable_Sessions_Monitor_Alert": "This setting stops the processing of user sessions causing the statistics to stop working correctly!", - "Troubleshoot_Disable_Statistics_Generator": "Disable Statistics Generator", - "Troubleshoot_Disable_Statistics_Generator_Alert": "This setting stops the processing all statistics making the info page outdated until someone clicks on the refresh button and may cause other missing information around the system!", - "Troubleshoot_Disable_Workspace_Sync": "Disable Workspace Sync", - "Troubleshoot_Disable_Workspace_Sync_Alert": "This setting stops the sync of this server with Rocket.Chat's cloud and may cause issues with marketplace and enteprise licenses!", "Troubleshoot_Disable_Teams_Mention": "Disable Teams mention", "Troubleshoot_Disable_Teams_Mention_Alert": "This setting disables the teams mention feature. User's won't be able to mention a Team by name in a message and get its members notified.", "True": "True", diff --git a/apps/meteor/server/cron/statistics.ts b/apps/meteor/server/cron/statistics.ts index b6f58b66d383..27c1fc064e25 100644 --- a/apps/meteor/server/cron/statistics.ts +++ b/apps/meteor/server/cron/statistics.ts @@ -32,28 +32,10 @@ async function generateStatistics(logger: Logger): Promise { } export async function statsCron(logger: Logger): Promise { - if (settings.get('Troubleshoot_Disable_Statistics_Generator')) { - return; - } - const name = 'Generate and save statistics'; + await generateStatistics(logger); - let previousValue: boolean; - settings.watch('Troubleshoot_Disable_Statistics_Generator', async (value) => { - if (value === previousValue) { - return; - } - previousValue = value; - - if (value) { - await cronJobs.remove(name); - return; - } - - await generateStatistics(logger); - - const now = new Date(); + const now = new Date(); - await cronJobs.add(name, `12 ${now.getHours()} * * *`, async () => generateStatistics(logger)); - }); + await cronJobs.add(name, `12 ${now.getHours()} * * *`, async () => generateStatistics(logger)); } diff --git a/apps/meteor/server/settings/troubleshoot.ts b/apps/meteor/server/settings/troubleshoot.ts index bc1cd1484301..bfecb1a344f6 100644 --- a/apps/meteor/server/settings/troubleshoot.ts +++ b/apps/meteor/server/settings/troubleshoot.ts @@ -32,20 +32,30 @@ export const createTroubleshootSettings = () => type: 'boolean', i18nDescription: 'Troubleshoot_Disable_Livechat_Activity_Monitor_Alert', }); - await this.add('Troubleshoot_Disable_Statistics_Generator', false, { - type: 'boolean', - i18nDescription: 'Troubleshoot_Disable_Statistics_Generator_Alert', - }); + await this.add('Troubleshoot_Disable_Data_Exporter_Processor', false, { type: 'boolean', i18nDescription: 'Troubleshoot_Disable_Data_Exporter_Processor_Alert', }); - await this.add('Troubleshoot_Disable_Workspace_Sync', false, { - type: 'boolean', - i18nDescription: 'Troubleshoot_Disable_Workspace_Sync_Alert', - }); await this.add('Troubleshoot_Disable_Teams_Mention', false, { type: 'boolean', i18nDescription: 'Troubleshoot_Disable_Teams_Mention_Alert', }); + + // TODO: remove this setting at next major (7.0.0) + await this.add('Troubleshoot_Disable_Statistics_Generator', false, { + type: 'boolean', + i18nDescription: 'Troubleshoot_Disable_Statistics_Generator_Alert', + private: true, + hidden: true, + readonly: true, + }); + // TODO: remove this setting at next major (7.0.0) + await this.add('Troubleshoot_Disable_Workspace_Sync', false, { + type: 'boolean', + i18nDescription: 'Troubleshoot_Disable_Workspace_Sync_Alert', + private: true, + hidden: true, + readonly: true, + }); }); From 027b01134c9982cdbd079efa0f0c130f3bf87104 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Mon, 18 Sep 2023 17:26:50 -0300 Subject: [PATCH 163/275] chore: remove connectToCloud option (#30430) --- .../functions/checkUserHasCloudLogin.ts | 4 +- .../server/functions/connectWorkspace.ts | 7 -- .../server/functions/disconnectWorkspace.ts | 17 ---- .../functions/getUserCloudAccessToken.ts | 4 +- .../functions/getWorkspaceAccessToken.ts | 4 +- .../getWorkspaceAccessTokenWithScope.ts | 4 +- .../cloud/server/functions/getWorkspaceKey.ts | 4 +- .../functions/retrieveRegistrationStatus.ts | 2 - .../functions/startRegisterWorkspace.ts | 4 +- .../cloud/server/functions/syncWorkspace.ts | 6 +- .../app/cloud/server/functions/userLogout.ts | 4 +- apps/meteor/app/cloud/server/methods.ts | 18 ----- apps/meteor/client/startup/startup.ts | 4 +- .../views/admin/cloud/RegisterWorkspace.tsx | 30 ++----- .../components/RegisterWorkspaceMenu.tsx | 9 +-- .../cloud/modals/DisconnectWorkspaceModal.tsx | 79 ------------------- .../cloud/modals/RegisteredWorkspaceModal.tsx | 11 +-- packages/core-typings/src/ICloud.ts | 1 - 18 files changed, 27 insertions(+), 185 deletions(-) delete mode 100644 apps/meteor/app/cloud/server/functions/disconnectWorkspace.ts delete mode 100644 apps/meteor/client/views/admin/cloud/modals/DisconnectWorkspaceModal.tsx diff --git a/apps/meteor/app/cloud/server/functions/checkUserHasCloudLogin.ts b/apps/meteor/app/cloud/server/functions/checkUserHasCloudLogin.ts index 033f2e3b94da..a17c71d80dc9 100644 --- a/apps/meteor/app/cloud/server/functions/checkUserHasCloudLogin.ts +++ b/apps/meteor/app/cloud/server/functions/checkUserHasCloudLogin.ts @@ -3,9 +3,9 @@ import { Users } from '@rocket.chat/models'; import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; export async function checkUserHasCloudLogin(userId: string) { - const { connectToCloud, workspaceRegistered } = await retrieveRegistrationStatus(); + const { workspaceRegistered } = await retrieveRegistrationStatus(); - if (!connectToCloud || !workspaceRegistered) { + if (!workspaceRegistered) { return false; } diff --git a/apps/meteor/app/cloud/server/functions/connectWorkspace.ts b/apps/meteor/app/cloud/server/functions/connectWorkspace.ts index 3c8a587fa558..8223522e2723 100644 --- a/apps/meteor/app/cloud/server/functions/connectWorkspace.ts +++ b/apps/meteor/app/cloud/server/functions/connectWorkspace.ts @@ -1,18 +1,11 @@ -import { Settings } from '@rocket.chat/models'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; import { SystemLogger } from '../../../../server/lib/logger/system'; import { settings } from '../../../settings/server'; import { getRedirectUri } from './getRedirectUri'; -import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; import { saveRegistrationData } from './saveRegistrationData'; export async function connectWorkspace(token: string) { - const { connectToCloud } = await retrieveRegistrationStatus(); - if (!connectToCloud) { - await Settings.updateValueById('Register_Server', true); - } - // shouldn't get here due to checking this on the method // but this is just to double check if (!token) { diff --git a/apps/meteor/app/cloud/server/functions/disconnectWorkspace.ts b/apps/meteor/app/cloud/server/functions/disconnectWorkspace.ts deleted file mode 100644 index c72a96297f37..000000000000 --- a/apps/meteor/app/cloud/server/functions/disconnectWorkspace.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { Settings } from '@rocket.chat/models'; - -import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; -import { syncWorkspace } from './syncWorkspace'; - -export async function disconnectWorkspace() { - const { connectToCloud } = await retrieveRegistrationStatus(); - if (!connectToCloud) { - return true; - } - - await Settings.updateValueById('Register_Server', false); - - await syncWorkspace(true); - - return true; -} diff --git a/apps/meteor/app/cloud/server/functions/getUserCloudAccessToken.ts b/apps/meteor/app/cloud/server/functions/getUserCloudAccessToken.ts index d7d87417e349..bf39a50b6234 100644 --- a/apps/meteor/app/cloud/server/functions/getUserCloudAccessToken.ts +++ b/apps/meteor/app/cloud/server/functions/getUserCloudAccessToken.ts @@ -11,9 +11,9 @@ import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; import { userLoggedOut } from './userLoggedOut'; export async function getUserCloudAccessToken(userId: string, forceNew = false, scope = '', save = true) { - const { connectToCloud, workspaceRegistered } = await retrieveRegistrationStatus(); + const { workspaceRegistered } = await retrieveRegistrationStatus(); - if (!connectToCloud || !workspaceRegistered) { + if (!workspaceRegistered) { return ''; } diff --git a/apps/meteor/app/cloud/server/functions/getWorkspaceAccessToken.ts b/apps/meteor/app/cloud/server/functions/getWorkspaceAccessToken.ts index 1a69d108ae4c..2b731ef82757 100644 --- a/apps/meteor/app/cloud/server/functions/getWorkspaceAccessToken.ts +++ b/apps/meteor/app/cloud/server/functions/getWorkspaceAccessToken.ts @@ -11,9 +11,9 @@ import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; * @returns string */ export async function getWorkspaceAccessToken(forceNew = false, scope = '', save = true) { - const { connectToCloud, workspaceRegistered } = await retrieveRegistrationStatus(); + const { workspaceRegistered } = await retrieveRegistrationStatus(); - if (!connectToCloud || !workspaceRegistered) { + if (!workspaceRegistered) { return ''; } diff --git a/apps/meteor/app/cloud/server/functions/getWorkspaceAccessTokenWithScope.ts b/apps/meteor/app/cloud/server/functions/getWorkspaceAccessTokenWithScope.ts index 4a0c4b5fe394..351b4cba20e5 100644 --- a/apps/meteor/app/cloud/server/functions/getWorkspaceAccessTokenWithScope.ts +++ b/apps/meteor/app/cloud/server/functions/getWorkspaceAccessTokenWithScope.ts @@ -8,11 +8,11 @@ import { removeWorkspaceRegistrationInfo } from './removeWorkspaceRegistrationIn import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; export async function getWorkspaceAccessTokenWithScope(scope = '') { - const { connectToCloud, workspaceRegistered } = await retrieveRegistrationStatus(); + const { workspaceRegistered } = await retrieveRegistrationStatus(); const tokenResponse = { token: '', expiresAt: new Date() }; - if (!connectToCloud || !workspaceRegistered) { + if (!workspaceRegistered) { return tokenResponse; } diff --git a/apps/meteor/app/cloud/server/functions/getWorkspaceKey.ts b/apps/meteor/app/cloud/server/functions/getWorkspaceKey.ts index f3b6dfc4238a..639f29402fe9 100644 --- a/apps/meteor/app/cloud/server/functions/getWorkspaceKey.ts +++ b/apps/meteor/app/cloud/server/functions/getWorkspaceKey.ts @@ -2,9 +2,9 @@ import { settings } from '../../../settings/server'; import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; export async function getWorkspaceKey() { - const { connectToCloud, workspaceRegistered } = await retrieveRegistrationStatus(); + const { workspaceRegistered } = await retrieveRegistrationStatus(); - if (!connectToCloud || !workspaceRegistered) { + if (!workspaceRegistered) { return false; } diff --git a/apps/meteor/app/cloud/server/functions/retrieveRegistrationStatus.ts b/apps/meteor/app/cloud/server/functions/retrieveRegistrationStatus.ts index 55698f4d27af..0291534ac637 100644 --- a/apps/meteor/app/cloud/server/functions/retrieveRegistrationStatus.ts +++ b/apps/meteor/app/cloud/server/functions/retrieveRegistrationStatus.ts @@ -3,7 +3,6 @@ import { Users } from '@rocket.chat/models'; import { settings } from '../../../settings/server'; export async function retrieveRegistrationStatus(): Promise<{ - connectToCloud: boolean; workspaceRegistered: boolean; workspaceId: string; uniqueId: string; @@ -11,7 +10,6 @@ export async function retrieveRegistrationStatus(): Promise<{ email: string; }> { const info = { - connectToCloud: settings.get('Register_Server'), workspaceRegistered: !!settings.get('Cloud_Workspace_Client_Id') && !!settings.get('Cloud_Workspace_Client_Secret'), workspaceId: settings.get('Cloud_Workspace_Id'), uniqueId: settings.get('uniqueID'), diff --git a/apps/meteor/app/cloud/server/functions/startRegisterWorkspace.ts b/apps/meteor/app/cloud/server/functions/startRegisterWorkspace.ts index de9fafc99065..af74fcd7d211 100644 --- a/apps/meteor/app/cloud/server/functions/startRegisterWorkspace.ts +++ b/apps/meteor/app/cloud/server/functions/startRegisterWorkspace.ts @@ -8,8 +8,8 @@ import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; import { syncWorkspace } from './syncWorkspace'; export async function startRegisterWorkspace(resend = false) { - const { workspaceRegistered, connectToCloud } = await retrieveRegistrationStatus(); - if ((workspaceRegistered && connectToCloud) || process.env.TEST_MODE) { + const { workspaceRegistered } = await retrieveRegistrationStatus(); + if (workspaceRegistered || process.env.TEST_MODE) { await syncWorkspace(true); return true; diff --git a/apps/meteor/app/cloud/server/functions/syncWorkspace.ts b/apps/meteor/app/cloud/server/functions/syncWorkspace.ts index 9337fd0a0172..c8a323e40f95 100644 --- a/apps/meteor/app/cloud/server/functions/syncWorkspace.ts +++ b/apps/meteor/app/cloud/server/functions/syncWorkspace.ts @@ -10,9 +10,9 @@ import { getWorkspaceAccessToken } from './getWorkspaceAccessToken'; import { getWorkspaceLicense } from './getWorkspaceLicense'; import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; -export async function syncWorkspace(reconnectCheck = false) { - const { workspaceRegistered, connectToCloud } = await retrieveRegistrationStatus(); - if (!workspaceRegistered || (!connectToCloud && !reconnectCheck)) { +export async function syncWorkspace(_reconnectCheck = false) { + const { workspaceRegistered } = await retrieveRegistrationStatus(); + if (!workspaceRegistered) { return false; } diff --git a/apps/meteor/app/cloud/server/functions/userLogout.ts b/apps/meteor/app/cloud/server/functions/userLogout.ts index e03f96df679d..7dd4aa094535 100644 --- a/apps/meteor/app/cloud/server/functions/userLogout.ts +++ b/apps/meteor/app/cloud/server/functions/userLogout.ts @@ -7,9 +7,9 @@ import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; import { userLoggedOut } from './userLoggedOut'; export async function userLogout(userId: string): Promise { - const { connectToCloud, workspaceRegistered } = await retrieveRegistrationStatus(); + const { workspaceRegistered } = await retrieveRegistrationStatus(); - if (!connectToCloud || !workspaceRegistered) { + if (!workspaceRegistered) { return ''; } diff --git a/apps/meteor/app/cloud/server/methods.ts b/apps/meteor/app/cloud/server/methods.ts index d2fbac1af881..89e7b99e7146 100644 --- a/apps/meteor/app/cloud/server/methods.ts +++ b/apps/meteor/app/cloud/server/methods.ts @@ -6,7 +6,6 @@ import { hasPermissionAsync } from '../../authorization/server/functions/hasPerm import { buildWorkspaceRegistrationData } from './functions/buildRegistrationData'; import { checkUserHasCloudLogin } from './functions/checkUserHasCloudLogin'; import { connectWorkspace } from './functions/connectWorkspace'; -import { disconnectWorkspace } from './functions/disconnectWorkspace'; import { finishOAuthAuthorization } from './functions/finishOAuthAuthorization'; import { getOAuthAuthorizationUrl } from './functions/getOAuthAuthorizationUrl'; import { reconnectWorkspace } from './functions/reconnectWorkspace'; @@ -19,7 +18,6 @@ declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { 'cloud:checkRegisterStatus': () => { - connectToCloud: boolean; workspaceRegistered: boolean; workspaceId: string; uniqueId: string; @@ -137,22 +135,6 @@ Meteor.methods({ return connectWorkspace(token); }, - async 'cloud:disconnectWorkspace'() { - const uid = Meteor.userId(); - if (!uid) { - throw new Meteor.Error('error-invalid-user', 'Invalid user', { - method: 'cloud:connectServer', - }); - } - - if (!(await hasPermissionAsync(uid, 'manage-cloud'))) { - throw new Meteor.Error('error-not-authorized', 'Not authorized', { - method: 'cloud:connectServer', - }); - } - - return disconnectWorkspace(); - }, async 'cloud:reconnectWorkspace'() { const uid = Meteor.userId(); if (!uid) { diff --git a/apps/meteor/client/startup/startup.ts b/apps/meteor/client/startup/startup.ts index 440b55ce5e6d..6b2b66ec69d7 100644 --- a/apps/meteor/client/startup/startup.ts +++ b/apps/meteor/client/startup/startup.ts @@ -72,11 +72,11 @@ Meteor.startup(() => { } const { - registrationStatus: { connectToCloud, workspaceRegistered }, + registrationStatus: { workspaceRegistered }, } = await sdk.rest.get('/v1/cloud.registrationStatus'); c.stop(); - if (connectToCloud === true && workspaceRegistered !== true) { + if (workspaceRegistered !== true) { banners.open({ id: 'cloud-registration', title: () => t('Cloud_registration_pending_title'), diff --git a/apps/meteor/client/views/admin/cloud/RegisterWorkspace.tsx b/apps/meteor/client/views/admin/cloud/RegisterWorkspace.tsx index 694d437de8d3..e3e1f474cb91 100644 --- a/apps/meteor/client/views/admin/cloud/RegisterWorkspace.tsx +++ b/apps/meteor/client/views/admin/cloud/RegisterWorkspace.tsx @@ -16,7 +16,6 @@ const RegisterWorkspace = () => { const { data: registrationStatusData, isLoading, isError, refetch } = useRegistrationStatus(); const isWorkspaceRegistered = registrationStatusData?.registrationStatus?.workspaceRegistered ?? false; - const isConnectedToCloud = registrationStatusData?.registrationStatus?.connectToCloud ?? false; if (isLoading || isError) { return null; @@ -40,32 +39,11 @@ const RegisterWorkspace = () => { setModal(); }; - const handleRegistrationTag = () => { - if (!isWorkspaceRegistered && !isConnectedToCloud) { - return {t('RegisterWorkspace_NotRegistered_Title')}; - } - if (isWorkspaceRegistered && !isConnectedToCloud) { - return {t('RegisterWorkspace_NotConnected_Title')}; - } - return {t('Workspace_registered')}; - }; - - const handleCardsTitle = () => { - if (!isWorkspaceRegistered && !isConnectedToCloud) { - return t('RegisterWorkspace_NotRegistered_Subtitle'); - } - if (isWorkspaceRegistered && !isConnectedToCloud) { - return t('RegisterWorkspace_NotConnected_Subtitle'); - } - return t('RegisterWorkspace_Registered_Description'); - }; - return ( { - {handleRegistrationTag()} + + {!isWorkspaceRegistered && {t('RegisterWorkspace_NotRegistered_Title')}} + {isWorkspaceRegistered && {t('Workspace_registered')}} + - {handleCardsTitle()} + {isWorkspaceRegistered && t('RegisterWorkspace_NotRegistered_Subtitle')} + {!isWorkspaceRegistered && t('RegisterWorkspace_Registered_Description')} diff --git a/apps/meteor/client/views/admin/cloud/components/RegisterWorkspaceMenu.tsx b/apps/meteor/client/views/admin/cloud/components/RegisterWorkspaceMenu.tsx index d5b0ec7cf771..9163e5e30af5 100644 --- a/apps/meteor/client/views/admin/cloud/components/RegisterWorkspaceMenu.tsx +++ b/apps/meteor/client/views/admin/cloud/components/RegisterWorkspaceMenu.tsx @@ -8,7 +8,6 @@ import RegisteredWorkspaceModal from '../modals/RegisteredWorkspaceModal'; type RegisterWorkspaceMenuProps = { isWorkspaceRegistered: boolean | string; - isConnectedToCloud: boolean | string; onClick: () => void; onClickOfflineRegistration: () => void; onStatusChange?: () => void; @@ -16,7 +15,6 @@ type RegisterWorkspaceMenuProps = { const RegisterWorkspaceMenu = ({ isWorkspaceRegistered, - isConnectedToCloud, onClick, onClickOfflineRegistration, onStatusChange, @@ -33,7 +31,7 @@ const RegisterWorkspaceMenu = ({ return ( - {isWorkspaceRegistered && isConnectedToCloud && ( + {isWorkspaceRegistered && ( <> - )} {!isWorkspaceRegistered && ( <> diff --git a/apps/meteor/client/views/admin/cloud/modals/DisconnectWorkspaceModal.tsx b/apps/meteor/client/views/admin/cloud/modals/DisconnectWorkspaceModal.tsx deleted file mode 100644 index 44846ffe24c5..000000000000 --- a/apps/meteor/client/views/admin/cloud/modals/DisconnectWorkspaceModal.tsx +++ /dev/null @@ -1,79 +0,0 @@ -import { Box, Button, ButtonGroup, Modal } from '@rocket.chat/fuselage'; -import { useMethod, useSetModal, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; -import React from 'react'; - -import useFeatureBullets from '../hooks/useFeatureBullets'; -import RegisteredWorkspaceModal from './RegisteredWorkspaceModal'; - -type DisconnectWorkspaceModalProps = { - onClose: () => void; - onStatusChange?: () => void; -}; - -const DisconnectWorkspaceModal = ({ onClose, onStatusChange, ...props }: DisconnectWorkspaceModalProps) => { - const t = useTranslation(); - const setModal = useSetModal(); - const bulletFeatures = useFeatureBullets(); - const dispatchToastMessage = useToastMessageDispatch(); - - const disconnectWorkspace = useMethod('cloud:disconnectWorkspace'); - - const handleCancelAction = (): void => { - const handleModalClose = (): void => setModal(null); - setModal(); - }; - - const handleUnregister = async () => { - try { - const success = await disconnectWorkspace(); - - if (!success) { - throw Error(t('RegisterWorkspace_Disconnect_Error')); - } - - dispatchToastMessage({ type: 'success', message: t('Disconnected') }); - - setModal(null); - } catch (error) { - dispatchToastMessage({ type: 'error', message: error }); - } finally { - await (onStatusChange && onStatusChange()); - } - }; - - return ( - - - - {t('Are_you_sure')} - - - - - - {`${t('RegisterWorkspace_Disconnect_Subtitle')}: `} -
    - {bulletFeatures.map((item, index) => ( -
  • - {item.title} - - {item.disconnect} - -
  • - ))} -
-
-
- - - - - - -
- ); -}; - -export default DisconnectWorkspaceModal; diff --git a/apps/meteor/client/views/admin/cloud/modals/RegisteredWorkspaceModal.tsx b/apps/meteor/client/views/admin/cloud/modals/RegisteredWorkspaceModal.tsx index 1a77893548f2..050411075c74 100644 --- a/apps/meteor/client/views/admin/cloud/modals/RegisteredWorkspaceModal.tsx +++ b/apps/meteor/client/views/admin/cloud/modals/RegisteredWorkspaceModal.tsx @@ -4,7 +4,6 @@ import { useMethod, useSetModal, useToastMessageDispatch, useTranslation } from import React, { useState } from 'react'; import useFeatureBullets from '../hooks/useFeatureBullets'; -import DisconnectWorkspaceModal from './DisconnectWorkspaceModal'; type RegisteredWorkspaceModalProps = { onClose: () => void; @@ -20,11 +19,6 @@ const RegisteredWorkspaceModal = ({ onClose, onStatusChange, ...props }: Registe const syncWorkspace = useMethod('cloud:syncWorkspace'); - const handleDisconnect = (): void => { - const handleModalClose = (): void => setModal(null); - setModal(); - }; - const handleSyncAction = async () => { setSyncing(true); @@ -40,7 +34,7 @@ const RegisteredWorkspaceModal = ({ onClose, onStatusChange, ...props }: Registe } catch (error) { dispatchToastMessage({ type: 'error', message: error }); } finally { - await (onStatusChange && onStatusChange()); + onStatusChange?.(); setSyncing(false); } }; @@ -70,9 +64,6 @@ const RegisteredWorkspaceModal = ({ onClose, onStatusChange, ...props }: Registe
- diff --git a/packages/core-typings/src/ICloud.ts b/packages/core-typings/src/ICloud.ts index ce6b97ce7d77..6710e7ced9d2 100644 --- a/packages/core-typings/src/ICloud.ts +++ b/packages/core-typings/src/ICloud.ts @@ -1,5 +1,4 @@ export type CloudRegistrationStatus = { - connectToCloud: boolean; email: string; token: string; uniqueId: string; From f883b12d27bd70673854470c8099381e301e4d3e Mon Sep 17 00:00:00 2001 From: Tiago Evangelista Pinto Date: Mon, 18 Sep 2023 23:53:48 -0300 Subject: [PATCH 164/275] regression(Apps): Apps translations overriding core translations (#30438) --- apps/meteor/client/hooks/useAppTranslations.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/client/hooks/useAppTranslations.ts b/apps/meteor/client/hooks/useAppTranslations.ts index ad8ca5966c2b..bf4f83e48d85 100644 --- a/apps/meteor/client/hooks/useAppTranslations.ts +++ b/apps/meteor/client/hooks/useAppTranslations.ts @@ -65,7 +65,7 @@ export const useAppTranslations = () => { // Translations keys must be scoped under app id const scopedTranslations = Object.entries(translations).reduce>((acc, [key, value]) => { acc[Utilities.getI18nKeyForApp(key, appId)] = value; - return translations; + return acc; }, {}); i18n.addResourceBundle(normalizedLanguage, 'core', scopedTranslations); From 415ae0e0330c12349b45fdedab56fbae7382b1ab Mon Sep 17 00:00:00 2001 From: Tiago Evangelista Pinto Date: Tue, 19 Sep 2023 08:15:53 -0300 Subject: [PATCH 165/275] regression: CSS adjustments in `ActionManagerBusyState` (#30388) --- .../components/ActionManagerBusyState.tsx | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/apps/meteor/client/components/ActionManagerBusyState.tsx b/apps/meteor/client/components/ActionManagerBusyState.tsx index dcf82342917c..0374254a7de9 100644 --- a/apps/meteor/client/components/ActionManagerBusyState.tsx +++ b/apps/meteor/client/components/ActionManagerBusyState.tsx @@ -1,3 +1,4 @@ +import { css } from '@rocket.chat/css-in-js'; import { Box } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import React, { useEffect, useState } from 'react'; @@ -23,10 +24,23 @@ const ActionManagerBusyState = () => { if (busy) { return ( - - - {t('Loading')} - + + {t('Loading')} ); } From f9c2637579bc368356860c74524bd95fe633896a Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Tue, 19 Sep 2023 05:16:36 -0600 Subject: [PATCH 166/275] regression: `$group` by `alias + type` instead of full `$source` object on reports page (#30391) --- apps/meteor/ee/server/models/raw/LivechatRooms.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apps/meteor/ee/server/models/raw/LivechatRooms.ts b/apps/meteor/ee/server/models/raw/LivechatRooms.ts index 70824c7d7130..5c3bbb1296e0 100644 --- a/apps/meteor/ee/server/models/raw/LivechatRooms.ts +++ b/apps/meteor/ee/server/models/raw/LivechatRooms.ts @@ -357,7 +357,10 @@ export class LivechatRoomsRawEE extends LivechatRoomsRaw implements ILivechatRoo }, { $group: { - _id: '$source', + _id: { + type: '$source.type', + alias: '$source.alias', + }, value: { $sum: 1 }, }, }, From 87d1098ab62b24112facdf6f5f318e8315751003 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Tue, 19 Sep 2023 08:42:04 -0300 Subject: [PATCH 167/275] regression: custom fields not showing in current chats (#30428) --- .../views/omnichannel/currentChats/CurrentChatsPage.tsx | 4 ++-- .../views/omnichannel/currentChats/CurrentChatsRoute.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.tsx b/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.tsx index 1c3a79f30f9e..d82498ff1e50 100644 --- a/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.tsx +++ b/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsPage.tsx @@ -117,7 +117,7 @@ const currentChatQuery: useQueryType = ( return query; }; -const CurrentChatsRoute = ({ id, onRowClick }: { id?: string; onRowClick: (_id: string) => void }): ReactElement => { +const CurrentChatsPage = ({ id, onRowClick }: { id?: string; onRowClick: (_id: string) => void }): ReactElement => { const { sortBy, sortDirection, setSort } = useSort<'fname' | 'departmentId' | 'servedBy' | 'priorityWeight' | 'ts' | 'lm' | 'open'>( 'ts', 'desc', @@ -347,4 +347,4 @@ const CurrentChatsRoute = ({ id, onRowClick }: { id?: string; onRowClick: (_id: ); }; -export default memo(CurrentChatsRoute); +export default memo(CurrentChatsPage); diff --git a/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsRoute.tsx b/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsRoute.tsx index 7d2694d242c9..842a1ad6227d 100644 --- a/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsRoute.tsx +++ b/apps/meteor/client/views/omnichannel/currentChats/CurrentChatsRoute.tsx @@ -26,7 +26,7 @@ const CurrentChatsRoute = (): ReactElement => { } // TODO: Missing error state - return ; + return ; }; export default memo(CurrentChatsRoute); From f0de47cf8ae364085cc283bc140884c7ba837538 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Tue, 19 Sep 2023 10:47:13 -0300 Subject: [PATCH 168/275] regression: close button not working on contact history (#30432) --- .../client/views/omnichannel/contactHistory/ContactHistory.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/client/views/omnichannel/contactHistory/ContactHistory.tsx b/apps/meteor/client/views/omnichannel/contactHistory/ContactHistory.tsx index 5c40b36417ce..955c1918be05 100644 --- a/apps/meteor/client/views/omnichannel/contactHistory/ContactHistory.tsx +++ b/apps/meteor/client/views/omnichannel/contactHistory/ContactHistory.tsx @@ -11,7 +11,7 @@ const ContactHistory = () => { return ( <> {chatId && chatId !== '' ? ( - + ) : ( )} From 5f165f0b911867b8bdd7fda58af8902c8bc97f44 Mon Sep 17 00:00:00 2001 From: "lingohub[bot]" <69908207+lingohub[bot]@users.noreply.github.com> Date: Tue, 19 Sep 2023 15:15:20 +0000 Subject: [PATCH 169/275] =?UTF-8?q?i18n:=20Language=20update=20from=20Ling?= =?UTF-8?q?oHub=20=F0=9F=A4=96=20on=202023-09-18Z=20(#30426)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com> --- apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json | 2 +- apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json | 2 +- apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json | 2 +- apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json | 4 ++-- apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 1ad2e3702b63..a03d4a3d6af1 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -6045,4 +6045,4 @@ "Filter_by_room": "Filter by room type", "Filter_by_visibility": "Filter by visibility", "Theme_Appearence": "Theme Appearence" -} +} \ No newline at end of file diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json index ccdec04a7bec..34c7ca9fdda4 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/fi.i18n.json @@ -5757,4 +5757,4 @@ "Uninstall_grandfathered_app": "Poistetaanko {{appName}}?", "App_will_lose_grandfathered_status": "**Tämä {{context}}sovellus menettää aikaisemmin käytetössä olleen sovelluksen tilansa.** \n \nYhteisöversion työtiloissa voi olla käytössä enintään {{limit}} {{context}} sovellusta. aikaisemmin Aikaisemmin käytössä olleet sovellukset lasketaan mukaan rajoitukseen, mutta rajoitusta ei sovelleta niihin.", "Theme_Appearence": "Teeman ulkoasu" -} +} \ No newline at end of file diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json index d939e8ad16bb..e54f69c81052 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/hu.i18n.json @@ -5438,4 +5438,4 @@ "Join_your_team": "Csatlakozás csapathoz", "Create_an_account": "Fiók létrehozása", "RegisterWorkspace_Features_Marketplace_Title": "Piactér" -} +} \ No newline at end of file diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json index 1b24ab3c4129..80d17019855c 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/pt-BR.i18n.json @@ -4705,14 +4705,14 @@ "VoIP_Server_Websocket_Port": "Porta do webSocket", "VoIP_Server_Name": "Nome do servidor", "VoIP_Server_Websocket_Path": "URL do webSocket", + "VoIP_Retry_Count": "Número de tentativas", + "VoIP_Retry_Count_Description": "Define quantas vezes o cliente tentará se reconectar ao servidor VoIP caso a conexão seja perdida.", "VoIP_Management_Server": "Servidor de gerenciamento de VoIP", "VoIP_Management_Server_Host": "Host de servidor", "VoIP_Management_Server_Port": "Porta do servidor", "VoIP_Management_Server_Name": "Nome do servidor", "VoIP_Management_Server_Username": "Nome de usuário", "VoIP_Management_Server_Password": "Senha", - "VoIP_Retry_Count": "Número de tentativas", - "VoIP_Retry_Count_Description": "Define quantas vezes o cliente tentará se reconectar ao servidor VoIP caso a conexão seja perdida.", "Voip_call_started": "Chamada iniciada às", "Voip_call_duration": "Chamada com duração de {{duration}}", "Voip_call_declined": "Chamada finalizada pelo agente", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json index 35792cce086a..bea75b85c976 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/sv.i18n.json @@ -5762,4 +5762,4 @@ "Uninstall_grandfathered_app": "Avinstallera {{appName}}?", "App_will_lose_grandfathered_status": "**Denna {{context}}-app kommer att förlora sin status som gammal app.** \n \nArbetsytorna i Community Edition kan ha upp till {{limit}} __kontext__-appar aktiverade. Gamla appar inkluderas i gränsen, men gränsen tillämpas inte på dem.", "Theme_Appearence": "Utseende för tema" -} +} \ No newline at end of file From 6d46728242b5a9684895f76632c4845b1a33f00e Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 19 Sep 2023 12:39:38 -0300 Subject: [PATCH 170/275] ci: Add step to notify external services about a new release after Docker image publish (#30436) --- .github/workflows/ci.yml | 102 +++++++++++++++++++++++++-------------- 1 file changed, 67 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22250705ea58..31c2c42718b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -356,13 +356,16 @@ jobs: echo finished deploy: - name: 🚀 Publish build and update our registry + name: 🚀 Publish build assets runs-on: ubuntu-20.04 if: github.event_name == 'release' || github.ref == 'refs/heads/develop' needs: [build-gh-docker, release-versions] steps: - - uses: actions/checkout@v3 + - uses: Bhacaz/checkout-files@v2 + with: + files: package.json + branch: ${{ github.ref }} - name: Restore build uses: actions/download-artifact@v3 @@ -376,32 +379,17 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_DEFAULT_REGION: 'us-east-1' GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} - REDHAT_REGISTRY_PID: ${{ secrets.REDHAT_REGISTRY_PID }} - REDHAT_REGISTRY_KEY: ${{ secrets.REDHAT_REGISTRY_KEY }} - UPDATE_TOKEN: ${{ secrets.UPDATE_TOKEN }} run: | REPO_VERSION=$(node -p "require('./package.json').version") + if [[ '${{ github.event_name }}' = 'release' ]]; then GIT_TAG="${GITHUB_REF#*tags/}" - GIT_BRANCH="" ARTIFACT_NAME="${REPO_VERSION}" - RC_VERSION=$GIT_TAG - - if [[ '${{ needs.release-versions.outputs.release }}' = 'release-candidate' ]]; then - SNAP_CHANNEL=candidate - RC_RELEASE=candidate - elif [[ '${{ needs.release-versions.outputs.release }}' = 'latest' ]]; then - SNAP_CHANNEL=stable - RC_RELEASE=stable - fi else GIT_TAG="" - GIT_BRANCH="${GITHUB_REF#*heads/}" ARTIFACT_NAME="${REPO_VERSION}.$GITHUB_SHA" - RC_VERSION="${REPO_VERSION}" - SNAP_CHANNEL=edge - RC_RELEASE=develop fi; + ROCKET_DEPLOY_DIR="/tmp/deploy" FILENAME="$ROCKET_DEPLOY_DIR/rocket.chat-$ARTIFACT_NAME.tgz"; @@ -419,22 +407,6 @@ jobs: aws s3 cp $ROCKET_DEPLOY_DIR/ s3://download.rocket.chat/build/ --recursive - curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \ - "{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"4.4\", \"5.0\", \"6.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"$RC_RELEASE\"}" \ - https://releases.rocket.chat/update - - # Makes build fail if the release isn't there - curl --fail https://releases.rocket.chat/$RC_VERSION/info - - if [[ $GIT_TAG ]]; then - curl -X POST \ - https://connect.redhat.com/api/v2/projects/$REDHAT_REGISTRY_PID/build \ - -H "Authorization: Bearer $REDHAT_REGISTRY_KEY" \ - -H 'Cache-Control: no-cache' \ - -H 'Content-Type: application/json' \ - -d '{"tag":"'$GIT_TAG'"}' - fi - build-docker-preview: name: 🚢 Build Docker Image (preview) runs-on: ubuntu-20.04 @@ -665,6 +637,66 @@ jobs: echo "::endgroup::" + notify-services: + name: 🚀 Notify external services + runs-on: ubuntu-20.04 + needs: + - services-docker-image-publish + - docker-image-publish + - release-versions + steps: + - uses: Bhacaz/checkout-files@v2 + with: + files: package.json + branch: ${{ github.ref }} + + - name: Releases service + env: + UPDATE_TOKEN: ${{ secrets.UPDATE_TOKEN }} + run: | + REPO_VERSION=$(node -p "require('./package.json').version") + + if [[ '${{ github.event_name }}' = 'release' ]]; then + GIT_TAG="${GITHUB_REF#*tags/}" + GIT_BRANCH="" + ARTIFACT_NAME="${REPO_VERSION}" + RC_VERSION=$GIT_TAG + + if [[ '${{ needs.release-versions.outputs.release }}' = 'release-candidate' ]]; then + RC_RELEASE=candidate + elif [[ '${{ needs.release-versions.outputs.release }}' = 'latest' ]]; then + RC_RELEASE=stable + fi + else + GIT_TAG="" + GIT_BRANCH="${GITHUB_REF#*heads/}" + ARTIFACT_NAME="${REPO_VERSION}.$GITHUB_SHA" + RC_VERSION="${REPO_VERSION}" + RC_RELEASE=develop + fi; + + curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \ + "{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"4.4\", \"5.0\", \"6.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"$RC_RELEASE\"}" \ + https://releases.rocket.chat/update + + # Makes build fail if the release isn't there + curl --fail https://releases.rocket.chat/$RC_VERSION/info + + - name: RedHat Registry + if: github.event_name == 'release' + env: + REDHAT_REGISTRY_PID: ${{ secrets.REDHAT_REGISTRY_PID }} + REDHAT_REGISTRY_KEY: ${{ secrets.REDHAT_REGISTRY_KEY }} + run: | + GIT_TAG="${GITHUB_REF#*tags/}" + + curl -X POST \ + https://connect.redhat.com/api/v2/projects/$REDHAT_REGISTRY_PID/build \ + -H "Authorization: Bearer $REDHAT_REGISTRY_KEY" \ + -H 'Cache-Control: no-cache' \ + -H 'Content-Type: application/json' \ + -d '{"tag":"'$GIT_TAG'"}' + trigger-dependent-workflows: runs-on: ubuntu-latest if: github.event_name == 'release' From 696bbc4f948ac509e6e91da9254b400df364cfa3 Mon Sep 17 00:00:00 2001 From: Anjy Gupta <92802904+anjy7@users.noreply.github.com> Date: Tue, 19 Sep 2023 21:11:42 +0530 Subject: [PATCH 171/275] fix: Disables `GenericMenu` without any sections or items (#30319) --- .changeset/strange-papayas-yell.md | 5 +++++ .../meteor/client/components/GenericMenu/GenericMenu.tsx | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 .changeset/strange-papayas-yell.md diff --git a/.changeset/strange-papayas-yell.md b/.changeset/strange-papayas-yell.md new file mode 100644 index 000000000000..ca194dd2f9d4 --- /dev/null +++ b/.changeset/strange-papayas-yell.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +fix: Disables GenericMenu without any sections or items diff --git a/apps/meteor/client/components/GenericMenu/GenericMenu.tsx b/apps/meteor/client/components/GenericMenu/GenericMenu.tsx index e02d6dc4e746..f660b4b85f35 100644 --- a/apps/meteor/client/components/GenericMenu/GenericMenu.tsx +++ b/apps/meteor/client/components/GenericMenu/GenericMenu.tsx @@ -1,5 +1,4 @@ -import type { IconButton } from '@rocket.chat/fuselage'; -import { MenuItem, MenuSection, MenuV2 } from '@rocket.chat/fuselage'; +import { IconButton, MenuItem, MenuSection, MenuV2 } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ComponentProps, ReactNode } from 'react'; import React from 'react'; @@ -43,6 +42,12 @@ const GenericMenu = ({ title, icon = 'menu', onAction, ...props }: GenericMenuPr const handleItems = (items: GenericMenuItemProps[]) => hasIcon ? items.map((item) => ({ ...item, gap: !item.icon && !item.status })) : items; + const isMenuEmpty = !(sections && sections.length > 0) && !(items && items.length > 0); + + if (isMenuEmpty) { + return ; + } + return ( <> {sections && ( From 84de5bc135dbd571198f995b54b0f692e3229e1f Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Tue, 19 Sep 2023 19:21:49 -0300 Subject: [PATCH 172/275] chore: Assertion accuracy on registration test (#30440) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- apps/meteor/tests/e2e/page-objects/auth.ts | 8 -------- apps/meteor/tests/e2e/page-objects/utils.ts | 4 ++++ apps/meteor/tests/e2e/register.spec.ts | 14 ++++++++------ 3 files changed, 12 insertions(+), 14 deletions(-) diff --git a/apps/meteor/tests/e2e/page-objects/auth.ts b/apps/meteor/tests/e2e/page-objects/auth.ts index 26537f183113..b03e45ee22b7 100644 --- a/apps/meteor/tests/e2e/page-objects/auth.ts +++ b/apps/meteor/tests/e2e/page-objects/auth.ts @@ -19,10 +19,6 @@ export class Registration { return this.page.locator('role=link[name="Create an account"]'); } - get main(): Locator { - return this.page.locator('role=main'); - } - get backToLogin(): Locator { return this.page.locator('role=link[name="Back to Login"]'); } @@ -63,10 +59,6 @@ export class Registration { return this.page.locator('[name=passwordConfirmation]'); } - // get textErrorPasswordConfirm(): Locator { - // return this.page.locator('[name=confirm-pass]~.input-error'); - // } - get forgotPasswordEmailCallout(): Locator { return this.page.locator('role=status'); } diff --git a/apps/meteor/tests/e2e/page-objects/utils.ts b/apps/meteor/tests/e2e/page-objects/utils.ts index d71eaf55daab..066c5eac153f 100644 --- a/apps/meteor/tests/e2e/page-objects/utils.ts +++ b/apps/meteor/tests/e2e/page-objects/utils.ts @@ -7,6 +7,10 @@ export class Utils { this.page = page; } + get mainContent(): Locator { + return this.page.locator('main.main-content'); + } + get toastBar(): Locator { return this.page.locator('.rcx-toastbar'); } diff --git a/apps/meteor/tests/e2e/register.spec.ts b/apps/meteor/tests/e2e/register.spec.ts index 6d62ace5e7d3..1709b8414e6b 100644 --- a/apps/meteor/tests/e2e/register.spec.ts +++ b/apps/meteor/tests/e2e/register.spec.ts @@ -1,14 +1,16 @@ import { faker } from '@faker-js/faker'; -import { Registration } from './page-objects'; +import { Utils, Registration } from './page-objects'; import { test, expect } from './utils/test'; -test.describe.serial('register', () => { +test.describe.parallel('register', () => { let poRegistration: Registration; + let poUtils: Utils; test.describe('Registration default flow', async () => { test.beforeEach(async ({ page }) => { poRegistration = new Registration(page); + poUtils = new Utils(page); }); test('Successfully Registration flow', async ({ page }) => { await test.step('expect trigger a validation error if no data is provided on register', async () => { @@ -37,7 +39,7 @@ test.describe.serial('register', () => { await test.step('expect successfully register a new user', async () => { await poRegistration.inputPasswordConfirm.fill('any_password'); await poRegistration.btnRegister.click(); - await expect(poRegistration.main).toBeHidden(); + await expect(poUtils.mainContent).toBeVisible(); }); }); @@ -70,7 +72,7 @@ test.describe.serial('register', () => { await poRegistration.inputPassword.fill('any_password'); await poRegistration.btnRegister.click(); - await expect(poRegistration.main).toBeHidden(); + await expect(poUtils.mainContent).toBeVisible(); }); }); }); @@ -137,6 +139,7 @@ test.describe.serial('register', () => { test.describe('Registration for secret password', async () => { test.beforeEach(async ({ api, page }) => { poRegistration = new Registration(page); + poUtils = new Utils(page); const result = await api.post('/settings/Accounts_RegistrationForm', { value: 'Secret URL' }); await api.post('/settings/Accounts_RegistrationForm_SecretURL', { value: 'secret' }); await expect(result.ok()).toBeTruthy(); @@ -173,8 +176,7 @@ test.describe.serial('register', () => { await poRegistration.inputPassword.fill('any_password'); await poRegistration.inputPasswordConfirm.fill('any_password'); await poRegistration.btnRegister.click(); - await page.waitForSelector('role=main'); - await expect(poRegistration.main).toBeVisible(); + await expect(poUtils.mainContent).toBeVisible(); }); }); From a3a2d3ece8ad6137c4072e772dfa7a3a8c55b00c Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 19 Sep 2023 19:32:05 -0300 Subject: [PATCH 173/275] chore: update meteor 2.13.0 (#29989) Co-authored-by: Diego Sampaio --- apps/meteor/.meteor/packages | 4 ++-- apps/meteor/.meteor/release | 2 +- apps/meteor/.meteor/versions | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/meteor/.meteor/packages b/apps/meteor/.meteor/packages index 97836558ab28..ae788af78034 100644 --- a/apps/meteor/.meteor/packages +++ b/apps/meteor/.meteor/packages @@ -25,7 +25,7 @@ accounts-password@2.3.4 accounts-twitter@1.5.0 pauli:accounts-linkedin -google-oauth@1.4.3 +google-oauth@1.4.4 oauth@2.2.0 oauth2@1.3.2 @@ -39,7 +39,7 @@ meteor-base@1.5.1 ddp-common@1.4.0 webapp@1.13.5 -mongo@1.16.6 +mongo@1.16.7 reload@1.3.1 service-configuration@1.3.1 diff --git a/apps/meteor/.meteor/release b/apps/meteor/.meteor/release index e8cfc7ec4c01..6641d0478a10 100644 --- a/apps/meteor/.meteor/release +++ b/apps/meteor/.meteor/release @@ -1 +1 @@ -METEOR@2.12 +METEOR@2.13.3 diff --git a/apps/meteor/.meteor/versions b/apps/meteor/.meteor/versions index da6de9efbde1..66f61e2cd8cc 100644 --- a/apps/meteor/.meteor/versions +++ b/apps/meteor/.meteor/versions @@ -22,7 +22,7 @@ ddp@1.4.1 ddp-client@2.6.1 ddp-common@1.4.0 ddp-rate-limiter@1.2.0 -ddp-server@2.6.1 +ddp-server@2.6.2 diff-sequence@1.1.2 dispatch:run-as-user@1.1.1 dynamic-import@0.7.3 @@ -38,7 +38,7 @@ facts-base@1.0.1 fetch@0.1.3 geojson-utils@1.0.11 github-oauth@1.4.1 -google-oauth@1.4.3 +google-oauth@1.4.4 hot-code-push@1.0.4 http@2.0.0 id-map@1.1.1 @@ -47,7 +47,7 @@ jquery@3.0.0 kadira:flow-router@2.12.1 localstorage@1.2.0 logging@1.3.2 -meteor@1.11.2 +meteor@1.11.3 meteor-base@1.5.1 meteor-developer-oauth@1.3.2 meteorhacks:inject-initial@1.0.5 @@ -56,7 +56,7 @@ minimongo@1.9.3 modern-browsers@0.1.9 modules@0.19.0 modules-runtime@0.13.1 -mongo@1.16.6 +mongo@1.16.7 mongo-decimal@0.1.3 mongo-dev-server@1.1.0 mongo-id@1.0.8 @@ -92,7 +92,7 @@ shell-server@0.5.0 socket-stream-client@0.5.1 standard-minifier-css@1.9.2 tracker@1.3.2 -twitter-oauth@1.3.2 +twitter-oauth@1.3.3 typescript@4.9.4 underscore@1.0.13 url@1.3.2 From 6963cc2d005367843079e3c4bd8e441bab086a8a Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Tue, 19 Sep 2023 22:45:53 +0000 Subject: [PATCH 174/275] Release 6.4.0-rc.3 [no ci] --- .changeset/bump-patch-1695163548038.md | 5 +++ .changeset/pre.json | 4 +++ apps/meteor/.docker/Dockerfile.rhel | 2 +- apps/meteor/CHANGELOG.md | 31 +++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 10 ++++++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 10 ++++++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 10 ++++++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 12 +++++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 11 +++++++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 11 +++++++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 10 ++++++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 9 ++++++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 7 +++++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 7 +++++ ee/packages/ddp-client/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 11 +++++++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 6 ++++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 9 ++++++ ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 8 +++++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 2 ++ packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 11 +++++++ packages/cron/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 8 +++++ packages/fuselage-ui-kit/package.json | 6 ++-- packages/gazzodown/CHANGELOG.md | 8 +++++ packages/gazzodown/package.json | 8 ++--- packages/instance-status/CHANGELOG.md | 6 ++++ packages/instance-status/package.json | 2 +- packages/livechat/CHANGELOG.md | 6 ++++ packages/livechat/package.json | 2 +- packages/model-typings/CHANGELOG.md | 6 ++++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 6 ++++ packages/models/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 6 ++++ packages/rest-typings/package.json | 2 +- packages/ui-client/CHANGELOG.md | 6 ++++ packages/ui-client/package.json | 4 +-- packages/ui-contexts/CHANGELOG.md | 8 +++++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 6 ++++ packages/ui-video-conf/package.json | 4 +-- packages/uikit-playground/CHANGELOG.md | 7 +++++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 6 ++++ packages/web-ui-registration/package.json | 4 +-- 63 files changed, 303 insertions(+), 40 deletions(-) create mode 100644 .changeset/bump-patch-1695163548038.md diff --git a/.changeset/bump-patch-1695163548038.md b/.changeset/bump-patch-1695163548038.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1695163548038.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/.changeset/pre.json b/.changeset/pre.json index e1a8413aec27..4ea1d81135b8 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -58,6 +58,7 @@ "brown-clouds-add", "bump-patch-1694741499930", "bump-patch-1694827499043", + "bump-patch-1695163548038", "chilled-flies-fold", "chilled-phones-give", "cool-students-tan", @@ -87,6 +88,7 @@ "grumpy-candles-rule", "heavy-baboons-laugh", "heavy-cougars-marry", + "heavy-zebras-wonder", "hip-hounds-ring", "hip-mugs-promise", "honest-glasses-roll", @@ -140,7 +142,9 @@ "strong-laws-pump", "swift-birds-build", "swift-walls-protect", + "tall-pumpkins-cross", "tame-pens-occur", + "three-ants-give", "three-birds-tickle", "tidy-bears-camp", "tiny-turkeys-burn", diff --git a/apps/meteor/.docker/Dockerfile.rhel b/apps/meteor/.docker/Dockerfile.rhel index 527ebcc5bd1b..b9e61dc4bf17 100644 --- a/apps/meteor/.docker/Dockerfile.rhel +++ b/apps/meteor/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 6.4.0-rc.2 +ENV RC_VERSION 6.4.0-rc.3 MAINTAINER buildmaster@rocket.chat diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index ccf14c4c250a..e28d400ef719 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,36 @@ # @rocket.chat/meteor +## 6.4.0-rc.3 + +### Patch Changes + +- Bump @rocket.chat/meteor version. +- 614a9b8fc8: Show correct date for last day time +- 61a106fbf2: Increase cron job check delay to 1 min from 5s. + + This reduces MongoDB requests introduced on 6.3. + +- Updated dependencies [d9a150000d] +- Updated dependencies [61a106fbf2] + - @rocket.chat/presence@0.0.13-rc.3 + - @rocket.chat/cron@0.0.9-rc.3 + - @rocket.chat/core-typings@6.4.0-rc.3 + - @rocket.chat/rest-typings@6.4.0-rc.3 + - @rocket.chat/api-client@0.1.7-rc.3 + - @rocket.chat/omnichannel-services@0.0.13-rc.3 + - @rocket.chat/pdf-worker@0.0.13-rc.3 + - @rocket.chat/core-services@0.2.0-rc.3 + - @rocket.chat/gazzodown@2.0.0-rc.3 + - @rocket.chat/model-typings@0.1.0-rc.3 + - @rocket.chat/ui-contexts@2.0.0-rc.3 + - @rocket.chat/fuselage-ui-kit@2.0.0-rc.3 + - @rocket.chat/models@0.0.13-rc.3 + - @rocket.chat/ui-theming@0.1.0-rc.0 + - @rocket.chat/ui-client@2.0.0-rc.3 + - @rocket.chat/ui-video-conf@2.0.0-rc.3 + - @rocket.chat/web-ui-registration@2.0.0-rc.3 + - @rocket.chat/instance-status@0.0.13-rc.3 + ## 6.4.0-rc.2 ### Patch Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index a20950daf15c..b461341f1ac9 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.4.0-rc.2" + "version": "6.4.0-rc.3" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index af8de00fa2e6..b3aa6c834446 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,15 @@ # rocketchat-services +## 1.1.7-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 +- @rocket.chat/rest-typings@6.4.0-rc.3 +- @rocket.chat/core-services@0.2.0-rc.3 +- @rocket.chat/model-typings@0.1.0-rc.3 +- @rocket.chat/models@0.0.13-rc.3 + ## 1.1.7-rc.2 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 78c287bcee68..fe2973c6179b 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.7-rc.2", + "version": "1.1.7-rc.3", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 181a97d81af6..abbcf362145d 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.4.0-rc.2", + "version": "6.4.0-rc.3", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index 42cfee4dacda..78ad5d31cacc 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/account-service +## 0.2.7-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 +- @rocket.chat/rest-typings@6.4.0-rc.3 +- @rocket.chat/core-services@0.2.0-rc.3 +- @rocket.chat/model-typings@0.1.0-rc.3 +- @rocket.chat/models@0.0.13-rc.3 + ## 0.2.7-rc.2 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index b4b5dd413f31..5812e12a807c 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.2.7-rc.2", + "version": "0.2.7-rc.3", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index 616d4029e915..5e97b3b03660 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/authorization-service +## 0.2.7-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 +- @rocket.chat/rest-typings@6.4.0-rc.3 +- @rocket.chat/core-services@0.2.0-rc.3 +- @rocket.chat/model-typings@0.1.0-rc.3 +- @rocket.chat/models@0.0.13-rc.3 + ## 0.2.7-rc.2 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index 8bc3e5bf6695..d71bcbd5a40b 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.2.7-rc.2", + "version": "0.2.7-rc.3", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index 3b5dc23898ba..9339b098e07b 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/ddp-streamer +## 0.1.7-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 +- @rocket.chat/rest-typings@6.4.0-rc.3 +- @rocket.chat/core-services@0.2.0-rc.3 +- @rocket.chat/model-typings@0.1.0-rc.3 +- @rocket.chat/ui-contexts@2.0.0-rc.3 +- @rocket.chat/models@0.0.13-rc.3 +- @rocket.chat/instance-status@0.0.13-rc.3 + ## 0.1.7-rc.2 ### Patch Changes diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 38eced4bdc20..10b7001a1e71 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.1.7-rc.2", + "version": "0.1.7-rc.3", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index 538df8eab4db..65009b1dbc11 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-transcript +## 0.2.7-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 +- @rocket.chat/omnichannel-services@0.0.13-rc.3 +- @rocket.chat/pdf-worker@0.0.13-rc.3 +- @rocket.chat/core-services@0.2.0-rc.3 +- @rocket.chat/model-typings@0.1.0-rc.3 +- @rocket.chat/models@0.0.13-rc.3 + ## 0.2.7-rc.2 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index 943060057c5c..14beef98c5e9 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.2.7-rc.2", + "version": "0.2.7-rc.3", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index 9e3b10ff21b6..2ae82adaff0f 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/presence-service +## 0.2.7-rc.3 + +### Patch Changes + +- Updated dependencies [d9a150000d] + - @rocket.chat/presence@0.0.13-rc.3 + - @rocket.chat/core-typings@6.4.0-rc.3 + - @rocket.chat/core-services@0.2.0-rc.3 + - @rocket.chat/model-typings@0.1.0-rc.3 + - @rocket.chat/models@0.0.13-rc.3 + ## 0.2.7-rc.2 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index e3f53286e218..7fa3d1eddecf 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.2.7-rc.2", + "version": "0.2.7-rc.3", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index ce179e21061f..f751d90b5376 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/queue-worker +## 0.2.7-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 +- @rocket.chat/omnichannel-services@0.0.13-rc.3 +- @rocket.chat/core-services@0.2.0-rc.3 +- @rocket.chat/model-typings@0.1.0-rc.3 +- @rocket.chat/models@0.0.13-rc.3 + ## 0.2.7-rc.2 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index 41ffca1a66da..341d71b6f1f2 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.2.7-rc.2", + "version": "0.2.7-rc.3", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index 29b31439f4dc..434367fe34a7 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/stream-hub-service +## 0.2.7-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 +- @rocket.chat/core-services@0.2.0-rc.3 +- @rocket.chat/model-typings@0.1.0-rc.3 +- @rocket.chat/models@0.0.13-rc.3 + ## 0.2.7-rc.2 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index 176a46e38f7b..6d72134113df 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.2.7-rc.2", + "version": "0.2.7-rc.3", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index c48d4d366376..cd81c11eea6b 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/api-client +## 0.1.7-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 +- @rocket.chat/rest-typings@6.4.0-rc.3 + ## 0.1.7-rc.2 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index 92c1b021a3a6..6e06c2c65406 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/api-client", - "version": "0.1.7-rc.2", + "version": "0.1.7-rc.3", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index 36c493a9ca94..38c6b150f7c0 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/ddp-client +## 0.2.0-rc.3 + +### Patch Changes + +- @rocket.chat/rest-typings@6.4.0-rc.3 +- @rocket.chat/api-client@0.1.7-rc.3 + ## 0.2.0-rc.2 ### Patch Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index 746297f44048..1363de499046 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ddp-client", - "version": "0.2.0-rc.2", + "version": "0.2.0-rc.3", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index a9eeca91e09c..decf9acee117 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-services +## 0.0.13-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 +- @rocket.chat/rest-typings@6.4.0-rc.3 +- @rocket.chat/pdf-worker@0.0.13-rc.3 +- @rocket.chat/core-services@0.2.0-rc.3 +- @rocket.chat/model-typings@0.1.0-rc.3 +- @rocket.chat/models@0.0.13-rc.3 + ## 0.0.13-rc.2 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index e0f07f0d36a2..73af5ce52eeb 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.0.13-rc.2", + "version": "0.0.13-rc.3", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index 126d9f1a5341..ead48b4f8358 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/pdf-worker +## 0.0.13-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 + ## 0.0.13-rc.2 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index e2137e8b8adf..4f2611930e96 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.13-rc.2", + "version": "0.0.13-rc.3", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index 67c58bc03c3d..c90f2b0a73ac 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/presence +## 0.0.13-rc.3 + +### Patch Changes + +- d9a150000d: Fixed presence broadcast being disabled on server restart + - @rocket.chat/core-typings@6.4.0-rc.3 + - @rocket.chat/core-services@0.2.0-rc.3 + - @rocket.chat/models@0.0.13-rc.3 + ## 0.0.13-rc.2 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 5dadcc93e184..bcd9870e6627 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.0.13-rc.2", + "version": "0.0.13-rc.3", "private": true, "devDependencies": { "@babel/core": "~7.22.9", diff --git a/package.json b/package.json index f1868518c353..ec08f732a848 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.4.0-rc.2", + "version": "6.4.0-rc.3", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index b9633f0946a2..9fb19ea9feed 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/core-services +## 0.2.0-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 +- @rocket.chat/rest-typings@6.4.0-rc.3 +- @rocket.chat/models@0.0.13-rc.3 + ## 0.2.0-rc.2 ### Patch Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 496d7b8ef9d0..eb77ba81257e 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.2.0-rc.2", + "version": "0.2.0-rc.3", "private": true, "devDependencies": { "@babel/core": "~7.22.9", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index 312b39aa21a7..8d9afb47c310 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,7 @@ # @rocket.chat/core-typings +## 6.4.0-rc.3 + ## 6.4.0-rc.2 ## 6.4.0-rc.1 diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 70cf554f3783..180e254b9446 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-typings", - "version": "6.4.0-rc.2", + "version": "6.4.0-rc.3", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index 772a49bf8b71..a466fba733c0 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/cron +## 0.0.9-rc.3 + +### Patch Changes + +- 61a106fbf2: Increase cron job check delay to 1 min from 5s. + + This reduces MongoDB requests introduced on 6.3. + + - @rocket.chat/core-typings@6.4.0-rc.3 + - @rocket.chat/models@0.0.13-rc.3 + ## 0.0.9-rc.2 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index ba8d90e3a9ee..4351b373e26e 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.9-rc.2", + "version": "0.0.9-rc.3", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index 90aa7405e2e7..1192f5f4c89e 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 2.0.0-rc.3 + +### Patch Changes + +- @rocket.chat/gazzodown@2.0.0-rc.3 +- @rocket.chat/ui-contexts@2.0.0-rc.3 +- @rocket.chat/ui-video-conf@2.0.0-rc.3 + ## 2.0.0-rc.2 ### Patch Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index b6e4112d9be6..dca7a165e81c 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "2.0.0-rc.2", + "version": "2.0.0-rc.3", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -46,9 +46,9 @@ "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.2", + "@rocket.chat/ui-contexts": "2.0.0-rc.3", "@rocket.chat/ui-kit": "*", - "@rocket.chat/ui-video-conf": "2.0.0-rc.2", + "@rocket.chat/ui-video-conf": "2.0.0-rc.3", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index 6e9f2877d0f1..266b78e8c29c 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/gazzodown +## 2.0.0-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 +- @rocket.chat/ui-contexts@2.0.0-rc.3 +- @rocket.chat/ui-client@2.0.0-rc.3 + ## 2.0.0-rc.2 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index 4b7c54ccb109..72ca9c06bac1 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "2.0.0-rc.2", + "version": "2.0.0-rc.3", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.4.0-rc.2", + "@rocket.chat/core-typings": "6.4.0-rc.3", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "2.0.0-rc.2", - "@rocket.chat/ui-contexts": "2.0.0-rc.2", + "@rocket.chat/ui-client": "2.0.0-rc.3", + "@rocket.chat/ui-contexts": "2.0.0-rc.3", "katex": "*", "react": "*" }, diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index 48033e6f92f8..d38c79fc3a92 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/instance-status +## 0.0.13-rc.3 + +### Patch Changes + +- @rocket.chat/models@0.0.13-rc.3 + ## 0.0.13-rc.2 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 9a71c6203e5c..8c34d1d29c66 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.13-rc.2", + "version": "0.0.13-rc.3", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/livechat/CHANGELOG.md b/packages/livechat/CHANGELOG.md index e17e7c9a62f2..d42b41310790 100644 --- a/packages/livechat/CHANGELOG.md +++ b/packages/livechat/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/livechat Change Log +## 1.14.0-rc.3 + +### Patch Changes + +- @rocket.chat/gazzodown@2.0.0-rc.3 + ## 1.14.0-rc.2 ### Patch Changes diff --git a/packages/livechat/package.json b/packages/livechat/package.json index 132297d59a48..0a39abf42de6 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/livechat", - "version": "1.14.0-rc.2", + "version": "1.14.0-rc.3", "files": [ "/build" ], diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index 71eb6c6aad76..17c14f810cf5 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/model-typings +## 0.1.0-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 + ## 0.1.0-rc.2 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index 085eb12383b8..4181ba356de1 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.1.0-rc.2", + "version": "0.1.0-rc.3", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index 36e47f1babf6..f962e8ef5775 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/models +## 0.0.13-rc.3 + +### Patch Changes + +- @rocket.chat/model-typings@0.1.0-rc.3 + ## 0.0.13-rc.2 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index 92c3abe80365..eac4b5fe9551 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.13-rc.2", + "version": "0.0.13-rc.3", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index bf4031c7a231..a5f230255479 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/rest-typings +## 6.4.0-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 + ## 6.4.0-rc.2 ### Patch Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 468533a42928..a018ccbf2923 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/rest-typings", - "version": "6.4.0-rc.2", + "version": "6.4.0-rc.3", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.3", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index db0b15948348..2a7e83617bec 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-client +## 2.0.0-rc.3 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.3 + ## 2.0.0-rc.2 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 4334fd3df806..cb443b0b5cef 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "2.0.0-rc.2", + "version": "2.0.0-rc.3", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -61,7 +61,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.2", + "@rocket.chat/ui-contexts": "2.0.0-rc.3", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index 39e21c8d9b37..e22ef6522685 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/ui-contexts +## 2.0.0-rc.3 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.3 +- @rocket.chat/rest-typings@6.4.0-rc.3 +- @rocket.chat/ddp-client@0.2.0-rc.3 + ## 2.0.0-rc.2 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index e06fc1d1b201..3c566266458c 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "2.0.0-rc.2", + "version": "2.0.0-rc.3", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index b715e3c0528a..e5a6aa6b904a 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-video-conf +## 2.0.0-rc.3 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.3 + ## 2.0.0-rc.2 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index 9a3a30698cb4..ddd02a76f27d 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "2.0.0-rc.2", + "version": "2.0.0-rc.3", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.2", + "@rocket.chat/ui-contexts": "2.0.0-rc.3", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index 305ecfff36cd..10340716df2d 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/uikit-playground +## 0.2.0-rc.3 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.3 +- @rocket.chat/fuselage-ui-kit@2.0.0-rc.3 + ## 0.2.0-rc.2 ### Patch Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index 0a61046a1cbb..5dde4147d2d6 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.2.0-rc.2", + "version": "0.2.0-rc.3", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index 6ae99770d2ad..9185ed899fdf 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/web-ui-registration +## 2.0.0-rc.3 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.3 + ## 2.0.0-rc.2 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index 68b7aef1d211..6341f6263e15 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "2.0.0-rc.2", + "version": "2.0.0-rc.3", "private": true, "homepage": "https://rocket.chat", "main": "./dist/index.js", @@ -49,7 +49,7 @@ }, "peerDependencies": { "@rocket.chat/layout": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.2", + "@rocket.chat/ui-contexts": "2.0.0-rc.3", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", From 7cc15ac814fbe8379bfa57b7f044490da5f3430d Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Tue, 19 Sep 2023 23:19:41 +0000 Subject: [PATCH 175/275] Release 6.4.0-rc.4 [no ci] --- .changeset/bump-patch-1695165575069.md | 5 ++++ .changeset/pre.json | 1 + apps/meteor/.docker/Dockerfile.rhel | 2 +- apps/meteor/CHANGELOG.md | 25 +++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 11 ++++++++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 11 ++++++++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 11 ++++++++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 13 ++++++++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 12 +++++++++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 11 ++++++++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 11 ++++++++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 10 ++++++++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 8 ++++++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 8 ++++++ ee/packages/ddp-client/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 12 +++++++++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 7 ++++++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 9 +++++++ ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 9 +++++++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 3 +++ packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 8 ++++++ packages/cron/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 9 +++++++ packages/fuselage-ui-kit/package.json | 6 ++--- packages/gazzodown/CHANGELOG.md | 9 +++++++ packages/gazzodown/package.json | 8 +++--- packages/instance-status/CHANGELOG.md | 7 ++++++ packages/instance-status/package.json | 2 +- packages/livechat/CHANGELOG.md | 6 +++++ packages/livechat/package.json | 2 +- packages/model-typings/CHANGELOG.md | 7 ++++++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 7 ++++++ packages/models/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 7 ++++++ packages/rest-typings/package.json | 2 +- packages/ui-client/CHANGELOG.md | 7 ++++++ packages/ui-client/package.json | 4 +-- packages/ui-contexts/CHANGELOG.md | 9 +++++++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 7 ++++++ packages/ui-video-conf/package.json | 4 +-- packages/uikit-playground/CHANGELOG.md | 8 ++++++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 7 ++++++ packages/web-ui-registration/package.json | 4 +-- 63 files changed, 315 insertions(+), 40 deletions(-) create mode 100644 .changeset/bump-patch-1695165575069.md diff --git a/.changeset/bump-patch-1695165575069.md b/.changeset/bump-patch-1695165575069.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1695165575069.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/.changeset/pre.json b/.changeset/pre.json index 4ea1d81135b8..3bc535a4b50f 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -59,6 +59,7 @@ "bump-patch-1694741499930", "bump-patch-1694827499043", "bump-patch-1695163548038", + "bump-patch-1695165575069", "chilled-flies-fold", "chilled-phones-give", "cool-students-tan", diff --git a/apps/meteor/.docker/Dockerfile.rhel b/apps/meteor/.docker/Dockerfile.rhel index b9e61dc4bf17..3aae5c53f720 100644 --- a/apps/meteor/.docker/Dockerfile.rhel +++ b/apps/meteor/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 6.4.0-rc.3 +ENV RC_VERSION 6.4.0-rc.4 MAINTAINER buildmaster@rocket.chat diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index 8a77fb18b4d6..18e6e45e8f48 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,29 @@ # @rocket.chat/meteor +## 6.4.0-rc.4 + +### Patch Changes + +- Bump @rocket.chat/meteor version. + - @rocket.chat/core-typings@6.4.0-rc.4 + - @rocket.chat/rest-typings@6.4.0-rc.4 + - @rocket.chat/api-client@0.1.8-rc.4 + - @rocket.chat/omnichannel-services@0.0.14-rc.4 + - @rocket.chat/pdf-worker@0.0.14-rc.4 + - @rocket.chat/presence@0.0.14-rc.4 + - @rocket.chat/core-services@0.2.0-rc.4 + - @rocket.chat/cron@0.0.10-rc.4 + - @rocket.chat/gazzodown@2.0.0-rc.4 + - @rocket.chat/model-typings@0.1.0-rc.4 + - @rocket.chat/ui-contexts@2.0.0-rc.4 + - @rocket.chat/fuselage-ui-kit@2.0.0-rc.4 + - @rocket.chat/models@0.0.14-rc.4 + - @rocket.chat/ui-theming@0.1.0-rc.0 + - @rocket.chat/ui-client@2.0.0-rc.4 + - @rocket.chat/ui-video-conf@2.0.0-rc.4 + - @rocket.chat/web-ui-registration@2.0.0-rc.4 + - @rocket.chat/instance-status@0.0.14-rc.4 + ## 6.4.0-rc.3 ### Patch Changes @@ -241,6 +265,7 @@ - @rocket.chat/random@1.2.1 - @rocket.chat/sha256@1.0.9 - @rocket.chat/ui-composer@0.0.1 + ## 6.3.7 ### Patch Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index b461341f1ac9..e0d33295af2c 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.4.0-rc.3" + "version": "6.4.0-rc.4" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index 4832104d3d3e..cb58d45affa3 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,15 @@ # rocketchat-services +## 1.1.8-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/rest-typings@6.4.0-rc.4 +- @rocket.chat/core-services@0.2.0-rc.4 +- @rocket.chat/model-typings@0.1.0-rc.4 +- @rocket.chat/models@0.0.14-rc.4 + ## 1.1.8-rc.3 ### Patch Changes @@ -57,6 +67,7 @@ - @rocket.chat/model-typings@0.1.0-rc.0 - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 1.1.7 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 7f6c55966498..80914c025913 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.8-rc.3", + "version": "1.1.8-rc.4", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index abbcf362145d..0b9e59ae3db0 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.4.0-rc.3", + "version": "6.4.0-rc.4", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index 3ce1c9bb933c..2b8f68d82542 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/account-service +## 0.2.8-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/rest-typings@6.4.0-rc.4 +- @rocket.chat/core-services@0.2.0-rc.4 +- @rocket.chat/model-typings@0.1.0-rc.4 +- @rocket.chat/models@0.0.14-rc.4 + ## 0.2.8-rc.3 ### Patch Changes @@ -57,6 +67,7 @@ - @rocket.chat/model-typings@0.1.0-rc.0 - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.2.7 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index 86d2a3b6bd37..ace7c0a7b8e5 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.2.8-rc.3", + "version": "0.2.8-rc.4", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index e060078bdfb1..c88f11bdaca0 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/authorization-service +## 0.2.8-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/rest-typings@6.4.0-rc.4 +- @rocket.chat/core-services@0.2.0-rc.4 +- @rocket.chat/model-typings@0.1.0-rc.4 +- @rocket.chat/models@0.0.14-rc.4 + ## 0.2.8-rc.3 ### Patch Changes @@ -57,6 +67,7 @@ - @rocket.chat/model-typings@0.1.0-rc.0 - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.2.7 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index 9ec7864a25ee..421591bc2d2e 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.2.8-rc.3", + "version": "0.2.8-rc.4", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index f1e751f963bd..1054c42ff2de 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/ddp-streamer +## 0.1.8-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/rest-typings@6.4.0-rc.4 +- @rocket.chat/core-services@0.2.0-rc.4 +- @rocket.chat/model-typings@0.1.0-rc.4 +- @rocket.chat/ui-contexts@2.0.0-rc.4 +- @rocket.chat/models@0.0.14-rc.4 +- @rocket.chat/instance-status@0.0.14-rc.4 + ## 0.1.8-rc.3 ### Patch Changes @@ -67,6 +79,7 @@ - @rocket.chat/ui-contexts@2.0.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 - @rocket.chat/instance-status@0.0.11-rc.0 + ## 0.1.7 ### Patch Changes diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index f53a0c59a550..71beb619979d 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.1.8-rc.3", + "version": "0.1.8-rc.4", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index ffd0f91a208f..eea1e8489b1b 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,6 +1,18 @@ # @rocket.chat/omnichannel-transcript +## 0.2.8-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/omnichannel-services@0.0.14-rc.4 +- @rocket.chat/pdf-worker@0.0.14-rc.4 +- @rocket.chat/core-services@0.2.0-rc.4 +- @rocket.chat/model-typings@0.1.0-rc.4 +- @rocket.chat/models@0.0.14-rc.4 + ## 0.2.8-rc.3 + ## 0.2.7 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index 41bf11cfcf0b..acb555a210ba 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.2.8-rc.3", + "version": "0.2.8-rc.4", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index f37b3082a1a8..7c2478a73718 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/presence-service +## 0.2.8-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/presence@0.0.14-rc.4 +- @rocket.chat/core-services@0.2.0-rc.4 +- @rocket.chat/model-typings@0.1.0-rc.4 +- @rocket.chat/models@0.0.14-rc.4 + ## 0.2.8-rc.3 ### Patch Changes @@ -54,6 +64,7 @@ - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/presence@0.0.11-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.2.7 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index 01ecd999e5c4..f59012a68ccb 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.2.8-rc.3", + "version": "0.2.8-rc.4", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index 22d32a3c2b55..adb2e6c38e2e 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/queue-worker +## 0.2.8-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/omnichannel-services@0.0.14-rc.4 +- @rocket.chat/core-services@0.2.0-rc.4 +- @rocket.chat/model-typings@0.1.0-rc.4 +- @rocket.chat/models@0.0.14-rc.4 + ## 0.2.8-rc.3 ### Patch Changes @@ -53,6 +63,7 @@ - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/omnichannel-services@0.0.11-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.2.7 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index bbdc514b98ba..d141aa707728 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.2.8-rc.3", + "version": "0.2.8-rc.4", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index 3dcc685b85cf..eb569a157edc 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/stream-hub-service +## 0.2.8-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/core-services@0.2.0-rc.4 +- @rocket.chat/model-typings@0.1.0-rc.4 +- @rocket.chat/models@0.0.14-rc.4 + ## 0.2.8-rc.3 ### Patch Changes @@ -49,6 +58,7 @@ - @rocket.chat/model-typings@0.1.0-rc.0 - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.2.7 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index 23df60725686..55ec8587c101 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.2.8-rc.3", + "version": "0.2.8-rc.4", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index 429d00869d97..8369eeee332f 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/api-client +## 0.1.8-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/rest-typings@6.4.0-rc.4 + ## 0.1.8-rc.3 ### Patch Changes @@ -39,6 +46,7 @@ - Updated dependencies [93d4912e17] - @rocket.chat/core-typings@6.4.0-rc.0 - @rocket.chat/rest-typings@6.4.0-rc.0 + ## 0.1.7 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index e564bf5e71c0..1fe0aaf539d0 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/api-client", - "version": "0.1.8-rc.3", + "version": "0.1.8-rc.4", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index 75f732bff8d7..dd1327fb6042 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/ddp-client +## 0.2.0-rc.4 + +### Patch Changes + +- @rocket.chat/rest-typings@6.4.0-rc.4 +- @rocket.chat/api-client@0.1.8-rc.4 + ## 0.2.0-rc.3 ### Patch Changes @@ -40,6 +47,7 @@ - Updated dependencies [93d4912e17] - @rocket.chat/rest-typings@6.4.0-rc.0 - @rocket.chat/api-client@0.1.5-rc.0 + ## 0.1.7 ### Patch Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index 1363de499046..0c64d9117894 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ddp-client", - "version": "0.2.0-rc.3", + "version": "0.2.0-rc.4", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index 1dbcdb1528f4..5d4f0468c000 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-services +## 0.0.14-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/rest-typings@6.4.0-rc.4 +- @rocket.chat/pdf-worker@0.0.14-rc.4 +- @rocket.chat/core-services@0.2.0-rc.4 +- @rocket.chat/model-typings@0.1.0-rc.4 +- @rocket.chat/models@0.0.14-rc.4 + ## 0.0.14-rc.3 ### Patch Changes @@ -61,6 +72,7 @@ - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/pdf-worker@0.0.11-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.0.13 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index e2de3ed8e637..18bb13ba3f17 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.0.14-rc.3", + "version": "0.0.14-rc.4", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index 631ab3d7df7d..13dc1a43e0f5 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/pdf-worker +## 0.0.14-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 + ## 0.0.14-rc.3 ### Patch Changes @@ -30,6 +36,7 @@ - Updated dependencies [61128364d6] - Updated dependencies [d45365436e] - @rocket.chat/core-typings@6.4.0-rc.0 + ## 0.0.13 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index 07d8e8344226..daa5105e3fdc 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.14-rc.3", + "version": "0.0.14-rc.4", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index 408a19635816..befd96b837ee 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/presence +## 0.0.14-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/core-services@0.2.0-rc.4 +- @rocket.chat/models@0.0.14-rc.4 + ## 0.0.14-rc.3 ### Patch Changes @@ -41,6 +49,7 @@ - @rocket.chat/core-typings@6.4.0-rc.0 - @rocket.chat/core-services@0.2.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.0.13 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index db3d3abc0a59..9ade368e5cc4 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.0.14-rc.3", + "version": "0.0.14-rc.4", "private": true, "devDependencies": { "@babel/core": "~7.22.9", diff --git a/package.json b/package.json index ec08f732a848..838aac9c3697 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.4.0-rc.3", + "version": "6.4.0-rc.4", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index e69f2058070e..0f067001c3be 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/core-services +## 0.2.0-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/rest-typings@6.4.0-rc.4 +- @rocket.chat/models@0.0.14-rc.4 + ## 0.2.0-rc.3 ### Patch Changes @@ -48,6 +56,7 @@ - @rocket.chat/core-typings@6.4.0-rc.0 - @rocket.chat/rest-typings@6.4.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 + ## 0.1.7 ### Patch Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index eb77ba81257e..1003bb9dd191 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.2.0-rc.3", + "version": "0.2.0-rc.4", "private": true, "devDependencies": { "@babel/core": "~7.22.9", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index 75fee057575e..be66b7a23ccb 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,7 @@ # @rocket.chat/core-typings +## 6.4.0-rc.4 + ## 6.4.0-rc.3 ## 6.4.0-rc.2 @@ -20,6 +22,7 @@ - ba24f3c21f: Fixed `default` field not being returned from the `setDefault` endpoints when setting to false - 61128364d6: Fixes a problem where the calculated time for considering the visitor abandonment was the first message from the visitor and not the visitor's reply to the agent. - d45365436e: Use group filter when set to LDAP sync process + ## 6.3.7 ## 6.3.6 diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 180e254b9446..2aec7e6405de 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-typings", - "version": "6.4.0-rc.3", + "version": "6.4.0-rc.4", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index b98547c6759e..32872b06ffbe 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/cron +## 0.0.10-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/models@0.0.14-rc.4 + ## 0.0.11-rc.3 ### Patch Changes @@ -39,6 +46,7 @@ - @rocket.chat/core-typings@6.4.0-rc.0 - @rocket.chat/models@0.0.11-rc.0 - @rocket.chat/random@1.2.1 + ## 0.0.10 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index 9aa3d9be1746..de4329b80473 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.10-rc.3", + "version": "0.0.10-rc.4", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index 5b0be30e85fe..bffaa90dcb07 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 2.0.0-rc.4 + +### Patch Changes + +- @rocket.chat/gazzodown@2.0.0-rc.4 +- @rocket.chat/ui-contexts@2.0.0-rc.4 +- @rocket.chat/ui-video-conf@2.0.0-rc.4 + ## 2.0.0-rc.3 ### Patch Changes @@ -42,6 +50,7 @@ - @rocket.chat/eslint-config@0.6.0-rc.0 - @rocket.chat/gazzodown@2.0.0-rc.0 - @rocket.chat/ui-video-conf@2.0.0-rc.0 + ## 1.0.7 ### Patch Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index dca7a165e81c..e199b888401a 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "2.0.0-rc.3", + "version": "2.0.0-rc.4", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -46,9 +46,9 @@ "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.3", + "@rocket.chat/ui-contexts": "2.0.0-rc.4", "@rocket.chat/ui-kit": "*", - "@rocket.chat/ui-video-conf": "2.0.0-rc.3", + "@rocket.chat/ui-video-conf": "2.0.0-rc.4", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index b252757db0bc..d0178b78e124 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/gazzodown +## 2.0.0-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/ui-contexts@2.0.0-rc.4 +- @rocket.chat/ui-client@2.0.0-rc.4 + ## 2.0.0-rc.3 ### Patch Changes @@ -41,6 +49,7 @@ - @rocket.chat/core-typings@6.4.0-rc.0 - @rocket.chat/ui-client@2.0.0-rc.0 - @rocket.chat/ui-contexts@2.0.0-rc.0 + ## 1.0.7 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index 72ca9c06bac1..c500807716f5 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "2.0.0-rc.3", + "version": "2.0.0-rc.4", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.4.0-rc.3", + "@rocket.chat/core-typings": "6.4.0-rc.4", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "2.0.0-rc.3", - "@rocket.chat/ui-contexts": "2.0.0-rc.3", + "@rocket.chat/ui-client": "2.0.0-rc.4", + "@rocket.chat/ui-contexts": "2.0.0-rc.4", "katex": "*", "react": "*" }, diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index c8320d37dad8..3571dc6806ce 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/instance-status +## 0.0.14-rc.4 + +### Patch Changes + +- @rocket.chat/models@0.0.14-rc.4 + ## 0.0.14-rc.3 ### Patch Changes @@ -23,6 +29,7 @@ ### Patch Changes - @rocket.chat/models@0.0.14-rc.0 + ## 0.0.13 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index b02969406c68..02434d021953 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.14-rc.3", + "version": "0.0.14-rc.4", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/livechat/CHANGELOG.md b/packages/livechat/CHANGELOG.md index d42b41310790..922a2d7f442b 100644 --- a/packages/livechat/CHANGELOG.md +++ b/packages/livechat/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/livechat Change Log +## 1.14.0-rc.4 + +### Patch Changes + +- @rocket.chat/gazzodown@2.0.0-rc.4 + ## 1.14.0-rc.3 ### Patch Changes diff --git a/packages/livechat/package.json b/packages/livechat/package.json index 0a39abf42de6..e46439181586 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/livechat", - "version": "1.14.0-rc.3", + "version": "1.14.0-rc.4", "files": [ "/build" ], diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index 2ce0c1f281e3..f80a0d805977 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/model-typings +## 0.1.0-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 + ## 0.1.0-rc.3 ### Patch Changes @@ -43,6 +49,7 @@ - Updated dependencies [61128364d6] - Updated dependencies [d45365436e] - @rocket.chat/core-typings@6.4.0-rc.0 + ## 0.0.13 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index 4181ba356de1..d84dcd3b3742 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.1.0-rc.3", + "version": "0.1.0-rc.4", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index d0d733f6e3d8..31d2440aaa7f 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/models +## 0.0.14-rc.4 + +### Patch Changes + +- @rocket.chat/model-typings@0.1.0-rc.4 + ## 0.0.14-rc.3 ### Patch Changes @@ -30,6 +36,7 @@ - Updated dependencies [ead7c7bef2] - Updated dependencies [61128364d6] - @rocket.chat/model-typings@0.1.0-rc.0 + ## 0.0.13 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index 4bbc4004580b..4dbaa73f037b 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.14-rc.3", + "version": "0.0.14-rc.4", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index 50feae4af2e7..506ed5c3580f 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/rest-typings +## 6.4.0-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 + ## 6.4.0-rc.3 ### Patch Changes @@ -42,6 +48,7 @@ - Updated dependencies [61128364d6] - Updated dependencies [d45365436e] - @rocket.chat/core-typings@6.4.0-rc.0 + ## 6.3.7 ### Patch Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index a018ccbf2923..a773001954ed 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/rest-typings", - "version": "6.4.0-rc.3", + "version": "6.4.0-rc.4", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.3", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index f382ea17e901..5a987f493cf1 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-client +## 2.0.0-rc.4 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.4 + ## 2.0.0-rc.3 ### Patch Changes @@ -31,6 +37,7 @@ - Updated dependencies [074db3b419] - Updated dependencies [b8f3d5014f] - @rocket.chat/ui-contexts@2.0.0-rc.0 + ## 1.0.7 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index cb443b0b5cef..98d926d14d66 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "2.0.0-rc.3", + "version": "2.0.0-rc.4", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -61,7 +61,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.3", + "@rocket.chat/ui-contexts": "2.0.0-rc.4", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index 9bd2e8822387..7e8fc0d165c3 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/ui-contexts +## 2.0.0-rc.4 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.4 +- @rocket.chat/rest-typings@6.4.0-rc.4 +- @rocket.chat/ddp-client@0.2.0-rc.4 + ## 2.0.0-rc.3 ### Patch Changes @@ -50,6 +58,7 @@ - @rocket.chat/core-typings@6.4.0-rc.0 - @rocket.chat/rest-typings@6.4.0-rc.0 - @rocket.chat/ddp-client@0.2.0-rc.0 + ## 1.0.7 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 3c566266458c..78591fa51c5f 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "2.0.0-rc.3", + "version": "2.0.0-rc.4", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index 79fa468abde8..bb332f206fc4 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-video-conf +## 2.0.0-rc.4 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.4 + ## 2.0.0-rc.3 ### Patch Changes @@ -25,6 +31,7 @@ - Updated dependencies [074db3b419] - Updated dependencies [b8f3d5014f] - @rocket.chat/ui-contexts@2.0.0-rc.0 + ## 1.0.7 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index ddd02a76f27d..6ad0bb49b558 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "2.0.0-rc.3", + "version": "2.0.0-rc.4", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.3", + "@rocket.chat/ui-contexts": "2.0.0-rc.4", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index 615d4f729beb..ae860561c5dd 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/uikit-playground +## 0.2.0-rc.4 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.4 +- @rocket.chat/fuselage-ui-kit@2.0.0-rc.4 + ## 0.2.0-rc.3 ### Patch Changes @@ -39,6 +46,7 @@ - Updated dependencies [b8f3d5014f] - @rocket.chat/fuselage-ui-kit@2.0.0-rc.0 - @rocket.chat/ui-contexts@2.0.0-rc.0 + ## 0.1.7 ### Patch Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index 5dde4147d2d6..bb21f8990e75 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.2.0-rc.3", + "version": "0.2.0-rc.4", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index 4a3409bfd81a..63b5246eedcd 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/web-ui-registration +## 2.0.0-rc.4 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.4 + ## 2.0.0-rc.3 ### Patch Changes @@ -26,6 +32,7 @@ - Updated dependencies [074db3b419] - Updated dependencies [b8f3d5014f] - @rocket.chat/ui-contexts@2.0.0-rc.0 + ## 1.0.7 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index 6341f6263e15..60669e1c9e19 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "2.0.0-rc.3", + "version": "2.0.0-rc.4", "private": true, "homepage": "https://rocket.chat", "main": "./dist/index.js", @@ -49,7 +49,7 @@ }, "peerDependencies": { "@rocket.chat/layout": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.3", + "@rocket.chat/ui-contexts": "2.0.0-rc.4", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", From 068fe4888e4b69516e4541749593761b0f7f3a6f Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 19 Sep 2023 23:10:45 -0300 Subject: [PATCH 176/275] chore: cache incremental ts check (#30447) --- .github/workflows/ci-code-check.yml | 11 +++++++++++ apps/meteor/.gitignore | 3 ++- apps/meteor/tsconfig.typecheck.json | 4 +++- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci-code-check.yml b/.github/workflows/ci-code-check.yml index 5a556a1a8e29..57cdac047423 100644 --- a/.github/workflows/ci-code-check.yml +++ b/.github/workflows/ci-code-check.yml @@ -44,6 +44,17 @@ jobs: - uses: dtinth/setup-github-actions-caching-for-turbo@v1 + - name: Cache TypeCheck + uses: actions/cache@v3 + if: matrix.check == 'ts' + with: + path: ./apps/meteor/tsconfig.typecheck.tsbuildinfo + key: typecheck-cache-${{ runner.OS }}-${{ hashFiles('yarn.lock') }}-${{ github.event.issue.number }} + restore-keys: | + typecheck-cache-${{ runner.OS }}-${{ hashFiles('yarn.lock') }} + typecheck-cache-${{ runner.OS }} + typecheck-cache + - name: TS TypeCheck if: matrix.check == 'ts' run: yarn turbo run typecheck diff --git a/apps/meteor/.gitignore b/apps/meteor/.gitignore index 287cb313c174..a9fd54ab8711 100644 --- a/apps/meteor/.gitignore +++ b/apps/meteor/.gitignore @@ -87,4 +87,5 @@ out.txt dist *-session.json matrix-federation-config/* -.eslintcache \ No newline at end of file +.eslintcache +tsconfig.typecheck.tsbuildinfo diff --git a/apps/meteor/tsconfig.typecheck.json b/apps/meteor/tsconfig.typecheck.json index e5a34906c8ce..6bd9f923d175 100644 --- a/apps/meteor/tsconfig.typecheck.json +++ b/apps/meteor/tsconfig.typecheck.json @@ -2,7 +2,9 @@ "extends": "./tsconfig.json", "compilerOptions": { "skipLibCheck": true, - "noEmit": true + "noEmit": true, + "incremental": true, + "allowImportingTsExtensions": true }, "exclude": [".meteor", "./packages", "./imports/client", "./ee/server/services", "public/", "private"] } From 98fad7df5a349f98d3d1094b097fd2ce1cf90f07 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 20 Sep 2023 00:00:50 -0300 Subject: [PATCH 177/275] ci: patch mongo type definitions (#30449) --- .yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch | 13 +++++++++++++ apps/meteor/tsconfig.typecheck.json | 5 ++++- package.json | 3 ++- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 .yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch diff --git a/.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch b/.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch new file mode 100644 index 000000000000..501881370244 --- /dev/null +++ b/.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch @@ -0,0 +1,13 @@ +diff --git a/mongodb.d.ts b/mongodb.d.ts +index dd080b553309594c28093365ea101adec5c0a20c..20a616de8c97ec68629c01a848ea8df4fe122bf2 100644 +--- a/mongodb.d.ts ++++ b/mongodb.d.ts +@@ -5539,7 +5539,7 @@ export declare interface MonitorOptions extends Omit = Depth['length'] extends 8 ? [] : Type extends string | number | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | { ++export declare type NestedPaths = Depth['length'] extends 1 ? [] : Type extends string | number | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | { + _bsontype: string; + } ? [] : Type extends ReadonlyArray ? [] | [number, ...NestedPaths] : Type extends Map ? [string] : Type extends object ? { + [Key in Extract]: Type[Key] extends Type ? [Key] : Type extends Type[Key] ? [Key] : Type[Key] extends ReadonlyArray ? Type extends ArrayType ? [Key] : ArrayType extends Type ? [Key] : [ diff --git a/apps/meteor/tsconfig.typecheck.json b/apps/meteor/tsconfig.typecheck.json index 6bd9f923d175..33699e98affb 100644 --- a/apps/meteor/tsconfig.typecheck.json +++ b/apps/meteor/tsconfig.typecheck.json @@ -4,7 +4,10 @@ "skipLibCheck": true, "noEmit": true, "incremental": true, - "allowImportingTsExtensions": true + "allowImportingTsExtensions": true, + "paths": { + "mongodb": ["node_modules/mongodb"] + } }, "exclude": [".meteor", "./packages", "./imports/client", "./ee/server/services", "public/", "private"] } diff --git a/package.json b/package.json index 7d3e08d4f5a6..cbc2d7656e69 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "minimist": "1.2.6", "adm-zip": "0.5.9", "preact@10.15.1": "patch:preact@npm:10.15.1#.yarn/patches/preact-npm-10.15.1-bd458de913.patch", - "@storybook/react-docgen-typescript-plugin@1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0": "patch:@storybook/react-docgen-typescript-plugin@npm%3A1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0#./.yarn/patches/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40.patch" + "@storybook/react-docgen-typescript-plugin@1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0": "patch:@storybook/react-docgen-typescript-plugin@npm%3A1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0#./.yarn/patches/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40.patch", + "mongodb@4.17.1": "patch:mongodb@npm:4.17.1#.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch" } } From 306761ea00d999b0427e59ef345882b834758e0b Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 20 Sep 2023 10:51:28 -0300 Subject: [PATCH 178/275] chore: bump mongo deps (#30450) --- apps/meteor/ee/server/services/Dockerfile | 2 + apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 3 +- ee/apps/account-service/Dockerfile | 1 + ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/Dockerfile | 1 + ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/Dockerfile | 1 + ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/Dockerfile | 1 + ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/Dockerfile | 1 + ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/Dockerfile | 1 + ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/Dockerfile | 1 + ee/apps/stream-hub-service/package.json | 2 +- ee/packages/omnichannel-services/package.json | 2 +- ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/agenda/package.json | 2 +- packages/core-services/package.json | 2 +- packages/core-typings/package.json | 2 +- packages/cron/package.json | 2 +- packages/instance-status/package.json | 2 +- packages/model-typings/package.json | 2 +- packages/rest-typings/package.json | 2 +- packages/ui-contexts/package.json | 2 +- yarn.lock | 273 ++++-------------- 29 files changed, 86 insertions(+), 237 deletions(-) diff --git a/apps/meteor/ee/server/services/Dockerfile b/apps/meteor/ee/server/services/Dockerfile index 6b55a5c35aca..e1a1074fcb60 100644 --- a/apps/meteor/ee/server/services/Dockerfile +++ b/apps/meteor/ee/server/services/Dockerfile @@ -10,6 +10,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./packages/core-services packages/core-services COPY ./packages/core-typings packages/core-typings @@ -56,6 +57,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./apps/meteor/ee/server/services/package.json ./apps/meteor/ee/server/services/package.json ENV NODE_ENV=production \ diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 1c85cad8ca90..98658d1ab681 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -41,7 +41,7 @@ "jaeger-client": "^3.19.0", "mem": "^8.1.1", "moleculer": "^0.14.29", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.6.1", "pino": "^8.15.0", "sodium-native": "^3.3.0", diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 030b77fd7814..9e68456a78c8 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -371,8 +371,7 @@ "moment": "^2.29.4", "moment-timezone": "^0.5.43", "mongo-message-queue": "^1.0.0", - "mongodb": "^4.12.1", - "mongodb-memory-server": "^7.6.3", + "mongodb": "^4.17.1", "nats": "^2.6.1", "node-abort-controller": "^3.1.1", "node-dogstatsd": "^0.0.7", diff --git a/ee/apps/account-service/Dockerfile b/ee/apps/account-service/Dockerfile index e59c9f672f8b..d7ccb734071b 100644 --- a/ee/apps/account-service/Dockerfile +++ b/ee/apps/account-service/Dockerfile @@ -29,6 +29,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./ee/apps/${SERVICE}/package.json ee/apps/${SERVICE}/package.json ENV NODE_ENV=production \ diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index ace7c0a7b8e5..5828b25ebcd3 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -31,7 +31,7 @@ "gc-stats": "^1.4.0", "mem": "^8.1.1", "moleculer": "^0.14.29", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.4.0", "pino": "^8.15.0", "polka": "^0.5.2", diff --git a/ee/apps/authorization-service/Dockerfile b/ee/apps/authorization-service/Dockerfile index e59c9f672f8b..d7ccb734071b 100644 --- a/ee/apps/authorization-service/Dockerfile +++ b/ee/apps/authorization-service/Dockerfile @@ -29,6 +29,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./ee/apps/${SERVICE}/package.json ee/apps/${SERVICE}/package.json ENV NODE_ENV=production \ diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index 421591bc2d2e..9eac1c8b04fc 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -30,7 +30,7 @@ "gc-stats": "^1.4.0", "mem": "^8.1.1", "moleculer": "^0.14.29", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.4.0", "pino": "^8.15.0", "polka": "^0.5.2" diff --git a/ee/apps/ddp-streamer/Dockerfile b/ee/apps/ddp-streamer/Dockerfile index 9a3f9ef9c582..5250e48bf106 100644 --- a/ee/apps/ddp-streamer/Dockerfile +++ b/ee/apps/ddp-streamer/Dockerfile @@ -41,6 +41,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./ee/apps/${SERVICE}/package.json ee/apps/${SERVICE}/package.json ENV NODE_ENV=production \ diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 71beb619979d..893bc8f09509 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -35,7 +35,7 @@ "jaeger-client": "^3.19.0", "mem": "^8.1.1", "moleculer": "^0.14.29", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.4.0", "pino": "^8.15.0", "polka": "^0.5.2", diff --git a/ee/apps/omnichannel-transcript/Dockerfile b/ee/apps/omnichannel-transcript/Dockerfile index cc27cd7de9b5..95fb836e9f27 100644 --- a/ee/apps/omnichannel-transcript/Dockerfile +++ b/ee/apps/omnichannel-transcript/Dockerfile @@ -41,6 +41,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./ee/apps/${SERVICE}/package.json ee/apps/${SERVICE}/package.json ENV NODE_ENV=production \ diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index acb555a210ba..851626cbe980 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -36,7 +36,7 @@ "moleculer": "^0.14.29", "moment-timezone": "^0.5.43", "mongo-message-queue": "^1.0.0", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.4.0", "pino": "^8.15.0", "polka": "^0.5.2" diff --git a/ee/apps/presence-service/Dockerfile b/ee/apps/presence-service/Dockerfile index 5db19b7c0900..f85c45246f29 100644 --- a/ee/apps/presence-service/Dockerfile +++ b/ee/apps/presence-service/Dockerfile @@ -35,6 +35,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./ee/apps/${SERVICE}/package.json ee/apps/${SERVICE}/package.json ENV NODE_ENV=production \ diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index f59012a68ccb..9dd31e8c0ffd 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -30,7 +30,7 @@ "gc-stats": "^1.4.0", "mem": "^8.1.1", "moleculer": "^0.14.29", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.4.0", "pino": "^8.15.0", "polka": "^0.5.2" diff --git a/ee/apps/queue-worker/Dockerfile b/ee/apps/queue-worker/Dockerfile index cc27cd7de9b5..95fb836e9f27 100644 --- a/ee/apps/queue-worker/Dockerfile +++ b/ee/apps/queue-worker/Dockerfile @@ -41,6 +41,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./ee/apps/${SERVICE}/package.json ee/apps/${SERVICE}/package.json ENV NODE_ENV=production \ diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index d141aa707728..31aacc6c7c1b 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -34,7 +34,7 @@ "moleculer": "^0.14.29", "moment-timezone": "^0.5.43", "mongo-message-queue": "^1.0.0", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.4.0", "pino": "^8.15.0", "polka": "^0.5.2" diff --git a/ee/apps/stream-hub-service/Dockerfile b/ee/apps/stream-hub-service/Dockerfile index 2bc54c250389..c06115c887f5 100644 --- a/ee/apps/stream-hub-service/Dockerfile +++ b/ee/apps/stream-hub-service/Dockerfile @@ -32,6 +32,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./ee/apps/${SERVICE}/package.json ee/apps/${SERVICE}/package.json ENV NODE_ENV=production \ diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index 55ec8587c101..43753c77c78d 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -30,7 +30,7 @@ "gc-stats": "^1.4.0", "mem": "^8.1.1", "moleculer": "^0.14.29", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.4.0", "pino": "^8.15.0", "polka": "^0.5.2" diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 18bb13ba3f17..17a71abc3da5 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -29,7 +29,7 @@ "mem": "^8.1.1", "moment-timezone": "^0.5.43", "mongo-message-queue": "^1.0.0", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "pino": "^8.15.0" }, "scripts": { diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 9ade368e5cc4..9011dab086b6 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -32,6 +32,6 @@ "@rocket.chat/core-services": "workspace:^", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/models": "workspace:^", - "mongodb": "^4.12.1" + "mongodb": "^4.17.1" } } diff --git a/package.json b/package.json index cbc2d7656e69..f9029efb8b66 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,6 @@ "adm-zip": "0.5.9", "preact@10.15.1": "patch:preact@npm:10.15.1#.yarn/patches/preact-npm-10.15.1-bd458de913.patch", "@storybook/react-docgen-typescript-plugin@1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0": "patch:@storybook/react-docgen-typescript-plugin@npm%3A1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0#./.yarn/patches/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40.patch", - "mongodb@4.17.1": "patch:mongodb@npm:4.17.1#.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch" + "mongodb@^4.17.1": "patch:mongodb@npm:4.17.1#.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch" } } diff --git a/packages/agenda/package.json b/packages/agenda/package.json index dfdeb009c090..f533e05dba28 100644 --- a/packages/agenda/package.json +++ b/packages/agenda/package.json @@ -9,7 +9,7 @@ "debug": "~4.1.1", "human-interval": "^2.0.1", "moment-timezone": "~0.5.43", - "mongodb": "^4.12.1" + "mongodb": "^4.17.1" }, "devDependencies": { "@types/debug": "^4.1.8", diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 91c5ee914673..4cce8aebe07b 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -13,7 +13,7 @@ "babel-jest": "^29.5.0", "eslint": "~8.45.0", "jest": "~29.6.1", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "prettier": "~2.8.8", "typescript": "~5.2.2" }, diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 64f6b667894f..2d0b0d734897 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -4,7 +4,7 @@ "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "prettier": "~2.8.8", "typescript": "~5.2.2" }, diff --git a/packages/cron/package.json b/packages/cron/package.json index de4329b80473..c7db1e371cc1 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -26,6 +26,6 @@ "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/models": "workspace:^", "@rocket.chat/random": "workspace:^", - "mongodb": "^4.12.1" + "mongodb": "^4.17.1" } } diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 02434d021953..ed9c13ba5231 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -5,7 +5,7 @@ "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "prettier": "~2.8.8", "typescript": "~5.2.2" }, diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index d84dcd3b3742..b187c15b99c7 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -7,7 +7,7 @@ "@types/node-rsa": "^1.1.1", "eslint": "~8.45.0", "jest": "~29.6.1", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "ts-jest": "~29.0.5", "typescript": "~5.2.2" }, diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index adf3b3506f88..8b6f60f294b3 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -7,7 +7,7 @@ "eslint": "~8.45.0", "jest": "~29.6.1", "jest-environment-jsdom": "~29.6.1", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "ts-jest": "~29.0.5", "typescript": "~5.2.2" }, diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 4f794763b257..82dc4519f85e 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -14,7 +14,7 @@ "eslint": "~8.45.0", "eslint-plugin-react-hooks": "^4.6.0", "jest": "~29.6.1", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "react": "~17.0.2", "ts-jest": "~29.0.5", "typescript": "~5.2.2", diff --git a/yarn.lock b/yarn.lock index edc0087cc9ce..7d7b23691683 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4349,6 +4349,15 @@ __metadata: languageName: node linkType: hard +"@mongodb-js/saslprep@npm:^1.1.0": + version: 1.1.0 + resolution: "@mongodb-js/saslprep@npm:1.1.0" + dependencies: + sparse-bitfield: ^3.0.3 + checksum: 1479a43e216734672f8eb1a2a55165b6896841bd00fb5bd645390a24374ef6c29f0f6d19a43618a19b8f1912fcbd2b2cc2210a62361103d1f28dce6852cf31d4 + languageName: node + linkType: hard + "@mrmlnc/readdir-enhanced@npm:^2.2.1": version: 2.2.1 resolution: "@mrmlnc/readdir-enhanced@npm:2.2.1" @@ -7693,7 +7702,7 @@ __metadata: gc-stats: ^1.4.0 mem: ^8.1.1 moleculer: ^0.14.29 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.4.0 pino: ^8.15.0 polka: ^0.5.2 @@ -7728,7 +7737,7 @@ __metadata: human-interval: ^2.0.1 jest: ~29.6.1 moment-timezone: ~0.5.43 - mongodb: ^4.12.1 + mongodb: ^4.17.1 ts-jest: ~29.0.5 typescript: ~5.2.2 languageName: unknown @@ -7815,7 +7824,7 @@ __metadata: gc-stats: ^1.4.0 mem: ^8.1.1 moleculer: ^0.14.29 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.4.0 pino: ^8.15.0 polka: ^0.5.2 @@ -7876,7 +7885,7 @@ __metadata: eslint: ~8.45.0 fibers: ^5.0.3 jest: ~29.6.1 - mongodb: ^4.12.1 + mongodb: ^4.17.1 prettier: ~2.8.8 typescript: ~5.2.2 languageName: unknown @@ -7892,7 +7901,7 @@ __metadata: "@rocket.chat/message-parser": next "@rocket.chat/ui-kit": ^0.32.1 eslint: ~8.45.0 - mongodb: ^4.12.1 + mongodb: ^4.17.1 prettier: ~2.8.8 typescript: ~5.2.2 languageName: unknown @@ -7909,7 +7918,7 @@ __metadata: "@types/jest": ~29.5.3 eslint: ~8.45.0 jest: ~29.6.1 - mongodb: ^4.12.1 + mongodb: ^4.17.1 ts-jest: ~29.0.5 typescript: ~5.2.2 languageName: unknown @@ -8014,7 +8023,7 @@ __metadata: jaeger-client: ^3.19.0 mem: ^8.1.1 moleculer: ^0.14.29 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.4.0 pino: ^8.15.0 pino-pretty: ^7.6.1 @@ -8350,7 +8359,7 @@ __metadata: "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/models": "workspace:^" eslint: ~8.45.0 - mongodb: ^4.12.1 + mongodb: ^4.17.1 prettier: ~2.8.8 typescript: ~5.2.2 languageName: unknown @@ -8814,8 +8823,7 @@ __metadata: moment: ^2.29.4 moment-timezone: ^0.5.43 mongo-message-queue: ^1.0.0 - mongodb: ^4.12.1 - mongodb-memory-server: ^7.6.3 + mongodb: ^4.17.1 nats: ^2.6.1 node-abort-controller: ^3.1.1 node-dogstatsd: ^0.0.7 @@ -8933,7 +8941,7 @@ __metadata: "@types/node-rsa": ^1.1.1 eslint: ~8.45.0 jest: ~29.6.1 - mongodb: ^4.12.1 + mongodb: ^4.17.1 ts-jest: ~29.0.5 typescript: ~5.2.2 languageName: unknown @@ -8987,7 +8995,7 @@ __metadata: mem: ^8.1.1 moment-timezone: ^0.5.43 mongo-message-queue: ^1.0.0 - mongodb: ^4.12.1 + mongodb: ^4.17.1 pino: ^8.15.0 ts-jest: ~29.0.5 typescript: ~5.2.2 @@ -9024,7 +9032,7 @@ __metadata: moleculer: ^0.14.29 moment-timezone: ^0.5.43 mongo-message-queue: ^1.0.0 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.4.0 pino: ^8.15.0 polka: ^0.5.2 @@ -9133,7 +9141,7 @@ __metadata: gc-stats: ^1.4.0 mem: ^8.1.1 moleculer: ^0.14.29 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.4.0 pino: ^8.15.0 polka: ^0.5.2 @@ -9159,7 +9167,7 @@ __metadata: babel-jest: ^29.0.3 eslint: ~8.45.0 jest: ~29.6.1 - mongodb: ^4.12.1 + mongodb: ^4.17.1 typescript: ~5.2.2 languageName: unknown linkType: soft @@ -9200,7 +9208,7 @@ __metadata: moleculer: ^0.14.29 moment-timezone: ^0.5.43 mongo-message-queue: ^1.0.0 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.4.0 pino: ^8.15.0 polka: ^0.5.2 @@ -9261,7 +9269,7 @@ __metadata: eslint: ~8.45.0 jest: ~29.6.1 jest-environment-jsdom: ~29.6.1 - mongodb: ^4.12.1 + mongodb: ^4.17.1 ts-jest: ~29.0.5 typescript: ~5.2.2 languageName: unknown @@ -9338,7 +9346,7 @@ __metadata: gc-stats: ^1.4.0 mem: ^8.1.1 moleculer: ^0.14.29 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.4.0 pino: ^8.15.0 polka: ^0.5.2 @@ -9507,7 +9515,7 @@ __metadata: eslint: ~8.45.0 eslint-plugin-react-hooks: ^4.6.0 jest: ~29.6.1 - mongodb: ^4.12.1 + mongodb: ^4.17.1 react: ~17.0.2 ts-jest: ~29.0.5 typescript: ~5.2.2 @@ -11908,15 +11916,6 @@ __metadata: languageName: node linkType: hard -"@types/bson@npm:*": - version: 4.2.0 - resolution: "@types/bson@npm:4.2.0" - dependencies: - bson: "*" - checksum: 55abf60c57b7f05655c210b386392636a299a7df18b89cec2cde0aa87374d97dd4ac9632226b0f6fe135d16ad4296ae5ddc782f6e9132d38c53dd26a6df8e704 - languageName: node - linkType: hard - "@types/busboy@npm:^1.5.0": version: 1.5.0 resolution: "@types/busboy@npm:1.5.0" @@ -12595,16 +12594,6 @@ __metadata: languageName: node linkType: hard -"@types/mongodb@npm:^3.6.20": - version: 3.6.20 - resolution: "@types/mongodb@npm:3.6.20" - dependencies: - "@types/bson": "*" - "@types/node": "*" - checksum: e5397ada2ed728997f7c3f5424e8c28f682a635488be967c9c18a5de27b1641cf28bb42bc12026ac6d475c457a880e27097e13c8120350ba13219f4ccc030656 - languageName: node - linkType: hard - "@types/ms@npm:*": version: 0.7.31 resolution: "@types/ms@npm:0.7.31" @@ -13124,13 +13113,6 @@ __metadata: languageName: node linkType: hard -"@types/tmp@npm:^0.2.2": - version: 0.2.3 - resolution: "@types/tmp@npm:0.2.3" - checksum: 0ca45e99b3b3c6959d5c4f4555f73c8007db540cfb0fbbb9373217f9ab85e67eef75193f51a1d6564b0ee6c6f5ffa259d1034d7f7530a5b7ce80acb94cfc4daa - languageName: node - linkType: hard - "@types/tough-cookie@npm:*": version: 4.0.1 resolution: "@types/tough-cookie@npm:4.0.1" @@ -14910,15 +14892,6 @@ __metadata: languageName: node linkType: hard -"async-mutex@npm:^0.3.2": - version: 0.3.2 - resolution: "async-mutex@npm:0.3.2" - dependencies: - tslib: ^2.3.1 - checksum: 620b771dfdea1cad0a6b712915c31a1e3ca880a8cf1eae92b4590f435995e0260929c6ebaae0b9126b1456790ea498064b5bb9a506948cda760f48d3d0dcc4c8 - languageName: node - linkType: hard - "async-retry@npm:^1.3.3": version: 1.3.3 resolution: "async-retry@npm:1.3.3" @@ -15645,16 +15618,6 @@ __metadata: languageName: node linkType: hard -"bl@npm:^2.2.1": - version: 2.2.1 - resolution: "bl@npm:2.2.1" - dependencies: - readable-stream: ^2.3.5 - safe-buffer: ^5.1.1 - checksum: 4f5d9b258919646a8d02f1731379e53b6f6309e34596ae02afbc3aeb183910bd2d0b70681f889b7c620ca48f65dc1cd0992ee1266c90d6d7c3be60688d141233 - languageName: node - linkType: hard - "bl@npm:^4.0.3": version: 4.1.0 resolution: "bl@npm:4.1.0" @@ -16059,19 +16022,12 @@ __metadata: languageName: node linkType: hard -"bson@npm:*, bson@npm:^4.6.4, bson@npm:^4.7.0": - version: 4.7.0 - resolution: "bson@npm:4.7.0" +"bson@npm:^4.6.4, bson@npm:^4.7.2": + version: 4.7.2 + resolution: "bson@npm:4.7.2" dependencies: buffer: ^5.6.0 - checksum: 83e7b64afdad5a505073a7e6206e7b345f59e7888fbcb1948fba72b6101a1baf58b7499314f8e24b650567665f7973eda048aabbb1ddcfbadfba7d6c6b0f5e83 - languageName: node - linkType: hard - -"bson@npm:^1.1.4": - version: 1.1.6 - resolution: "bson@npm:1.1.6" - checksum: 75762c9b7e0b3156cb0f38c7eb9ffcade53f0b04ac87dece9cba38f6dc570d9af91251de6a8988b294063cfaa21894c60ac9e85c34176accb3674acb092d66a7 + checksum: f357d12c5679c8eb029a62e410ad40fb862b7b91f0fc12a3399fb3668e14aecaa63205ffeeee48735a01d393171743607dcd527eb8c058b6f2bd294079ee4125 languageName: node linkType: hard @@ -16506,7 +16462,7 @@ __metadata: languageName: node linkType: hard -"camelcase@npm:^6.0.0, camelcase@npm:^6.1.0, camelcase@npm:^6.2.0, camelcase@npm:^6.3.0": +"camelcase@npm:^6.0.0, camelcase@npm:^6.2.0, camelcase@npm:^6.3.0": version: 6.3.0 resolution: "camelcase@npm:6.3.0" checksum: 8c96818a9076434998511251dcb2761a94817ea17dbdc37f47ac080bd088fc62c7369429a19e2178b993497132c8cbcf5cc1f44ba963e76782ba469c0474938d @@ -18654,7 +18610,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.2.0, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4, debug@npm:~4.3.1": +"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4, debug@npm:~4.3.1": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -19019,13 +18975,6 @@ __metadata: languageName: node linkType: hard -"denque@npm:^1.4.1": - version: 1.5.1 - resolution: "denque@npm:1.5.1" - checksum: 4375ad19d5cea99f90effa82a8cecdaa10f4eb261fbcd7e47cd753ff2737f037aac8f7f4e031cc77f3966314c491c86a0d3b20c128aeee57f791b4662c45108e - languageName: node - linkType: hard - "depd@npm:2.0.0, depd@npm:~2.0.0": version: 2.0.0 resolution: "depd@npm:2.0.0" @@ -21544,7 +21493,7 @@ __metadata: languageName: node linkType: hard -"find-cache-dir@npm:^3.2.0, find-cache-dir@npm:^3.3.1, find-cache-dir@npm:^3.3.2": +"find-cache-dir@npm:^3.2.0, find-cache-dir@npm:^3.3.1": version: 3.3.2 resolution: "find-cache-dir@npm:3.3.2" dependencies: @@ -22276,13 +22225,6 @@ __metadata: languageName: node linkType: hard -"get-port@npm:^5.1.1": - version: 5.1.1 - resolution: "get-port@npm:5.1.1" - checksum: 0162663ffe5c09e748cd79d97b74cd70e5a5c84b760a475ce5767b357fb2a57cb821cee412d646aa8a156ed39b78aab88974eddaa9e5ee926173c036c0713787 - languageName: node - linkType: hard - "get-proxy@npm:^2.0.0": version: 2.1.0 resolution: "get-proxy@npm:2.1.0" @@ -27581,15 +27523,6 @@ __metadata: languageName: node linkType: hard -"md5-file@npm:^5.0.0": - version: 5.0.0 - resolution: "md5-file@npm:5.0.0" - bin: - md5-file: cli.js - checksum: c606a00ff58adf5428e8e2f36d86e5d3c7029f9688126faca302cd83b5e92cac183a62e1d1f05fae7c2614e80f993326fd0a8d6a3a913c41ec7ea0eefc25aa76 - languageName: node - linkType: hard - "md5.js@npm:^1.3.4": version: 1.3.5 resolution: "md5.js@npm:1.3.5" @@ -28619,7 +28552,7 @@ __metadata: languageName: node linkType: hard -"mongodb-connection-string-url@npm:^2.5.4": +"mongodb-connection-string-url@npm:^2.6.0": version: 2.6.0 resolution: "mongodb-connection-string-url@npm:2.6.0" dependencies: @@ -28629,87 +28562,39 @@ __metadata: languageName: node linkType: hard -"mongodb-memory-server-core@npm:7.6.3": - version: 7.6.3 - resolution: "mongodb-memory-server-core@npm:7.6.3" +"mongodb@npm:4.17.1, mongodb@npm:^4.3.1": + version: 4.17.1 + resolution: "mongodb@npm:4.17.1" dependencies: - "@types/mongodb": ^3.6.20 - "@types/tmp": ^0.2.2 - async-mutex: ^0.3.2 - camelcase: ^6.1.0 - debug: ^4.2.0 - find-cache-dir: ^3.3.2 - get-port: ^5.1.1 - https-proxy-agent: ^5.0.0 - md5-file: ^5.0.0 - mkdirp: ^1.0.4 - mongodb: ^3.7.3 - new-find-package-json: ^1.1.0 - semver: ^7.3.5 - tar-stream: ^2.1.4 - tmp: ^0.2.1 - tslib: ^2.3.0 - uuid: ^8.3.1 - yauzl: ^2.10.0 - checksum: 2c111f7a90f72b6810e9083da40b8bbf905d1388eb8453f71225ff805a865985efef2c40a88d082baf9ece737b4d9bd3c9fd517d1fcc656aae53e9f62e44ee14 - languageName: node - linkType: hard - -"mongodb-memory-server@npm:^7.6.3": - version: 7.6.3 - resolution: "mongodb-memory-server@npm:7.6.3" - dependencies: - mongodb-memory-server-core: 7.6.3 - tslib: ^2.3.0 - checksum: 8161ad3be8e31012f64ac4a1ac555b10071416ee6de6a50ee1a05d76018eaadacadb34364c29bba73e0877236f2f01163cd0e2dc0432427fbbe69a1fb4eaecbc - languageName: node - linkType: hard - -"mongodb@npm:^3.7.3": - version: 3.7.3 - resolution: "mongodb@npm:3.7.3" - dependencies: - bl: ^2.2.1 - bson: ^1.1.4 - denque: ^1.4.1 - optional-require: ^1.1.8 - safe-buffer: ^5.1.2 - saslprep: ^1.0.0 + "@aws-sdk/credential-providers": ^3.186.0 + "@mongodb-js/saslprep": ^1.1.0 + bson: ^4.7.2 + mongodb-connection-string-url: ^2.6.0 + socks: ^2.7.1 dependenciesMeta: - saslprep: - optional: true - peerDependenciesMeta: - aws4: - optional: true - bson-ext: - optional: true - kerberos: - optional: true - mongodb-client-encryption: - optional: true - mongodb-extjson: + "@aws-sdk/credential-providers": optional: true - snappy: + "@mongodb-js/saslprep": optional: true - checksum: ef7690fe6ee7d1752f121b14e59b3fabfddc60ff0536babce6c945703ad0010de9e6fa7de4c91b99275c256876a72a06899ce27893aba0838c2b542088bd1044 + checksum: e7f280570d0f23d60c308b2a484ed55762ec8e523946c0de1a0b3b398f24efcf1916a745e5407f32cd1c105b2f19d8ac75474c92f73cdf651affe3430a963f54 languageName: node linkType: hard -"mongodb@npm:^4.12.1, mongodb@npm:^4.3.1": - version: 4.12.1 - resolution: "mongodb@npm:4.12.1" +"mongodb@patch:mongodb@npm:4.17.1#.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch::locator=rocket.chat%40workspace%3A.": + version: 4.17.1 + resolution: "mongodb@patch:mongodb@npm%3A4.17.1#.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch::version=4.17.1&hash=f5fa42&locator=rocket.chat%40workspace%3A." dependencies: "@aws-sdk/credential-providers": ^3.186.0 - bson: ^4.7.0 - mongodb-connection-string-url: ^2.5.4 - saslprep: ^1.0.3 + "@mongodb-js/saslprep": ^1.1.0 + bson: ^4.7.2 + mongodb-connection-string-url: ^2.6.0 socks: ^2.7.1 dependenciesMeta: "@aws-sdk/credential-providers": optional: true - saslprep: + "@mongodb-js/saslprep": optional: true - checksum: 84590484b2c93bce849ec1e334b064e983444ed73942061c91e09556348c80db9d4a40544b927cd795bdfbfc51d1b713a7df5ced4ecf13cd00fab5e3c3e32ada + checksum: 7aa00b4000e8f01b18386b6d11033a3216de97ea892a7f10a9c0d0da40a51d91b1c9cbb0e51ff5691487e0fc926d06b5aebb944747153e6fbdaca08cf71d601c languageName: node linkType: hard @@ -29012,16 +28897,6 @@ __metadata: languageName: node linkType: hard -"new-find-package-json@npm:^1.1.0": - version: 1.1.0 - resolution: "new-find-package-json@npm:1.1.0" - dependencies: - debug: ^4.3.2 - tslib: ^2.3.0 - checksum: 818e5a837f87c62fb9bc4893247fd9b7b2ff1bbf25b174af9e9ec22d60d44ce355e60f80ed0657652370cca06e59539c7df292354250820403fa33cd210e76ed - languageName: node - linkType: hard - "nice-try@npm:^1.0.4": version: 1.0.5 resolution: "nice-try@npm:1.0.5" @@ -29920,15 +29795,6 @@ __metadata: languageName: node linkType: hard -"optional-require@npm:^1.1.8": - version: 1.1.8 - resolution: "optional-require@npm:1.1.8" - dependencies: - require-at: ^1.0.6 - checksum: 437db76f713052925185ae80837b593877f75101154e8937f50d33b0b07bd500c214efc9016748642109b6e3e1197eb0513a2963eb06bcf3890f88a2724b1c87 - languageName: node - linkType: hard - "optional@npm:^0.1.3": version: 0.1.4 resolution: "optional@npm:0.1.4" @@ -33943,13 +33809,6 @@ __metadata: languageName: node linkType: hard -"require-at@npm:^1.0.6": - version: 1.0.6 - resolution: "require-at@npm:1.0.6" - checksum: 7753a6ebad99855ef015d5533a787c65e883c94c23371368eebf6f1c7e2a078811013b204823152cbab206a00e825e8e5ca09416fd835a489fa30bf064fbe6d9 - languageName: node - linkType: hard - "require-directory@npm:^2.1.1": version: 2.1.1 resolution: "require-directory@npm:2.1.1" @@ -34272,7 +34131,7 @@ __metadata: jaeger-client: ^3.19.0 mem: ^8.1.1 moleculer: ^0.14.29 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.6.1 npm-run-all: ^4.1.5 pino: ^8.15.0 @@ -34444,15 +34303,6 @@ __metadata: languageName: node linkType: hard -"saslprep@npm:^1.0.0, saslprep@npm:^1.0.3": - version: 1.0.3 - resolution: "saslprep@npm:1.0.3" - dependencies: - sparse-bitfield: ^3.0.3 - checksum: 4fdc0b70fb5e523f977de405e12cca111f1f10dd68a0cfae0ca52c1a7919a94d1556598ba2d35f447655c3b32879846c77f9274c90806f6673248ae3cea6ee43 - languageName: node - linkType: hard - "sass-loader@npm:~10.4.1": version: 10.4.1 resolution: "sass-loader@npm:10.4.1" @@ -37118,15 +36968,6 @@ __metadata: languageName: node linkType: hard -"tmp@npm:^0.2.1": - version: 0.2.1 - resolution: "tmp@npm:0.2.1" - dependencies: - rimraf: ^3.0.0 - checksum: 8b1214654182575124498c87ca986ac53dc76ff36e8f0e0b67139a8d221eaecfdec108c0e6ec54d76f49f1f72ab9325500b246f562b926f85bcdfca8bf35df9e - languageName: node - linkType: hard - "tmpl@npm:1.0.5": version: 1.0.5 resolution: "tmpl@npm:1.0.5" @@ -38684,7 +38525,7 @@ __metadata: languageName: node linkType: hard -"uuid@npm:^8.0.0, uuid@npm:^8.3.1, uuid@npm:^8.3.2": +"uuid@npm:^8.0.0, uuid@npm:^8.3.2": version: 8.3.2 resolution: "uuid@npm:8.3.2" bin: @@ -40179,7 +40020,7 @@ __metadata: languageName: node linkType: hard -"yauzl@npm:^2.10.0, yauzl@npm:^2.4.2": +"yauzl@npm:^2.4.2": version: 2.10.0 resolution: "yauzl@npm:2.10.0" dependencies: From b46b7ee7d5e09f9017b26ddef31e555e86b4ece8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Jaeger=20Foresti?= <60678893+juliajforesti@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:16:32 -0300 Subject: [PATCH 179/275] regression: `LoginForm` validation (#30443) Co-authored-by: Douglas Fabris <27704687+dougfabris@users.noreply.github.com> --- packages/web-ui-registration/src/LoginForm.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/packages/web-ui-registration/src/LoginForm.tsx b/packages/web-ui-registration/src/LoginForm.tsx index efc7e6268feb..9052cb945fec 100644 --- a/packages/web-ui-registration/src/LoginForm.tsx +++ b/packages/web-ui-registration/src/LoginForm.tsx @@ -82,8 +82,6 @@ export const LoginForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRoute } setErrorOnSubmit('user-not-found'); - setError('username', { type: 'user-not-found', message: t('registration.component.login.userNotFound') }); - setError('password', { type: 'user-not-found', message: t('registration.component.login.incorrectPassword') }); }, }); @@ -95,11 +93,15 @@ export const LoginForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRoute if (loginFormRef.current) { loginFormRef.current.focus(); } - }, []); + }, [errorOnSubmit]); const renderErrorOnSubmit = (error: LoginErrors) => { const { type, i18n } = LOGIN_SUBMIT_ERRORS[error]; - return {t(i18n)}; + return ( + + {t(i18n)} + + ); }; if (errors.username?.type === 'invalid-email') { @@ -132,7 +134,7 @@ export const LoginForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRoute })} placeholder={usernameOrEmailPlaceholder || t('registration.component.form.emailPlaceholder')} error={errors.username?.message} - aria-invalid={errors.username ? 'true' : 'false'} + aria-invalid={errors.username || errorOnSubmit ? 'true' : 'false'} aria-describedby={`${usernameId}-error`} id={usernameId} /> @@ -154,7 +156,7 @@ export const LoginForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRoute })} placeholder={passwordPlaceholder} error={errors.password?.message} - aria-invalid={errors.password ? 'true' : 'false'} + aria-invalid={errors.password || errorOnSubmit ? 'true' : 'false'} aria-describedby={`${passwordId}-error`} id={passwordId} /> From ff8e9d9f54020c7cdf7b1302c19f8592fbdcf215 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Thu, 21 Sep 2023 15:18:27 +0000 Subject: [PATCH 180/275] Bump 6.3.8 --- .changeset/bump-patch-1695309507614.md | 5 +++++ yarn.lock | 16 ++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 .changeset/bump-patch-1695309507614.md diff --git a/.changeset/bump-patch-1695309507614.md b/.changeset/bump-patch-1695309507614.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1695309507614.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/yarn.lock b/yarn.lock index bf0ee10b6019..dcda640300f3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9898,9 +9898,9 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.6 + "@rocket.chat/ui-contexts": 1.0.7 "@rocket.chat/ui-kit": "*" - "@rocket.chat/ui-video-conf": 1.0.6 + "@rocket.chat/ui-video-conf": 1.0.7 "@tanstack/react-query": "*" react: "*" react-dom: "*" @@ -9982,14 +9982,14 @@ __metadata: ts-jest: ~29.0.5 typescript: ~5.1.3 peerDependencies: - "@rocket.chat/core-typings": 6.3.6 + "@rocket.chat/core-typings": 6.3.7 "@rocket.chat/css-in-js": "*" "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-tokens": "*" "@rocket.chat/message-parser": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-client": 1.0.6 - "@rocket.chat/ui-contexts": 1.0.6 + "@rocket.chat/ui-client": 1.0.7 + "@rocket.chat/ui-contexts": 1.0.7 katex: "*" react: "*" languageName: unknown @@ -11048,7 +11048,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 1.0.6 + "@rocket.chat/ui-contexts": 1.0.7 react: ~17.0.2 languageName: unknown linkType: soft @@ -11202,7 +11202,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.6 + "@rocket.chat/ui-contexts": 1.0.7 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -11268,7 +11268,7 @@ __metadata: typescript: ~5.1.3 peerDependencies: "@rocket.chat/layout": "*" - "@rocket.chat/ui-contexts": 1.0.6 + "@rocket.chat/ui-contexts": 1.0.7 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From ec60dbe8f5666b22d971b5fb9bc8a637668976c8 Mon Sep 17 00:00:00 2001 From: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com> Date: Thu, 21 Sep 2023 14:50:28 -0300 Subject: [PATCH 181/275] fix: Custom translations do not work (#30383) Co-authored-by: Yash Rajpal <58601732+yash-rajpal@users.noreply.github.com> --- .changeset/cuddly-donkeys-remember.md | 5 +++++ apps/meteor/client/providers/TranslationProvider.tsx | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 .changeset/cuddly-donkeys-remember.md diff --git a/.changeset/cuddly-donkeys-remember.md b/.changeset/cuddly-donkeys-remember.md new file mode 100644 index 000000000000..237aafe7f95b --- /dev/null +++ b/.changeset/cuddly-donkeys-remember.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed custom translations not being displayed diff --git a/apps/meteor/client/providers/TranslationProvider.tsx b/apps/meteor/client/providers/TranslationProvider.tsx index fdddb9ec5349..e379d13dfb79 100644 --- a/apps/meteor/client/providers/TranslationProvider.tsx +++ b/apps/meteor/client/providers/TranslationProvider.tsx @@ -79,6 +79,11 @@ const useI18next = (lng: string): typeof i18next => { if (prefix) { result[key.slice(prefix.length + 1)] = value; + continue; + } + + if (Array.isArray(namespaces) ? namespaces.includes('core') : namespaces === 'core') { + result[key] = value; } } } From 7cb0ce05fb668561fff01e2f6fdd9e541aba587f Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 19 Sep 2023 12:39:38 -0300 Subject: [PATCH 182/275] ci: Add step to notify external services about a new release after Docker image publish (#30436) --- .github/workflows/ci.yml | 102 +++++++++++++++++++++++++-------------- 1 file changed, 67 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aa86468e1895..09b561675e94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -323,13 +323,16 @@ jobs: echo finished deploy: - name: 🚀 Publish build and update our registry + name: 🚀 Publish build assets runs-on: ubuntu-20.04 if: github.event_name == 'release' || github.ref == 'refs/heads/develop' needs: [tests-done, release-versions] steps: - - uses: actions/checkout@v3 + - uses: Bhacaz/checkout-files@v2 + with: + files: package.json + branch: ${{ github.ref }} - name: Restore build uses: actions/download-artifact@v3 @@ -343,32 +346,17 @@ jobs: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_DEFAULT_REGION: 'us-east-1' GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} - REDHAT_REGISTRY_PID: ${{ secrets.REDHAT_REGISTRY_PID }} - REDHAT_REGISTRY_KEY: ${{ secrets.REDHAT_REGISTRY_KEY }} - UPDATE_TOKEN: ${{ secrets.UPDATE_TOKEN }} run: | REPO_VERSION=$(node -p "require('./package.json').version") + if [[ '${{ github.event_name }}' = 'release' ]]; then GIT_TAG="${GITHUB_REF#*tags/}" - GIT_BRANCH="" ARTIFACT_NAME="${REPO_VERSION}" - RC_VERSION=$GIT_TAG - - if [[ '${{ needs.release-versions.outputs.release }}' = 'release-candidate' ]]; then - SNAP_CHANNEL=candidate - RC_RELEASE=candidate - elif [[ '${{ needs.release-versions.outputs.release }}' = 'latest' ]]; then - SNAP_CHANNEL=stable - RC_RELEASE=stable - fi else GIT_TAG="" - GIT_BRANCH="${GITHUB_REF#*heads/}" ARTIFACT_NAME="${REPO_VERSION}.$GITHUB_SHA" - RC_VERSION="${REPO_VERSION}" - SNAP_CHANNEL=edge - RC_RELEASE=develop fi; + ROCKET_DEPLOY_DIR="/tmp/deploy" FILENAME="$ROCKET_DEPLOY_DIR/rocket.chat-$ARTIFACT_NAME.tgz"; @@ -386,22 +374,6 @@ jobs: aws s3 cp $ROCKET_DEPLOY_DIR/ s3://download.rocket.chat/build/ --recursive - curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \ - "{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"4.4\", \"5.0\", \"6.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"$RC_RELEASE\"}" \ - https://releases.rocket.chat/update - - # Makes build fail if the release isn't there - curl --fail https://releases.rocket.chat/$RC_VERSION/info - - if [[ $GIT_TAG ]]; then - curl -X POST \ - https://connect.redhat.com/api/v2/projects/$REDHAT_REGISTRY_PID/build \ - -H "Authorization: Bearer $REDHAT_REGISTRY_KEY" \ - -H 'Cache-Control: no-cache' \ - -H 'Content-Type: application/json' \ - -d '{"tag":"'$GIT_TAG'"}' - fi - build-docker-preview: name: 🚢 Build Docker Image (preview) runs-on: ubuntu-20.04 @@ -632,6 +604,66 @@ jobs: echo "::endgroup::" + notify-services: + name: 🚀 Notify external services + runs-on: ubuntu-20.04 + needs: + - services-docker-image-publish + - docker-image-publish + - release-versions + steps: + - uses: Bhacaz/checkout-files@v2 + with: + files: package.json + branch: ${{ github.ref }} + + - name: Releases service + env: + UPDATE_TOKEN: ${{ secrets.UPDATE_TOKEN }} + run: | + REPO_VERSION=$(node -p "require('./package.json').version") + + if [[ '${{ github.event_name }}' = 'release' ]]; then + GIT_TAG="${GITHUB_REF#*tags/}" + GIT_BRANCH="" + ARTIFACT_NAME="${REPO_VERSION}" + RC_VERSION=$GIT_TAG + + if [[ '${{ needs.release-versions.outputs.release }}' = 'release-candidate' ]]; then + RC_RELEASE=candidate + elif [[ '${{ needs.release-versions.outputs.release }}' = 'latest' ]]; then + RC_RELEASE=stable + fi + else + GIT_TAG="" + GIT_BRANCH="${GITHUB_REF#*heads/}" + ARTIFACT_NAME="${REPO_VERSION}.$GITHUB_SHA" + RC_VERSION="${REPO_VERSION}" + RC_RELEASE=develop + fi; + + curl -H "Content-Type: application/json" -H "X-Update-Token: $UPDATE_TOKEN" -d \ + "{\"nodeVersion\": \"${{ needs.release-versions.outputs.node-version }}\", \"compatibleMongoVersions\": [\"4.4\", \"5.0\", \"6.0\"], \"commit\": \"$GITHUB_SHA\", \"tag\": \"$RC_VERSION\", \"branch\": \"$GIT_BRANCH\", \"artifactName\": \"$ARTIFACT_NAME\", \"releaseType\": \"$RC_RELEASE\"}" \ + https://releases.rocket.chat/update + + # Makes build fail if the release isn't there + curl --fail https://releases.rocket.chat/$RC_VERSION/info + + - name: RedHat Registry + if: github.event_name == 'release' + env: + REDHAT_REGISTRY_PID: ${{ secrets.REDHAT_REGISTRY_PID }} + REDHAT_REGISTRY_KEY: ${{ secrets.REDHAT_REGISTRY_KEY }} + run: | + GIT_TAG="${GITHUB_REF#*tags/}" + + curl -X POST \ + https://connect.redhat.com/api/v2/projects/$REDHAT_REGISTRY_PID/build \ + -H "Authorization: Bearer $REDHAT_REGISTRY_KEY" \ + -H 'Cache-Control: no-cache' \ + -H 'Content-Type: application/json' \ + -d '{"tag":"'$GIT_TAG'"}' + trigger-dependent-workflows: runs-on: ubuntu-latest if: github.event_name == 'release' From ef982c22028eba9a8460c9e82dcbd5f3746ec1a8 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 19 Sep 2023 19:32:05 -0300 Subject: [PATCH 183/275] chore: update meteor 2.13.0 (#29989) Co-authored-by: Diego Sampaio --- apps/meteor/.meteor/packages | 4 ++-- apps/meteor/.meteor/release | 2 +- apps/meteor/.meteor/versions | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/meteor/.meteor/packages b/apps/meteor/.meteor/packages index 37b95896612c..1a59026a80d3 100644 --- a/apps/meteor/.meteor/packages +++ b/apps/meteor/.meteor/packages @@ -25,7 +25,7 @@ accounts-password@2.3.4 accounts-twitter@1.5.0 pauli:accounts-linkedin -google-oauth@1.4.3 +google-oauth@1.4.4 oauth@2.2.0 oauth2@1.3.2 @@ -39,7 +39,7 @@ meteor-base@1.5.1 ddp-common@1.4.0 webapp@1.13.5 -mongo@1.16.6 +mongo@1.16.7 reload@1.3.1 service-configuration@1.3.1 diff --git a/apps/meteor/.meteor/release b/apps/meteor/.meteor/release index e8cfc7ec4c01..6641d0478a10 100644 --- a/apps/meteor/.meteor/release +++ b/apps/meteor/.meteor/release @@ -1 +1 @@ -METEOR@2.12 +METEOR@2.13.3 diff --git a/apps/meteor/.meteor/versions b/apps/meteor/.meteor/versions index 5e394526000d..5949c2258e3b 100644 --- a/apps/meteor/.meteor/versions +++ b/apps/meteor/.meteor/versions @@ -22,7 +22,7 @@ ddp@1.4.1 ddp-client@2.6.1 ddp-common@1.4.0 ddp-rate-limiter@1.2.0 -ddp-server@2.6.1 +ddp-server@2.6.2 diff-sequence@1.1.2 dispatch:run-as-user@1.1.1 dynamic-import@0.7.3 @@ -38,7 +38,7 @@ facts-base@1.0.1 fetch@0.1.3 geojson-utils@1.0.11 github-oauth@1.4.1 -google-oauth@1.4.3 +google-oauth@1.4.4 hot-code-push@1.0.4 http@2.0.0 id-map@1.1.1 @@ -47,7 +47,7 @@ jquery@3.0.0 kadira:flow-router@2.12.1 localstorage@1.2.0 logging@1.3.2 -meteor@1.11.2 +meteor@1.11.3 meteor-base@1.5.1 meteor-developer-oauth@1.3.2 meteorhacks:inject-initial@1.0.5 @@ -57,7 +57,7 @@ minimongo@1.9.3 modern-browsers@0.1.9 modules@0.19.0 modules-runtime@0.13.1 -mongo@1.16.6 +mongo@1.16.7 mongo-decimal@0.1.3 mongo-dev-server@1.1.0 mongo-id@1.0.8 @@ -94,7 +94,7 @@ socket-stream-client@0.5.1 standard-minifier-css@1.9.2 standard-minifier-js@2.8.1 tracker@1.3.2 -twitter-oauth@1.3.2 +twitter-oauth@1.3.3 typescript@4.9.4 underscore@1.0.13 url@1.3.2 From 96c268dd7e7bdacae8a3e94fe92e7871562a1f1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Jaeger=20Foresti?= <60678893+juliajforesti@users.noreply.github.com> Date: Thu, 21 Sep 2023 21:34:23 -0300 Subject: [PATCH 184/275] chore: add tooltip to mentions (#30445) Co-authored-by: Guilherme Gazzo <5263975+ggazzo@users.noreply.github.com> --- .../packages/rocketchat-i18n/i18n/en.i18n.json | 6 ++++++ packages/gazzodown/src/elements/PlainSpan.tsx | 6 ++++-- .../src/mentions/ChannelMentionElement.tsx | 4 +++- .../src/mentions/UserMentionElement.tsx | 16 +++++++++++++--- packages/password-policies/tsconfig.json | 3 ++- 5 files changed, 28 insertions(+), 7 deletions(-) diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index a03d4a3d6af1..197d38d603f0 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -3320,6 +3320,11 @@ "Members_List": "Members List", "mention-all": "Mention All", "mention-all_description": "Permission to use the @all mention", + "Mentions_all_room_members": "Mentions all room members", + "Mentions_online_room_members": "Mentions online room members", + "Mentions_user": "Mentions user", + "Mentions_channel": "Mentions channel", + "Mentions_you": "Mentions you", "mention-here": "Mention Here", "mention-here_description": "Permission to use the @here mention", "Mentions": "Mentions", @@ -5933,6 +5938,7 @@ "Theme_match_system_description": "Automatically match the appearance of your system.", "Theme_high_contrast": "High contrast", "Theme_high_contrast_description": "Maximum tonal differentiation with bold colors and sharp contrasts provide enhanced accessibility.", + "Highlighted_chosen_word": "Highlighted chosen word", "High_contrast_upsell_title": "Enable high contrast theme", "High_contrast_upsell_subtitle": "Enhance your team’s reading experience", "High_contrast_upsell_description": "Especially designed for individuals with visual impairments or conditions such as color vision deficiency, low vision, or sensitivity to low contrast.\n\nThis theme increases contrast between text and background elements, making content more distinguishable and easier to read.", diff --git a/packages/gazzodown/src/elements/PlainSpan.tsx b/packages/gazzodown/src/elements/PlainSpan.tsx index 988ab94ca038..582490207717 100644 --- a/packages/gazzodown/src/elements/PlainSpan.tsx +++ b/packages/gazzodown/src/elements/PlainSpan.tsx @@ -1,3 +1,4 @@ +import { useTranslation } from '@rocket.chat/ui-contexts'; import { Fragment, memo, ReactElement, useContext, useMemo } from 'react'; import { MarkupInteractionContext } from '../MarkupInteractionContext'; @@ -7,6 +8,7 @@ type PlainSpanProps = { }; const PlainSpan = ({ text }: PlainSpanProps): ReactElement => { + const t = useTranslation(); const { highlightRegex, markRegex } = useContext(MarkupInteractionContext); const content = useMemo(() => { @@ -20,7 +22,7 @@ const PlainSpan = ({ text }: PlainSpanProps): ReactElement => { {chunks.map((chunk, i) => { if (i % 2 === 0) { return ( - + {chunk} ); @@ -51,7 +53,7 @@ const PlainSpan = ({ text }: PlainSpanProps): ReactElement => { } return text; - }, [text, highlightRegex, markRegex]); + }, [highlightRegex, markRegex, text, t]); return <>{content}; }; diff --git a/packages/gazzodown/src/mentions/ChannelMentionElement.tsx b/packages/gazzodown/src/mentions/ChannelMentionElement.tsx index 2c3129bbc639..c1a6c7a17fe4 100644 --- a/packages/gazzodown/src/mentions/ChannelMentionElement.tsx +++ b/packages/gazzodown/src/mentions/ChannelMentionElement.tsx @@ -1,4 +1,5 @@ import { Message } from '@rocket.chat/fuselage'; +import { useTranslation } from '@rocket.chat/ui-contexts'; import { memo, ReactElement, useContext, useMemo } from 'react'; import { MarkupInteractionContext } from '../MarkupInteractionContext'; @@ -10,6 +11,7 @@ type ChannelMentionElementProps = { const handleChannelMention = (mention: string, withSymbol: boolean | undefined): string => (withSymbol ? `#${mention}` : mention); const ChannelMentionElement = ({ mention }: ChannelMentionElementProps): ReactElement => { + const t = useTranslation(); const { resolveChannelMention, onChannelMentionClick, showMentionSymbol } = useContext(MarkupInteractionContext); const resolved = useMemo(() => resolveChannelMention?.(mention), [mention, resolveChannelMention]); @@ -20,7 +22,7 @@ const ChannelMentionElement = ({ mention }: ChannelMentionElementProps): ReactEl } return ( - + {handleChannelMention(resolved.name ?? mention, showMentionSymbol)} ); diff --git a/packages/gazzodown/src/mentions/UserMentionElement.tsx b/packages/gazzodown/src/mentions/UserMentionElement.tsx index 8ad646ea8fd8..308363309aa2 100644 --- a/packages/gazzodown/src/mentions/UserMentionElement.tsx +++ b/packages/gazzodown/src/mentions/UserMentionElement.tsx @@ -1,4 +1,5 @@ import { Message } from '@rocket.chat/fuselage'; +import { useTranslation } from '@rocket.chat/ui-contexts'; import { memo, ReactElement, useContext, useMemo } from 'react'; import { MarkupInteractionContext } from '../MarkupInteractionContext'; @@ -11,6 +12,7 @@ const handleUserMention = (mention: string | undefined, withSymbol: boolean | un withSymbol ? `@${mention}` : mention; const UserMentionElement = ({ mention }: UserMentionElementProps): ReactElement => { + const t = useTranslation(); const { resolveUserMention, onUserMentionClick, isMobile, ownUserId, useRealName, showMentionSymbol } = useContext(MarkupInteractionContext); @@ -20,11 +22,19 @@ const UserMentionElement = ({ mention }: UserMentionElementProps): ReactElement const showRealName = useRealName && !isMobile; if (mention === 'all') { - return {handleUserMention('all', showMentionSymbol)}; + return ( + + {handleUserMention('all', showMentionSymbol)} + + ); } if (mention === 'here') { - return {handleUserMention('here', showMentionSymbol)}; + return ( + + {handleUserMention('here', showMentionSymbol)} + + ); } if (!resolved) { @@ -34,7 +44,7 @@ const UserMentionElement = ({ mention }: UserMentionElementProps): ReactElement return ( Date: Fri, 22 Sep 2023 13:25:59 -0300 Subject: [PATCH 185/275] regression: Videoconf message actions (#30456) --- .../app/ui-utils/client/lib/messageActionDefault.ts | 10 +++++----- apps/meteor/ee/client/startup/readReceipt.ts | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/meteor/app/ui-utils/client/lib/messageActionDefault.ts b/apps/meteor/app/ui-utils/client/lib/messageActionDefault.ts index 5618442ee6da..5807673188e5 100644 --- a/apps/meteor/app/ui-utils/client/lib/messageActionDefault.ts +++ b/apps/meteor/app/ui-utils/client/lib/messageActionDefault.ts @@ -29,7 +29,7 @@ Meteor.startup(async () => { id: 'reply-directly', icon: 'reply-directly', label: 'Reply_in_direct_message', - context: ['message', 'message-mobile', 'threads', 'federated', 'videoconf', 'videoconf-threads'], + context: ['message', 'message-mobile', 'threads', 'federated'], role: 'link', type: 'communication', action(_, props) { @@ -122,7 +122,7 @@ Meteor.startup(async () => { icon: 'permalink', label: 'Copy_link', // classes: 'clipboard', - context: ['message', 'message-mobile', 'threads', 'federated'], + context: ['message', 'message-mobile', 'threads', 'federated', 'videoconf', 'videoconf-threads'], type: 'duplication', async action(_, props) { try { @@ -208,7 +208,7 @@ Meteor.startup(async () => { id: 'delete-message', icon: 'trash', label: 'Delete', - context: ['message', 'message-mobile', 'threads', 'federated'], + context: ['message', 'message-mobile', 'threads', 'federated', 'videoconf', 'videoconf-threads'], color: 'alert', type: 'management', async action(this: unknown, _, { message = messageArgs(this).msg, chat }) { @@ -236,7 +236,7 @@ Meteor.startup(async () => { id: 'report-message', icon: 'report', label: 'Report', - context: ['message', 'message-mobile', 'threads', 'federated'], + context: ['message', 'message-mobile', 'threads', 'federated', 'videoconf', 'videoconf-threads'], color: 'alert', type: 'management', action(this: unknown, _, { message = messageArgs(this).msg }) { @@ -264,7 +264,7 @@ Meteor.startup(async () => { id: 'reaction-list', icon: 'emoji', label: 'Reactions', - context: ['message', 'message-mobile', 'threads'], + context: ['message', 'message-mobile', 'threads', 'videoconf', 'videoconf-threads'], type: 'interaction', action(this: unknown, _, { message: { reactions = {} } = messageArgs(this).msg }) { imperativeModal.open({ diff --git a/apps/meteor/ee/client/startup/readReceipt.ts b/apps/meteor/ee/client/startup/readReceipt.ts index 0efc779a3b49..938cc4b6133f 100644 --- a/apps/meteor/ee/client/startup/readReceipt.ts +++ b/apps/meteor/ee/client/startup/readReceipt.ts @@ -19,7 +19,7 @@ Meteor.startup(() => { id: 'receipt-detail', icon: 'info-circled', label: 'Info', - context: ['starred', 'message', 'message-mobile', 'threads'], + context: ['starred', 'message', 'message-mobile', 'threads', 'videoconf', 'videoconf-threads'], type: 'duplication', action(_, props) { const { message = messageArgs(this).msg } = props; From c714962b0e2f83175379e24abe83d01a01e071bd Mon Sep 17 00:00:00 2001 From: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com> Date: Fri, 22 Sep 2023 14:43:45 -0300 Subject: [PATCH 186/275] fix: Message disappears from room after deletion even if "Show Deleted Status" is enabled (#30452) --- .changeset/kind-books-love.md | 5 +++++ apps/meteor/client/lib/chats/data.ts | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .changeset/kind-books-love.md diff --git a/.changeset/kind-books-love.md b/.changeset/kind-books-love.md new file mode 100644 index 000000000000..40ce15453ff4 --- /dev/null +++ b/.changeset/kind-books-love.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed message disappearing from room after erased even if "Show Deleted Status" is enabled diff --git a/apps/meteor/client/lib/chats/data.ts b/apps/meteor/client/lib/chats/data.ts index bd6e01458863..f2c049ad04b1 100644 --- a/apps/meteor/client/lib/chats/data.ts +++ b/apps/meteor/client/lib/chats/data.ts @@ -217,7 +217,6 @@ export const createDataAPI = ({ rid, tmid }: { rid: IRoom['_id']; tmid: IMessage const deleteMessage = async (mid: IMessage['_id']): Promise => { await sdk.call('deleteMessage', { _id: mid }); - Messages.remove({ _id: mid }); }; const drafts = new Map(); From 2a4213ac770f956b3682a463d7b116250cbcc9bd Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Mon, 25 Sep 2023 10:25:16 -0300 Subject: [PATCH 187/275] regression: multiselect (#30472) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Henrique Guimarães Ribeiro <43561537+rique223@users.noreply.github.com> --- .../views/admin/rooms/RoomsTableFilters.tsx | 28 +++++++++++++------ .../MultiSelectCustom/MultiSelectCustom.tsx | 21 +++----------- .../MultiSelectCustomList.tsx | 15 ++++------ 3 files changed, 29 insertions(+), 35 deletions(-) diff --git a/apps/meteor/client/views/admin/rooms/RoomsTableFilters.tsx b/apps/meteor/client/views/admin/rooms/RoomsTableFilters.tsx index dede0b34b918..fcdaa29c9dff 100644 --- a/apps/meteor/client/views/admin/rooms/RoomsTableFilters.tsx +++ b/apps/meteor/client/views/admin/rooms/RoomsTableFilters.tsx @@ -2,7 +2,7 @@ import { Box, Icon, TextInput } from '@rocket.chat/fuselage'; import type { OptionProp } from '@rocket.chat/ui-client'; import { MultiSelectCustom } from '@rocket.chat/ui-client'; import { useTranslation } from '@rocket.chat/ui-contexts'; -import React, { useCallback, useEffect, useState } from 'react'; +import React, { useCallback, useState } from 'react'; import type { Dispatch, ReactElement, SetStateAction } from 'react'; const roomTypeFilterStructure = [ @@ -46,14 +46,25 @@ const roomTypeFilterStructure = [ const RoomsTableFilters = ({ setFilters }: { setFilters: Dispatch> }): ReactElement => { const t = useTranslation(); const [text, setText] = useState(''); - const [roomTypeOptions, setRoomTypeOptions] = useState(roomTypeFilterStructure); + const [roomTypeSelectedOptions, setRoomTypeSelectedOptions] = useState([]); - useEffect(() => { - return setFilters({ searchText: text, types: roomTypeSelectedOptions }); - }, [setFilters, roomTypeSelectedOptions, text]); + const handleSearchTextChange = useCallback( + (event) => { + const text = event.currentTarget.value; + setFilters({ searchText: text, types: roomTypeSelectedOptions }); + setText(text); + }, + [roomTypeSelectedOptions, setFilters], + ); - const handleSearchTextChange = useCallback((event) => setText(event.currentTarget.value), []); + const handleRoomTypeChange = useCallback( + (options: OptionProp[]) => { + setFilters({ searchText: text, types: options }); + setRoomTypeSelectedOptions(options); + }, + [text, setFilters], + ) as Dispatch>; return ( diff --git a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsx b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsx index 1420a62346d6..6c5e12be8622 100644 --- a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsx +++ b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustom.tsx @@ -57,7 +57,6 @@ type DropDownProps = { selectedOptionsTitle: TranslationKey; selectedOptions: OptionProp[]; setSelectedOptions: Dispatch>; - customSetSelected: Dispatch>; searchBarText?: TranslationKey; }; @@ -67,7 +66,6 @@ export const MultiSelectCustom = ({ selectedOptionsTitle, selectedOptions, setSelectedOptions, - customSetSelected, searchBarText, }: DropDownProps): ReactElement => { const reference = useRef(null); @@ -90,26 +88,15 @@ export const MultiSelectCustom = ({ const onSelect = (item: OptionProp, e?: FormEvent): void => { e?.stopPropagation(); - item.checked = !item.checked; if (item.checked === true) { - // the user has enabled this option -> add it to the selected options setSelectedOptions([...new Set([...selectedOptions, item])]); - customSetSelected((prevItems) => { - const newItems = prevItems; - const toggledItem = newItems.find(({ id }) => id === item.id); - - if (toggledItem) { - toggledItem.checked = !toggledItem.checked; - } - - return [...prevItems]; - }); - } else { - // the user has disabled this option -> remove this from the selected options list - setSelectedOptions(selectedOptions.filter((option: OptionProp) => option.id !== item.id)); + return; } + + // the user has disabled this option -> remove this from the selected options list + setSelectedOptions(selectedOptions.filter((option: OptionProp) => option.id !== item.id)); }; const count = dropdownOptions.filter((option) => option.checked).length; diff --git a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomList.tsx b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomList.tsx index 7e6bfdb9fee1..d8f8d60d8096 100644 --- a/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomList.tsx +++ b/packages/ui-client/src/components/MultiSelectCustom/MultiSelectCustomList.tsx @@ -2,7 +2,7 @@ import { Box, CheckBox, Icon, Option, SearchInput, Tile } from '@rocket.chat/fus import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { FormEvent } from 'react'; -import { Fragment, useCallback, useEffect, useState } from 'react'; +import { Fragment, useCallback, useState } from 'react'; import type { OptionProp } from './MultiSelectCustom'; import { useFilteredOptions } from './useFilteredOptions'; @@ -19,13 +19,10 @@ const MultiSelectCustomList = ({ const t = useTranslation(); const [text, setText] = useState(''); - const handleChange = useCallback((event) => setText(event.currentTarget.value), []); - - const [optionSearch, setOptionSearch] = useState(''); - useEffect(() => setOptionSearch(text), [setOptionSearch, text]); + const handleChange = useCallback((event) => setText(event.currentTarget.value), []); - const filteredOptions = useFilteredOptions(optionSearch, options); + const filteredOptions = useFilteredOptions(text, options); return ( @@ -48,11 +45,11 @@ const MultiSelectCustomList = ({ {t(option.text as TranslationKey)} ) : ( -
{requiresPasswordConfirmation && ( - {t('registration.component.form.confirmPassword')} + + {t('registration.component.form.confirmPassword')} + { const { t } = useTranslation(); + const emailId = useUniqueId(); + const formLabelId = useUniqueId(); + const forgotPasswordFormRef = useRef(null); - const [sent, setSent] = useState(false); const { register, handleSubmit, formState: { errors, isSubmitting }, } = useForm<{ email: string; - }>(); + }>({ mode: 'onBlur' }); - const resetPassword = useSendForgotPassword(); + useEffect(() => { + if (forgotPasswordFormRef.current) { + forgotPasswordFormRef.current.focus(); + } + }, []); + + const { mutateAsync, isSuccess } = useSendForgotPassword(); return ( { - resetPassword({ email: data.email }); - setSent(true); + mutateAsync({ email: data.email }); })} > - {t('registration.component.resetPassword')} + {t('registration.component.resetPassword')} - {t('registration.component.form.email')} - + + {t('registration.component.form.email')} + + - - {errors.email && {errors.email.message || t('registration.component.form.requiredField')}} + + {errors.email && ( + + {errors.email.message} + + )} - {sent && ( + {isSuccess && ( - + {t('registration.page.resetPassword.sent')} @@ -69,7 +88,6 @@ export const ResetPasswordForm = ({ setLoginRoute }: { setLoginRoute: DispatchLo {t('registration.page.resetPassword.sendInstructions')} - { setLoginRoute('login'); diff --git a/packages/web-ui-registration/src/hooks/useSendForgotPassword.ts b/packages/web-ui-registration/src/hooks/useSendForgotPassword.ts index 5e14c164b6cf..0dcef2d04bf4 100644 --- a/packages/web-ui-registration/src/hooks/useSendForgotPassword.ts +++ b/packages/web-ui-registration/src/hooks/useSendForgotPassword.ts @@ -1,7 +1,10 @@ import { useEndpoint } from '@rocket.chat/ui-contexts'; +import { useMutation } from '@tanstack/react-query'; export const useSendForgotPassword = () => { - const forgot = useEndpoint('POST', '/v1/users.forgotPassword'); + const sendForgotPassword = useEndpoint('POST', '/v1/users.forgotPassword'); - return forgot; + return useMutation({ + mutationFn: sendForgotPassword, + }); }; From 12e66c01a41714f6999d63b809bd9f585b140711 Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Mon, 25 Sep 2023 12:28:50 -0300 Subject: [PATCH 190/275] chore: `ResetPasswordPage` a11y improvements (#30479) --- apps/meteor/tests/e2e/forgot-password.spec.ts | 11 +- apps/meteor/tests/e2e/page-objects/auth.ts | 5 + apps/meteor/tests/e2e/reset-password.spec.ts | 35 +++++ .../web-ui-registration/src/RegisterForm.tsx | 16 ++- .../src/ResetPassword/ResetPasswordPage.tsx | 129 +++++++++++------- 5 files changed, 140 insertions(+), 56 deletions(-) create mode 100644 apps/meteor/tests/e2e/reset-password.spec.ts diff --git a/apps/meteor/tests/e2e/forgot-password.spec.ts b/apps/meteor/tests/e2e/forgot-password.spec.ts index ee531d59cdfa..441944f5b227 100644 --- a/apps/meteor/tests/e2e/forgot-password.spec.ts +++ b/apps/meteor/tests/e2e/forgot-password.spec.ts @@ -2,7 +2,7 @@ import { Registration } from './page-objects'; import { test, expect } from './utils/test'; test.describe.parallel('Forgot Password', () => { - let poRegistration: Registration; + let poRegistration: Registration; test.beforeEach(async ({ page }) => { poRegistration = new Registration(page); @@ -11,7 +11,7 @@ test.describe.parallel('Forgot Password', () => { await poRegistration.btnForgotPassword.click(); }); - test('Email validation', async () => { + test('Send email to recover account', async () => { await test.step('expect trigger a validation error if no email is provided', async () => { await poRegistration.btnSendInstructions.click(); await expect(poRegistration.inputEmail).toBeInvalid(); @@ -31,11 +31,16 @@ test.describe.parallel('Forgot Password', () => { await expect(poRegistration.inputEmail).toBeInvalid(); }); - await test.step('expect to show a success toast if a valid email is provided', async () => { + await test.step('expect to show a success callout if a valid email is provided', async () => { await poRegistration.inputEmail.fill('mail@mail.com'); await poRegistration.btnSendInstructions.click(); await expect(poRegistration.forgotPasswordEmailCallout).toBeVisible(); }); }); + + test('should not have any accessibility violations', async ({ makeAxeBuilder }) => { + const results = await makeAxeBuilder().analyze(); + expect(results.violations).toEqual([]); + }) }); diff --git a/apps/meteor/tests/e2e/page-objects/auth.ts b/apps/meteor/tests/e2e/page-objects/auth.ts index b03e45ee22b7..9b47d2e44adc 100644 --- a/apps/meteor/tests/e2e/page-objects/auth.ts +++ b/apps/meteor/tests/e2e/page-objects/auth.ts @@ -11,6 +11,11 @@ export class Registration { return this.page.locator('role=button[name="Send instructions"]'); } + get btnReset(): Locator { + return this.page.locator('role=button[name="Reset"]'); + } + + get btnLogin(): Locator { return this.page.locator('role=button[name="Login"]'); } diff --git a/apps/meteor/tests/e2e/reset-password.spec.ts b/apps/meteor/tests/e2e/reset-password.spec.ts new file mode 100644 index 000000000000..fc5e0b703784 --- /dev/null +++ b/apps/meteor/tests/e2e/reset-password.spec.ts @@ -0,0 +1,35 @@ +import { Registration } from './page-objects'; +import { setSettingValueById } from './utils/setSettingValueById'; +import { test, expect } from './utils/test'; + +test.describe.parallel('Reset Password', () => { + let poRegistration: Registration; + + test.beforeEach(async ({ api, page }) => { + poRegistration = new Registration(page); + await setSettingValueById(api, 'Accounts_RequirePasswordConfirmation', true); + + await page.goto('/reset-password/someToken'); + }); + + test.afterAll(async ({ api }) => { + await setSettingValueById(api, 'Accounts_RequirePasswordConfirmation', true); + }) + + test('should confirm password be invalid', async () => { + await poRegistration.inputPassword.fill('123456'); + await poRegistration.inputPasswordConfirm.fill('123455'); + await poRegistration.btnReset.click(); + await expect(poRegistration.inputPasswordConfirm).toBeInvalid(); + }); + + test('should confirm password not be visible', async ({ api }) => { + await setSettingValueById(api, 'Accounts_RequirePasswordConfirmation', false); + await expect(poRegistration.inputPasswordConfirm).not.toBeVisible(); + }) + + test('should not have any accessibility violations', async ({ makeAxeBuilder }) => { + const results = await makeAxeBuilder().analyze(); + expect(results.violations).toEqual([]); + }) +}); diff --git a/packages/web-ui-registration/src/RegisterForm.tsx b/packages/web-ui-registration/src/RegisterForm.tsx index 4400ddca5b02..6202916c87f2 100644 --- a/packages/web-ui-registration/src/RegisterForm.tsx +++ b/packages/web-ui-registration/src/RegisterForm.tsx @@ -129,9 +129,10 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo {errors.name && ( - {t('registration.component.form.requiredField')} + {errors.name.message} )} @@ -159,6 +160,7 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo })} placeholder={usernameOrEmailPlaceholder || t('registration.component.form.emailPlaceholder')} error={errors?.email?.message} + aria-required='true' aria-invalid={errors.email ? 'true' : 'false'} aria-describedby={`${emailId}-error`} id={emailId} @@ -180,6 +182,7 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo required: t('registration.component.form.requiredField'), })} error={errors?.username?.message} + aria-required='true' aria-invalid={errors.username ? 'true' : 'false'} aria-describedby={`${usernameId}-error`} id={usernameId} @@ -202,7 +205,8 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo required: t('registration.component.form.requiredField'), validate: () => (!passwordIsValid ? t('Password_must_meet_the_complexity_requirements') : true), })} - error={errors.password && (errors.password?.message || t('registration.component.form.requiredField'))} + error={errors.password?.message} + aria-required='true' aria-invalid={errors.password ? 'true' : undefined} id={passwordId} placeholder={passwordPlaceholder || t('Create_a_password')} @@ -229,6 +233,7 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo validate: (val: string) => (watch('password') === val ? true : t('registration.component.form.invalidConfirmPass')), })} error={errors.passwordConfirmation?.message} + aria-required='true' aria-invalid={errors.passwordConfirmation ? 'true' : 'false'} id={passwordConfirmationId} aria-describedby={`${passwordConfirmationId}-error`} @@ -254,6 +259,7 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo required: t('registration.component.form.requiredField'), })} error={errors?.reason?.message} + aria-required='true' aria-invalid={errors.reason ? 'true' : 'false'} aria-describedby={`${reasonId}-error`} id={reasonId} @@ -261,7 +267,7 @@ export const RegisterForm = ({ setLoginRoute }: { setLoginRoute: DispatchLoginRo {errors.reason && ( - {t('registration.component.form.requiredField')} + {errors.reason.message} )} diff --git a/packages/web-ui-registration/src/ResetPassword/ResetPasswordPage.tsx b/packages/web-ui-registration/src/ResetPassword/ResetPasswordPage.tsx index d3a3e6fa7413..19b0a13983bb 100644 --- a/packages/web-ui-registration/src/ResetPassword/ResetPasswordPage.tsx +++ b/packages/web-ui-registration/src/ResetPassword/ResetPasswordPage.tsx @@ -1,10 +1,11 @@ -import { Button, Field, Modal, PasswordInput } from '@rocket.chat/fuselage'; +import { Button, FieldGroup, Field, FieldLabel, ButtonGroup, PasswordInput, FieldRow, FieldError } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { Form } from '@rocket.chat/layout'; import { PasswordVerifier, useValidatePassword } from '@rocket.chat/ui-client'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useSetting, useRouter, useRouteParameter, useUser, useMethod, useTranslation, useLoginWithToken } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; +import { useEffect, useRef } from 'react'; import { useForm } from 'react-hook-form'; import HorizontalTemplate from '../template/HorizontalTemplate'; @@ -21,10 +22,15 @@ const ResetPasswordPage = (): ReactElement => { const resetPassword = useMethod('resetPassword'); const token = useRouteParameter('token'); + const resetPasswordFormRef = useRef(null); const passwordId = useUniqueId(); + const passwordConfirmationId = useUniqueId(); const passwordVerifierId = useUniqueId(); + const formLabelId = useUniqueId(); const requiresPasswordConfirmation = useSetting('Accounts_RequirePasswordConfirmation'); + const passwordPlaceholder = String(useSetting('Accounts_PasswordPlaceholder')); + const passwordConfirmationPlaceholder = String(useSetting('Accounts_ConfirmPasswordPlaceholder')); const router = useRouter(); @@ -36,7 +42,7 @@ const ResetPasswordPage = (): ReactElement => { register, handleSubmit, setError, - formState: { errors, isValid }, + formState: { errors, isSubmitting }, watch, } = useForm<{ password: string; @@ -48,76 +54,103 @@ const ResetPasswordPage = (): ReactElement => { const password = watch('password'); const passwordIsValid = useValidatePassword(password); - const submit = handleSubmit(async (data) => { + useEffect(() => { + if (resetPasswordFormRef.current) { + resetPasswordFormRef.current.focus(); + } + }, []); + + const handleResetPassword = async ({ password }: { password: string }) => { try { if (token) { - const result = await resetPassword(token, data.password); + const result = await resetPassword(token, password); await loginWithToken(result.token); router.navigate('/home'); } else { - await setUserPassword(data.password); + await setUserPassword(password); } } catch ({ error, reason }: any) { const _error = reason ?? error; setError('password', { message: String(_error) }); } - }); + }; return ( - + - {t('Reset_password')} + {t('Reset_password')} + {t(changePasswordReason)} - - {t(changePasswordReason)} - - (!passwordIsValid ? t('Password_must_meet_the_complexity_requirements') : true), - })} - error={errors.password?.message} - aria-invalid={errors.password ? 'true' : 'false'} - id={passwordId} - placeholder={t('Create_a_password')} - name='password' - autoComplete='off' - aria-describedby={passwordVerifierId} - /> - - {errors?.password && ( - - {errors.password.message} - - )} - - {requiresPasswordConfirmation && ( - + + + + {t('registration.component.form.password')} + + password === val, + {...register('password', { + required: t('registration.component.form.requiredField'), + validate: () => (!passwordIsValid ? t('Password_must_meet_the_complexity_requirements') : true), })} - error={errors.passwordConfirmation?.type === 'validate' ? t('registration.component.form.invalidConfirmPass') : undefined} - aria-invalid={errors.passwordConfirmation ? 'true' : false} - id='passwordConfirmation' - placeholder={t('Confirm_password')} - disabled={!passwordIsValid} + error={errors?.password?.message} + aria-invalid={errors.password ? 'true' : 'false'} + aria-required='true' + id={passwordId} + placeholder={passwordPlaceholder || t('Create_a_password')} + aria-describedby={`${passwordVerifierId} ${passwordId}-error`} /> - + + {errors?.password && ( + + {errors.password.message} + + )} + + + {requiresPasswordConfirmation && ( + + + {t('registration.component.form.confirmPassword')} + + + (password === val ? true : t('registration.component.form.invalidConfirmPass')), + })} + error={errors?.passwordConfirmation?.message} + aria-required='true' + aria-invalid={errors.passwordConfirmation ? 'true' : 'false'} + aria-describedby={`${passwordConfirmationId}-error`} + id={passwordConfirmationId} + placeholder={passwordConfirmationPlaceholder || t('Confirm_password')} + disabled={!passwordIsValid} + /> + + {errors.passwordConfirmation && ( + + {errors.passwordConfirmation?.message} + + )} + )} - {errors && {errors.password?.message}} - +
- - - + From 7e75bd875e43d5db4d615600a10c9e3b02be2e4e Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Mon, 25 Sep 2023 10:36:57 -0600 Subject: [PATCH 191/275] regression: Reports button visible when downgrading from EE to CE (#30394) Co-authored-by: Martin Schoeler <20868078+MartinSchoeler@users.noreply.github.com> --- apps/meteor/client/views/omnichannel/sidebarItems.ts | 6 ------ .../client/views/livechatSideNavItems.ts | 7 +++++++ .../ee/client/omnichannel/reports/ReportsPage.tsx | 11 ++++++++++- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/apps/meteor/client/views/omnichannel/sidebarItems.ts b/apps/meteor/client/views/omnichannel/sidebarItems.ts index 048bcb4ef88e..7942764a8b89 100644 --- a/apps/meteor/client/views/omnichannel/sidebarItems.ts +++ b/apps/meteor/client/views/omnichannel/sidebarItems.ts @@ -13,12 +13,6 @@ export const { i18nLabel: 'Current_Chats', permissionGranted: (): boolean => hasPermission('view-livechat-current-chats'), }, - { - href: '/omnichannel/reports', - icon: 'file', - i18nLabel: 'Reports', - permissionGranted: (): boolean => hasPermission('view-livechat-reports'), - }, { href: '/omnichannel/analytics', icon: 'dashboard', diff --git a/apps/meteor/ee/app/livechat-enterprise/client/views/livechatSideNavItems.ts b/apps/meteor/ee/app/livechat-enterprise/client/views/livechatSideNavItems.ts index 14f9f4b110c8..c89931208451 100644 --- a/apps/meteor/ee/app/livechat-enterprise/client/views/livechatSideNavItems.ts +++ b/apps/meteor/ee/app/livechat-enterprise/client/views/livechatSideNavItems.ts @@ -1,6 +1,13 @@ import { hasPermission, hasAtLeastOnePermission } from '../../../../../app/authorization/client'; import { registerOmnichannelSidebarItem } from '../../../../../client/views/omnichannel/sidebarItems'; +registerOmnichannelSidebarItem({ + href: '/omnichannel/reports', + icon: 'file', + i18nLabel: 'Reports', + permissionGranted: (): boolean => hasPermission('view-livechat-reports'), +}); + registerOmnichannelSidebarItem({ href: '/omnichannel/monitors', icon: 'shield-blank', diff --git a/apps/meteor/ee/client/omnichannel/reports/ReportsPage.tsx b/apps/meteor/ee/client/omnichannel/reports/ReportsPage.tsx index 3bbe82494bcc..147dff65ad97 100644 --- a/apps/meteor/ee/client/omnichannel/reports/ReportsPage.tsx +++ b/apps/meteor/ee/client/omnichannel/reports/ReportsPage.tsx @@ -1,14 +1,23 @@ import { Box } from '@rocket.chat/fuselage'; -import { useTranslation } from '@rocket.chat/ui-contexts'; +import { usePermission, useTranslation } from '@rocket.chat/ui-contexts'; import React from 'react'; import Page from '../../../../client/components/Page'; +import NotAuthorizedPage from '../../../../client/views/notAuthorized/NotAuthorizedPage'; +import { useHasLicenseModule } from '../../hooks/useHasLicenseModule'; import { ResizeObserver } from './components/ResizeObserver'; import { AgentsSection, ChannelsSection, DepartmentsSection, StatusSection, TagsSection } from './sections'; const ReportsPage = () => { const t = useTranslation(); + const hasPermission = usePermission('view-livechat-reports'); + const isEnterprise = useHasLicenseModule('livechat-enterprise'); + + if (!hasPermission || !isEnterprise) { + return ; + } + return ( From fcca326e4df9d084ff76591c4f11c73f7e83539a Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Mon, 25 Sep 2023 16:37:43 -0300 Subject: [PATCH 192/275] fix: selected options not being displayed on `PaginatedMultiSelect` (#30470) --- .../AutoCompleteDepartmentMultiple.tsx | 9 +++++++-- apps/meteor/ee/client/hooks/useTagsList.ts | 2 +- .../omnichannel/tags/AutoCompleteTagsMultiple.js | 16 +++++----------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/apps/meteor/client/components/AutoCompleteDepartmentMultiple.tsx b/apps/meteor/client/components/AutoCompleteDepartmentMultiple.tsx index 50d53da351bc..38aadf0a840b 100644 --- a/apps/meteor/client/components/AutoCompleteDepartmentMultiple.tsx +++ b/apps/meteor/client/components/AutoCompleteDepartmentMultiple.tsx @@ -17,7 +17,7 @@ type AutoCompleteDepartmentMultipleProps = { }; const AutoCompleteDepartmentMultiple = ({ - value, + value = [], onlyMyDepartments = false, showArchived = false, enabled = false, @@ -37,6 +37,11 @@ const AutoCompleteDepartmentMultiple = ({ const { phase: departmentsPhase, items: departmentsItems, itemCount: departmentsTotal } = useRecordList(departmentsList); + const departmentOptions = useMemo(() => { + const pending = value.filter(({ value }) => !departmentsItems.find((dep) => dep.value === value)) || []; + return [...departmentsItems, ...pending]; + }, [departmentsItems, value]); + return ( { count: end + start, ...(viewAll && { viewAll: 'true' }), ...(department && { department }), + sort: JSON.stringify({ name: 1 }), }); return { @@ -45,7 +46,6 @@ export const useTagsList = (options: TagsListOptions): UseTagsListResult => { _id: tag._id, label: tag.name, value: tag.name, - _updatedAt: new Date(tag._updatedAt), })), itemCount: total, }; diff --git a/apps/meteor/ee/client/omnichannel/tags/AutoCompleteTagsMultiple.js b/apps/meteor/ee/client/omnichannel/tags/AutoCompleteTagsMultiple.js index 086d796152fc..db48060ff546 100644 --- a/apps/meteor/ee/client/omnichannel/tags/AutoCompleteTagsMultiple.js +++ b/apps/meteor/ee/client/omnichannel/tags/AutoCompleteTagsMultiple.js @@ -24,16 +24,10 @@ const AutoCompleteTagMultiple = (props) => { const { phase: tagsPhase, items: tagsItems, itemCount: tagsTotal } = useRecordList(tagsList); - const sortedByName = tagsItems.sort((a, b) => { - if (a.name > b.name) { - return 1; - } - if (a.name < b.name) { - return -1; - } - - return 0; - }); + const tagsOptions = useMemo(() => { + const pending = value.filter(({ value }) => !tagsItems.find((tag) => tag.value === value)); + return [...tagsItems, ...pending]; + }, [tagsItems, value]); return ( { onChange={onChange} filter={tagsFilter} setFilter={setTagsFilter} - options={sortedByName} + options={tagsOptions} width='100%' flexShrink={0} flexGrow={0} From defc4b39cb742928e22b2c47f540aef444c73a2e Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Tue, 26 Sep 2023 10:25:54 -0300 Subject: [PATCH 193/275] fix: Microsoft autotranslate not working (#30390) --- apps/meteor/app/autotranslate/server/msTranslate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/app/autotranslate/server/msTranslate.ts b/apps/meteor/app/autotranslate/server/msTranslate.ts index 3e9c9dbd8a35..f885a23b8e6b 100644 --- a/apps/meteor/app/autotranslate/server/msTranslate.ts +++ b/apps/meteor/app/autotranslate/server/msTranslate.ts @@ -87,7 +87,7 @@ class MsAutoTranslate extends AutoTranslate { if (this.supportedLanguages[target]) { return this.supportedLanguages[target]; } - const request = await fetch(this.apiEndPointUrl); + const request = await fetch(this.apiGetLanguages); if (!request.ok) { throw new Error(request.statusText); } From cfd841dee71206672bd0de96a4e86d784cc4eb21 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Tue, 26 Sep 2023 10:33:43 -0300 Subject: [PATCH 194/275] regression: livechat uiKit actions not working (#30484) --- packages/livechat/src/lib/random.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/livechat/src/lib/random.ts b/packages/livechat/src/lib/random.ts index 705fdcacc7da..068c84c1c459 100644 --- a/packages/livechat/src/lib/random.ts +++ b/packages/livechat/src/lib/random.ts @@ -4,6 +4,6 @@ export const chooseElement = Random.choice; export const createRandomString = Random._randomString; -export const createRandomId = Random.id; +export const createRandomId = () => Random.id(); export const createToken = () => Random.hexString(64); From a54a9a7e012d2455da5584ae39ba5268cb29f579 Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Tue, 26 Sep 2023 13:56:53 -0300 Subject: [PATCH 195/275] fix: Lazy loading not working on 'Forward to department' field (#30489) --- .../client/components/Omnichannel/modals/ForwardChatModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx b/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx index 82c92d39cc8f..732556335c7f 100644 --- a/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx +++ b/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx @@ -66,7 +66,7 @@ const ForwardChatModal = ({ const endReached = useCallback( (start) => { - if (departmentsPhase === AsyncStatePhase.LOADING) { + if (departmentsPhase !== AsyncStatePhase.LOADING) { loadMoreDepartments(start, Math.min(50, departmentsTotal)); } }, From 8a02759e40bf7c9aba55fc17baf87257a203a8cd Mon Sep 17 00:00:00 2001 From: Marcos Spessatto Defendi Date: Tue, 26 Sep 2023 19:13:25 -0300 Subject: [PATCH 196/275] fix: do not broadcast events from the local node to the local service (duplicated event) (#30446) --- .changeset/brave-snakes-scream.md | 5 +++++ apps/meteor/ee/server/local-services/instance/service.ts | 6 ++++++ 2 files changed, 11 insertions(+) create mode 100644 .changeset/brave-snakes-scream.md diff --git a/.changeset/brave-snakes-scream.md b/.changeset/brave-snakes-scream.md new file mode 100644 index 000000000000..914f248cd821 --- /dev/null +++ b/.changeset/brave-snakes-scream.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Fixed an issue where broadcasted events were published twice within the same instance diff --git a/apps/meteor/ee/server/local-services/instance/service.ts b/apps/meteor/ee/server/local-services/instance/service.ts index 0fc4fd33a9b1..85c021f74769 100644 --- a/apps/meteor/ee/server/local-services/instance/service.ts +++ b/apps/meteor/ee/server/local-services/instance/service.ts @@ -96,6 +96,12 @@ export class InstanceService extends ServiceClassInternal implements IInstanceSe events: { broadcast(ctx: any) { const { eventName, streamName, args } = ctx.params; + const { nodeID } = ctx; + + const fromLocalNode = nodeID === InstanceStatus.id(); + if (fromLocalNode) { + return; + } const instance = StreamerCentral.instances[streamName]; if (!instance) { From 92613680b7ea8fbd60983476a632e6b48f4f8204 Mon Sep 17 00:00:00 2001 From: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com> Date: Tue, 26 Sep 2023 20:05:21 -0300 Subject: [PATCH 197/275] feat: use isolated-vm to run integration scripts (#30229) Co-authored-by: Marcos Spessatto Defendi Co-authored-by: Tasso Evangelista --- .changeset/thirty-pumpkins-fix.md | 8 + apps/meteor/.docker/Dockerfile.alpine | 5 + .../meteor/app/integrations/server/api/api.js | 155 +----- .../integrations/server/lib/ScriptEngine.ts | 385 +++++++++++++++ .../app/integrations/server/lib/definition.ts | 19 + .../server/lib/isolated-vm/buildSandbox.ts | 127 +++++ .../lib/isolated-vm/getCompatibilityScript.ts | 60 +++ .../server/lib/isolated-vm/isolated-vm.ts | 99 ++++ .../integrations/server/lib/triggerHandler.js | 448 +++--------------- .../integrations/server/lib/updateHistory.ts | 96 ++++ .../server/lib/validateOutgoingIntegration.ts | 16 +- .../server/lib/validateScriptEngine.ts | 26 + .../server/lib/vm2/buildSandbox.ts | 88 ++++ .../app/integrations/server/lib/vm2/vm2.ts | 111 +++++ .../incoming/addIncomingIntegration.ts | 17 +- .../incoming/updateIncomingIntegration.ts | 26 +- .../outgoing/addOutgoingIntegration.ts | 8 +- .../outgoing/updateOutgoingIntegration.ts | 22 +- .../admin/integrations/IncomingWebhookForm.js | 26 +- .../integrations/OutgoiongWebhookForm.js | 21 + .../integrations/edit/EditIncomingWebhook.js | 1 + .../integrations/edit/EditOutgoingWebhook.js | 1 + .../integrations/new/NewIncomingWebhook.js | 1 + .../integrations/new/NewOutgoingWebhook.js | 1 + apps/meteor/package.json | 1 + .../rocketchat-i18n/i18n/en.i18n.json | 6 + packages/core-typings/src/IIntegration.ts | 6 + .../core-typings/src/IIntegrationHistory.ts | 7 +- .../integrations/IntegrationsCreateProps.ts | 12 +- packages/tools/src/index.ts | 1 + packages/tools/src/wrapExceptions.ts | 46 ++ yarn.lock | 10 + 32 files changed, 1306 insertions(+), 550 deletions(-) create mode 100644 .changeset/thirty-pumpkins-fix.md create mode 100644 apps/meteor/app/integrations/server/lib/ScriptEngine.ts create mode 100644 apps/meteor/app/integrations/server/lib/definition.ts create mode 100644 apps/meteor/app/integrations/server/lib/isolated-vm/buildSandbox.ts create mode 100644 apps/meteor/app/integrations/server/lib/isolated-vm/getCompatibilityScript.ts create mode 100644 apps/meteor/app/integrations/server/lib/isolated-vm/isolated-vm.ts create mode 100644 apps/meteor/app/integrations/server/lib/updateHistory.ts create mode 100644 apps/meteor/app/integrations/server/lib/validateScriptEngine.ts create mode 100644 apps/meteor/app/integrations/server/lib/vm2/buildSandbox.ts create mode 100644 apps/meteor/app/integrations/server/lib/vm2/vm2.ts create mode 100644 packages/tools/src/wrapExceptions.ts diff --git a/.changeset/thirty-pumpkins-fix.md b/.changeset/thirty-pumpkins-fix.md new file mode 100644 index 000000000000..11b92b064e15 --- /dev/null +++ b/.changeset/thirty-pumpkins-fix.md @@ -0,0 +1,8 @@ +--- +'@rocket.chat/core-typings': minor +'@rocket.chat/rest-typings': minor +'@rocket.chat/tools': minor +'@rocket.chat/meteor': minor +--- + +Added option to select between two script engine options for the integrations diff --git a/apps/meteor/.docker/Dockerfile.alpine b/apps/meteor/.docker/Dockerfile.alpine index 62a0476d9077..003baa57aa8b 100644 --- a/apps/meteor/.docker/Dockerfile.alpine +++ b/apps/meteor/.docker/Dockerfile.alpine @@ -15,6 +15,11 @@ RUN set -x \ && npm install sharp@0.30.4 \ && mv node_modules/sharp npm/node_modules/sharp \ # End hack for sharp + # Start hack for isolated-vm... + && rm -rf npm/node_modules/isolated-vm \ + && npm install isolated-vm@4.4.2 \ + && mv node_modules/isolated-vm npm/node_modules/isolated-vm \ + # End hack for isolated-vm && cd npm \ && npm rebuild bcrypt --build-from-source \ && npm cache clear --force \ diff --git a/apps/meteor/app/integrations/server/api/api.js b/apps/meteor/app/integrations/server/api/api.js index e1db46729011..5162fa54ad9c 100644 --- a/apps/meteor/app/integrations/server/api/api.js +++ b/apps/meteor/app/integrations/server/api/api.js @@ -1,114 +1,21 @@ import { Integrations, Users } from '@rocket.chat/models'; -import * as Models from '@rocket.chat/models'; import { Random } from '@rocket.chat/random'; -import { Livechat } from 'meteor/rocketchat:livechat'; -import moment from 'moment'; import _ from 'underscore'; -import { VM, VMScript } from 'vm2'; -import * as s from '../../../../lib/utils/stringUtils'; -import { deasyncPromise } from '../../../../server/deasync/deasync'; -import { httpCall } from '../../../../server/lib/http/call'; import { API, APIClass, defaultRateLimiterOptions } from '../../../api/server'; import { processWebhookMessage } from '../../../lib/server/functions/processWebhookMessage'; import { settings } from '../../../settings/server'; +import { IsolatedVMScriptEngine } from '../lib/isolated-vm/isolated-vm'; +import { VM2ScriptEngine } from '../lib/vm2/vm2'; import { incomingLogger } from '../logger'; import { addOutgoingIntegration } from '../methods/outgoing/addOutgoingIntegration'; import { deleteOutgoingIntegration } from '../methods/outgoing/deleteOutgoingIntegration'; -const DISABLE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.DISABLE_INTEGRATION_SCRIPTS).toLowerCase()); +const vm2Engine = new VM2ScriptEngine(true); +const ivmEngine = new IsolatedVMScriptEngine(true); -export const forbiddenModelMethods = ['registerModel', 'getCollectionName']; - -const compiledScripts = {}; -function buildSandbox(store = {}) { - const httpAsync = async (method, url, options) => { - try { - return { - result: await httpCall(method, url, options), - }; - } catch (error) { - return { error }; - } - }; - - const sandbox = { - scriptTimeout(reject) { - return setTimeout(() => reject('timed out'), 3000); - }, - _, - s, - console, - moment, - Promise, - Livechat, - Store: { - set(key, val) { - store[key] = val; - return val; - }, - get(key) { - return store[key]; - }, - }, - HTTP: (method, url, options) => { - // TODO: deprecate, track and alert - return deasyncPromise(httpAsync(method, url, options)); - }, - // TODO: Export fetch as the non deprecated method - }; - Object.keys(Models) - .filter((k) => !forbiddenModelMethods.includes(k)) - .forEach((k) => { - sandbox[k] = Models[k]; - }); - return { store, sandbox }; -} - -function getIntegrationScript(integration) { - if (DISABLE_INTEGRATION_SCRIPTS) { - throw API.v1.failure('integration-scripts-disabled'); - } - - const compiledScript = compiledScripts[integration._id]; - if (compiledScript && +compiledScript._updatedAt === +integration._updatedAt) { - return compiledScript.script; - } - - const script = integration.scriptCompiled; - const { sandbox, store } = buildSandbox(); - try { - incomingLogger.info({ msg: 'Will evaluate script of Trigger', integration: integration.name }); - incomingLogger.debug(script); - - const vmScript = new VMScript(`${script}; Script;`, 'script.js'); - const vm = new VM({ - sandbox, - }); - - const ScriptClass = vm.run(vmScript); - - if (ScriptClass) { - compiledScripts[integration._id] = { - script: new ScriptClass(), - store, - _updatedAt: integration._updatedAt, - }; - - return compiledScripts[integration._id].script; - } - } catch (err) { - incomingLogger.error({ - msg: 'Error evaluating Script in Trigger', - integration: integration.name, - script, - err, - }); - throw API.v1.failure('error-evaluating-script'); - } - - incomingLogger.error({ msg: 'Class "Script" not in Trigger', integration: integration.name }); - throw API.v1.failure('class-script-not-found'); +function getEngine(integration) { + return integration.scriptEngine === 'isolated-vm' ? ivmEngine : vm2Engine; } async function createIntegration(options, user) { @@ -178,20 +85,9 @@ async function executeIntegrationRest() { emoji: this.integration.emoji, }; - if ( - !DISABLE_INTEGRATION_SCRIPTS && - this.integration.scriptEnabled && - this.integration.scriptCompiled && - this.integration.scriptCompiled.trim() !== '' - ) { - let script; - try { - script = getIntegrationScript(this.integration); - } catch (e) { - incomingLogger.error(e); - return API.v1.failure(e.message); - } + const scriptEngine = getEngine(this.integration); + if (scriptEngine.integrationHasValidScript(this.integration)) { this.request.setEncoding('utf8'); const content_raw = this.request.read(); @@ -216,37 +112,12 @@ async function executeIntegrationRest() { }, }; - try { - const { sandbox } = buildSandbox(compiledScripts[this.integration._id].store); - sandbox.script = script; - sandbox.request = request; - - const vm = new VM({ - timeout: 3000, - sandbox, - }); - - const result = await new Promise((resolve, reject) => { - process.nextTick(async () => { - try { - const scriptResult = await vm.run(` - new Promise((resolve, reject) => { - scriptTimeout(reject); - try { - resolve(script.process_incoming_request({ request: request })); - } catch(e) { - reject(e); - } - }).catch((error) => { throw new Error(error); }); - `); - - resolve(scriptResult); - } catch (e) { - reject(e); - } - }); - }); + const result = await scriptEngine.processIncomingRequest({ + integration: this.integration, + request, + }); + try { if (!result) { incomingLogger.debug({ msg: 'Process Incoming Request result of Trigger has no data', diff --git a/apps/meteor/app/integrations/server/lib/ScriptEngine.ts b/apps/meteor/app/integrations/server/lib/ScriptEngine.ts new file mode 100644 index 000000000000..e46984a893ef --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/ScriptEngine.ts @@ -0,0 +1,385 @@ +import type { + IUser, + IRoom, + IMessage, + IOutgoingIntegration, + IIncomingIntegration, + IIntegration, + IIntegrationHistory, +} from '@rocket.chat/core-typings'; +import type { Logger } from '@rocket.chat/logger'; +import type { serverFetch } from '@rocket.chat/server-fetch'; +import { wrapExceptions } from '@rocket.chat/tools'; + +import { incomingLogger, outgoingLogger } from '../logger'; +import type { IScriptClass, CompiledScript } from './definition'; +import { updateHistory } from './updateHistory'; + +type OutgoingRequestBaseData = { + token: IOutgoingIntegration['token']; + bot: false; + trigger_word: string; +}; + +type OutgoingRequestSendMessageData = OutgoingRequestBaseData & { + channel_id: string; + channel_name: string; + message_id: string; + timestamp: Date; + user_id: string; + user_name: string; + text: string; + siteUrl: string; + alias?: string; + bot?: boolean; + isEdited?: true; + tmid?: string; +}; + +type OutgoingRequestUploadedFileData = OutgoingRequestBaseData & { + channel_id: string; + channel_name: string; + message_id: string; + timestamp: Date; + user_id: string; + user_name: string; + text: string; + + user: IUser; + room: IRoom; + message: IMessage; + + alias?: string; + bot?: boolean; +}; + +type OutgoingRequestRoomCreatedData = OutgoingRequestBaseData & { + channel_id: string; + channel_name: string; + timestamp: Date; + user_id: string; + user_name: string; + owner: IUser; + room: IRoom; +}; + +type OutgoingRequestRoomData = OutgoingRequestBaseData & { + channel_id: string; + channel_name: string; + timestamp: Date; + user_id: string; + user_name: string; + owner: IUser; + room: IRoom; + bot?: boolean; +}; + +type OutgoingRequestUserCreatedData = OutgoingRequestBaseData & { + timestamp: Date; + user_id: string; + user_name: string; + user: IUser; + bot?: boolean; +}; + +type OutgoingRequestData = + | OutgoingRequestSendMessageData + | OutgoingRequestUploadedFileData + | OutgoingRequestRoomCreatedData + | OutgoingRequestRoomData + | OutgoingRequestUserCreatedData; + +type OutgoingRequest = { + params: Record; + method: 'POST'; + url: string; + data: OutgoingRequestData; + auth: undefined; + headers: Record; +}; + +type OutgoingRequestFromScript = { + url?: string; + headers?: Record; + method?: string; + message?: { + text?: string; + channel?: string; + attachments?: { + color?: string; + author_name?: string; + author_link?: string; + author_icon?: string; + title?: string; + title_link?: string; + text?: string; + fields?: { + title?: string; + value?: string; + short?: boolean; + }[]; + image_url?: string; + thumb_url?: string; + }[]; + }; + + auth?: string; + data?: Record; +}; + +type OutgoingRequestContext = { + integration: IOutgoingIntegration; + data: OutgoingRequestData; + historyId: IIntegrationHistory['_id']; + url: string; +}; + +type ProcessedOutgoingRequest = OutgoingRequest | OutgoingRequestFromScript; + +type OutgoingResponseContext = { + integration: IOutgoingIntegration; + request: ProcessedOutgoingRequest; + response: Awaited>; + content: string; + historyId: IIntegrationHistory['_id']; +}; + +type IncomingIntegrationRequest = { + url: { + hash: string | null | undefined; + search: string | null | undefined; + query: Record; + pathname: string | null | undefined; + path: string | null | undefined; + }; + url_raw: string; + url_params: Record; + content: Record; + content_raw: string; + headers: Record; + body: Record; + user: Pick, '_id' | 'name' | 'username'>; +}; + +export abstract class IntegrationScriptEngine { + protected compiledScripts: Record; + + public get disabled(): boolean { + return this.isDisabled(); + } + + public get incoming(): IsIncoming { + return this.isIncoming; + } + + constructor(private isIncoming: IsIncoming) { + this.compiledScripts = {}; + } + + public integrationHasValidScript(integration: IIntegration): boolean { + return Boolean(!this.disabled && integration.scriptEnabled && integration.scriptCompiled && integration.scriptCompiled.trim() !== ''); + } + + // PrepareOutgoingRequest will execute a script to build the request object that will be used for the actual integration request + // It may also return a message object to be sent to the room where the integration was triggered + public async prepareOutgoingRequest({ integration, data, historyId, url }: OutgoingRequestContext): Promise { + const request: OutgoingRequest = { + params: {}, + method: 'POST', + url, + data, + auth: undefined, + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36', + }, + }; + + if (!(await this.hasScriptAndMethod(integration, 'prepare_outgoing_request'))) { + return request; + } + + return this.executeOutgoingScript(integration, 'prepare_outgoing_request', { request }, historyId); + } + + public async processOutgoingResponse({ + integration, + request, + response, + content, + historyId, + }: OutgoingResponseContext): Promise { + if (!(await this.hasScriptAndMethod(integration, 'process_outgoing_response'))) { + return; + } + + const sandbox = { + request, + response: { + error: null, + status_code: response.status, + content, + content_raw: content, + headers: Object.fromEntries(response.headers), + }, + }; + + const scriptResult = await this.executeOutgoingScript(integration, 'process_outgoing_response', sandbox, historyId); + + if (scriptResult === false) { + return scriptResult; + } + + if (scriptResult?.content) { + return scriptResult.content; + } + } + + public async processIncomingRequest({ + integration, + request, + }: { + integration: IIncomingIntegration; + request: IncomingIntegrationRequest; + }): Promise { + return this.executeIncomingScript(integration, 'process_incoming_request', { request }); + } + + protected get logger(): ReturnType { + if (this.isIncoming) { + return incomingLogger; + } + + return outgoingLogger; + } + + protected async executeOutgoingScript( + integration: IOutgoingIntegration, + method: keyof IScriptClass, + params: Record, + historyId: IIntegrationHistory['_id'], + ): Promise { + if (this.disabled) { + return; + } + + const script = await wrapExceptions(() => this.getIntegrationScript(integration)).suppress((e: any) => + updateHistory({ + historyId, + step: 'execute-script-getting-script', + error: true, + errorStack: e, + }), + ); + + if (!script) { + return; + } + + if (!script[method]) { + this.logger.error(`Method "${method}" not found in the Integration "${integration.name}"`); + await updateHistory({ historyId, step: `execute-script-no-method-${method}` }); + return; + } + + try { + await updateHistory({ historyId, step: `execute-script-before-running-${method}` }); + + const result = await this.runScriptMethod({ + integrationId: integration._id, + script, + method, + params, + }); + + this.logger.debug({ + msg: `Script method "${method}" result of the Integration "${integration.name}" is:`, + result, + }); + + return result; + } catch (err: any) { + await updateHistory({ + historyId, + step: `execute-script-error-running-${method}`, + error: true, + errorStack: err.stack.replace(/^/gm, ' '), + }); + this.logger.error({ + msg: 'Error running Script in the Integration', + integration: integration.name, + err, + }); + this.logger.debug({ + msg: 'Error running Script in the Integration', + integration: integration.name, + script: integration.scriptCompiled, + }); + } + } + + protected async executeIncomingScript( + integration: IIncomingIntegration, + method: keyof IScriptClass, + params: Record, + ): Promise { + if (!this.integrationHasValidScript(integration)) { + return; + } + + const script = await wrapExceptions(() => this.getIntegrationScript(integration)).catch((e) => { + this.logger.error(e); + throw e; + }); + + if (!script[method]) { + this.logger.error(`Method "${method}" not found in the Integration "${integration.name}"`); + return; + } + + return wrapExceptions(() => + this.runScriptMethod({ + integrationId: integration._id, + script, + method, + params, + }), + ).catch((err: any) => { + this.logger.error({ + msg: 'Error running Script in Trigger', + integration: integration.name, + script: integration.scriptCompiled, + err, + }); + throw new Error('error-running-script'); + }); + } + + protected async hasScriptAndMethod(integration: IIntegration, method: keyof IScriptClass): Promise { + const script = await this.getScriptSafely(integration); + return typeof script?.[method] === 'function'; + } + + protected async getScriptSafely(integration: IIntegration): Promise | undefined> { + if (this.disabled || integration.scriptEnabled !== true || !integration.scriptCompiled || integration.scriptCompiled.trim() === '') { + return; + } + + return wrapExceptions(() => this.getIntegrationScript(integration)).suppress(); + } + + protected abstract isDisabled(): boolean; + + protected abstract runScriptMethod({ + integrationId, + script, + method, + params, + }: { + integrationId: IIntegration['_id']; + script: IScriptClass; + method: keyof IScriptClass; + params: Record; + }): Promise; + + protected abstract getIntegrationScript(integration: IIntegration): Promise>; +} diff --git a/apps/meteor/app/integrations/server/lib/definition.ts b/apps/meteor/app/integrations/server/lib/definition.ts new file mode 100644 index 000000000000..b4d11b9f4e8b --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/definition.ts @@ -0,0 +1,19 @@ +import type { IIntegration } from '@rocket.chat/core-typings'; + +export interface IScriptClass { + prepare_outgoing_request?: (params: Record) => any; + process_outgoing_response?: (params: Record) => any; + process_incoming_request?: (params: Record) => any; +} + +export type FullScriptClass = Required; + +export type CompiledScript = { + script: Partial; + store: Record; + _updatedAt: IIntegration['_updatedAt']; +}; + +export type CompatibilityScriptResult = IScriptClass & { + availableFunctions: (keyof IScriptClass)[]; +}; diff --git a/apps/meteor/app/integrations/server/lib/isolated-vm/buildSandbox.ts b/apps/meteor/app/integrations/server/lib/isolated-vm/buildSandbox.ts new file mode 100644 index 000000000000..1bbefb6a2ee7 --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/isolated-vm/buildSandbox.ts @@ -0,0 +1,127 @@ +import { EventEmitter } from 'events'; + +import { serverFetch as fetch, Response } from '@rocket.chat/server-fetch'; +import ivm, { type Context } from 'isolated-vm'; + +import * as s from '../../../../../lib/utils/stringUtils'; + +const proxyObject = (obj: Record, forbiddenKeys: string[] = []): Record => { + return copyObject({ + isProxy: true, + get: (key: string) => { + if (forbiddenKeys.includes(key)) { + return undefined; + } + + const value = obj[key]; + + if (typeof value === 'function') { + return new ivm.Reference(async (...args: any[]) => { + const result = (obj[key] as any)(...args); + + if (result && result instanceof Promise) { + return new Promise(async (resolve, reject) => { + try { + const awaitedResult = await result; + resolve(makeTransferable(awaitedResult)); + } catch (e) { + reject(e); + } + }); + } + + return makeTransferable(result); + }); + } + + return makeTransferable(value); + }, + }); +}; + +const copyObject = (obj: Record | any[]): Record | any[] => { + if (Array.isArray(obj)) { + return obj.map((data) => copyData(data)); + } + + if (obj instanceof Response) { + return proxyObject(obj, ['clone']); + } + + if (isSemiTransferable(obj)) { + return obj; + } + + if (typeof obj[Symbol.iterator as any] === 'function') { + return copyObject(Array.from(obj as any)); + } + + if (obj instanceof EventEmitter) { + return {}; + } + + const keys = Object.keys(obj); + + return { + ...Object.fromEntries( + keys.map((key) => { + const data = obj[key]; + + if (typeof data === 'function') { + return [key, new ivm.Callback((...args: any[]) => obj[key](...args))]; + } + + return [key, copyData(data)]; + }), + ), + }; +}; + +// Transferable data can be passed to isolates directly +const isTransferable = (data: any): data is ivm.Transferable => { + const dataType = typeof data; + + if (data === ivm) { + return true; + } + + if (['null', 'undefined', 'string', 'number', 'boolean', 'function'].includes(dataType)) { + return true; + } + + if (dataType !== 'object') { + return false; + } + + return ( + data instanceof ivm.Isolate || + data instanceof ivm.Context || + data instanceof ivm.Script || + data instanceof ivm.ExternalCopy || + data instanceof ivm.Callback || + data instanceof ivm.Reference + ); +}; + +// Semi-transferable data can be copied with an ivm.ExternalCopy without needing any manipulation. +const isSemiTransferable = (data: any) => data instanceof ArrayBuffer; + +const copyData = | any[]>(data: T) => (isTransferable(data) ? data : copyObject(data)); +const makeTransferable = (data: any) => (isTransferable(data) ? data : new ivm.ExternalCopy(copyObject(data)).copyInto()); + +export const buildSandbox = (context: Context) => { + const { global: jail } = context; + jail.setSync('global', jail.derefInto()); + jail.setSync('ivm', ivm); + + jail.setSync('s', makeTransferable(s)); + jail.setSync('console', makeTransferable(console)); + + jail.setSync( + 'serverFetch', + new ivm.Reference(async (url: string, ...args: any[]) => { + const result = await fetch(url, ...args); + return makeTransferable(result); + }), + ); +}; diff --git a/apps/meteor/app/integrations/server/lib/isolated-vm/getCompatibilityScript.ts b/apps/meteor/app/integrations/server/lib/isolated-vm/getCompatibilityScript.ts new file mode 100644 index 000000000000..77ce2475e8c2 --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/isolated-vm/getCompatibilityScript.ts @@ -0,0 +1,60 @@ +export const getCompatibilityScript = (customScript?: string) => ` + const Store = (function() { + const store = {}; + return { + set(key, val) { + store[key] = val; + return val; + }, + get(key) { + return store[key]; + }, + }; + })(); + + const reproxy = (reference) => { + return new Proxy(reference, { + get(target, p, receiver) { + if (target !== reference || p === 'then') { + return Reflect.get(target, p, receiver); + } + + const data = reference.get(p); + + if (typeof data === 'object' && data instanceof ivm.Reference && data.typeof === 'function') { + return (...args) => data.apply(undefined, args, { arguments: { copy: true }, result: { promise: true } }); + } + + return data; + } + }); + }; + + //url, options, allowSelfSignedCertificate + const fetch = async (...args) => { + const result = await serverFetch.apply(undefined, args, { arguments: { copy: true }, result: { promise: true } }); + + if (result && typeof result === 'object' && result.isProxy) { + return reproxy(result); + } + + return result; + }; + + ${customScript} + + (function() { + const instance = new Script(); + + const functions = { + ...(typeof instance['prepare_outgoing_request'] === 'function' ? { prepare_outgoing_request : (...args) => instance.prepare_outgoing_request(...args) } : {}), + ...(typeof instance['process_outgoing_response'] === 'function' ? { process_outgoing_response : (...args) => instance.process_outgoing_response(...args) } : {}), + ...(typeof instance['process_incoming_request'] === 'function' ? { process_incoming_request : (...args) => instance.process_incoming_request(...args) } : {}), + }; + + return { + ...functions, + availableFunctions: Object.keys(functions), + } + })(); +`; diff --git a/apps/meteor/app/integrations/server/lib/isolated-vm/isolated-vm.ts b/apps/meteor/app/integrations/server/lib/isolated-vm/isolated-vm.ts new file mode 100644 index 000000000000..2c78b6d98a7c --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/isolated-vm/isolated-vm.ts @@ -0,0 +1,99 @@ +import type { IIntegration, ValueOf } from '@rocket.chat/core-typings'; +import { pick } from '@rocket.chat/tools'; +import ivm, { type Reference } from 'isolated-vm'; + +import { IntegrationScriptEngine } from '../ScriptEngine'; +import type { IScriptClass, CompatibilityScriptResult, FullScriptClass } from '../definition'; +import { buildSandbox } from './buildSandbox'; +import { getCompatibilityScript } from './getCompatibilityScript'; + +const DISABLE_INTEGRATION_SCRIPTS = ['yes', 'true', 'ivm'].includes(String(process.env.DISABLE_INTEGRATION_SCRIPTS).toLowerCase()); + +export class IsolatedVMScriptEngine extends IntegrationScriptEngine { + protected isDisabled(): boolean { + return DISABLE_INTEGRATION_SCRIPTS; + } + + protected async callScriptFunction( + scriptReference: Reference>, + ...params: Parameters> + ): Promise { + return scriptReference.applySync(undefined, params, { + arguments: { copy: true }, + result: { copy: true, promise: true }, + }); + } + + protected async runScriptMethod({ + script, + method, + params, + }: { + integrationId: IIntegration['_id']; + script: Partial; + method: keyof IScriptClass; + params: Record; + }): Promise { + const fn = script[method]; + + if (typeof fn !== 'function') { + throw new Error('integration-method-not-found'); + } + + return fn(params); + } + + protected async getIntegrationScript(integration: IIntegration): Promise> { + if (this.disabled) { + throw new Error('integration-scripts-disabled'); + } + + const compiledScript = this.compiledScripts[integration._id]; + if (compiledScript && +compiledScript._updatedAt === +integration._updatedAt) { + return compiledScript.script; + } + + const script = integration.scriptCompiled; + try { + this.logger.info({ msg: 'Will evaluate the integration script', integration: pick(integration, 'name', '_id') }); + this.logger.debug(script); + + const isolate = new ivm.Isolate({ memoryLimit: 8 }); + + const ivmScript = await isolate.compileScript(getCompatibilityScript(script)); + + const ivmContext = isolate.createContextSync(); + buildSandbox(ivmContext); + + const ivmResult: Reference = await ivmScript.run(ivmContext, { + reference: true, + timeout: 3000, + }); + + const availableFunctions = await ivmResult.get('availableFunctions', { copy: true }); + const scriptFunctions = Object.fromEntries( + availableFunctions.map((functionName) => { + const fnReference = ivmResult.getSync(functionName, { reference: true }); + return [functionName, (...params: Parameters>) => this.callScriptFunction(fnReference, ...params)]; + }), + ) as Partial; + + this.compiledScripts[integration._id] = { + script: scriptFunctions, + store: {}, + _updatedAt: integration._updatedAt, + }; + + return scriptFunctions; + } catch (err: any) { + this.logger.error({ + msg: 'Error evaluating integration script', + integration: integration.name, + script, + err, + }); + + throw new Error('error-evaluating-script'); + } + } +} diff --git a/apps/meteor/app/integrations/server/lib/triggerHandler.js b/apps/meteor/app/integrations/server/lib/triggerHandler.js index b122b22ff355..b5050b8c4716 100644 --- a/apps/meteor/app/integrations/server/lib/triggerHandler.js +++ b/apps/meteor/app/integrations/server/lib/triggerHandler.js @@ -1,30 +1,25 @@ -import { Integrations, IntegrationHistory, Users, Rooms, Messages } from '@rocket.chat/models'; -import * as Models from '@rocket.chat/models'; -import { Random } from '@rocket.chat/random'; +import { Integrations, Users, Rooms, Messages } from '@rocket.chat/models'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; +import { wrapExceptions } from '@rocket.chat/tools'; import { Meteor } from 'meteor/meteor'; -import moment from 'moment'; import _ from 'underscore'; -import { VM, VMScript } from 'vm2'; -import { omit } from '../../../../lib/utils/omit'; -import * as s from '../../../../lib/utils/stringUtils'; -import { deasyncPromise } from '../../../../server/deasync/deasync'; -import { httpCall } from '../../../../server/lib/http/call'; import { getRoomByNameOrIdWithOptionToJoin } from '../../../lib/server/functions/getRoomByNameOrIdWithOptionToJoin'; import { processWebhookMessage } from '../../../lib/server/functions/processWebhookMessage'; import { settings } from '../../../settings/server'; import { outgoingEvents } from '../../lib/outgoingEvents'; -import { forbiddenModelMethods } from '../api/api'; import { outgoingLogger } from '../logger'; - -const DISABLE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.DISABLE_INTEGRATION_SCRIPTS).toLowerCase()); +import { IsolatedVMScriptEngine } from './isolated-vm/isolated-vm'; +import { updateHistory } from './updateHistory'; +import { VM2ScriptEngine } from './vm2/vm2'; class RocketChatIntegrationHandler { constructor() { this.successResults = [200, 201, 202]; this.compiledScripts = {}; this.triggers = {}; + this.vm2Engine = new VM2ScriptEngine(false); + this.ivmEngine = new IsolatedVMScriptEngine(false); } addIntegration(record) { @@ -51,6 +46,10 @@ class RocketChatIntegrationHandler { } } + getEngine(integration) { + return integration.scriptEngine === 'isolated-vm' ? this.ivmEngine : this.vm2Engine; + } + removeIntegration(record) { for (const trigger of Object.values(this.triggers)) { delete trigger[record._id]; @@ -67,114 +66,6 @@ class RocketChatIntegrationHandler { return false; } - async updateHistory({ - historyId, - step, - integration, - event, - data, - triggerWord, - ranPrepareScript, - prepareSentMessage, - processSentMessage, - resultMessage, - finished, - url, - httpCallData, - httpError, - httpResult, - error, - errorStack, - }) { - const history = { - type: 'outgoing-webhook', - step, - }; - - // Usually is only added on initial insert - if (integration) { - history.integration = integration; - } - - // Usually is only added on initial insert - if (event) { - history.event = event; - } - - if (data) { - history.data = { ...data }; - - if (data.user) { - history.data.user = omit(data.user, 'services'); - } - - if (data.room) { - history.data.room = data.room; - } - } - - if (triggerWord) { - history.triggerWord = triggerWord; - } - - if (typeof ranPrepareScript !== 'undefined') { - history.ranPrepareScript = ranPrepareScript; - } - - if (prepareSentMessage) { - history.prepareSentMessage = prepareSentMessage; - } - - if (processSentMessage) { - history.processSentMessage = processSentMessage; - } - - if (resultMessage) { - history.resultMessage = resultMessage; - } - - if (typeof finished !== 'undefined') { - history.finished = finished; - } - - if (url) { - history.url = url; - } - - if (typeof httpCallData !== 'undefined') { - history.httpCallData = httpCallData; - } - - if (httpError) { - history.httpError = httpError; - } - - if (typeof httpResult !== 'undefined') { - history.httpResult = JSON.stringify(httpResult, null, 2); - } - - if (typeof error !== 'undefined') { - history.error = error; - } - - if (typeof errorStack !== 'undefined') { - history.errorStack = errorStack; - } - - if (historyId) { - await IntegrationHistory.updateOne({ _id: historyId }, { $set: history }); - return historyId; - } - - history._createdAt = new Date(); - - const _id = Random.id(); - - await IntegrationHistory.insertOne({ _id, ...history }); - - return _id; - } - // Trigger is the trigger, nameOrId is a string which is used to try and find a room, room is a room, message is a message, and data contains "user_name" if trigger.impersonateUser is truthful. async sendMessage({ trigger, nameOrId = '', room, message, data }) { let user; @@ -229,199 +120,6 @@ class RocketChatIntegrationHandler { return message; } - buildSandbox(store = {}) { - const httpAsync = async (method, url, options) => { - try { - return { - result: await httpCall(method, url, options), - }; - } catch (error) { - return { error }; - } - }; - - const sandbox = { - scriptTimeout(reject) { - return setTimeout(() => reject('timed out'), 3000); - }, - _, - s, - console, - moment, - Promise, - Store: { - set: (key, val) => { - store[key] = val; - }, - get: (key) => store[key], - }, - HTTP: (method, url, options) => { - // TODO: deprecate, track and alert - return deasyncPromise(httpAsync(method, url, options)); - }, - // TODO: Export fetch as the non deprecated method - }; - - Object.keys(Models) - .filter((k) => !forbiddenModelMethods.includes(k)) - .forEach((k) => { - sandbox[k] = Models[k]; - }); - - return { store, sandbox }; - } - - getIntegrationScript(integration) { - if (DISABLE_INTEGRATION_SCRIPTS) { - throw new Meteor.Error('integration-scripts-disabled'); - } - - const compiledScript = this.compiledScripts[integration._id]; - if (compiledScript && +compiledScript._updatedAt === +integration._updatedAt) { - return compiledScript.script; - } - - const script = integration.scriptCompiled; - const { store, sandbox } = this.buildSandbox(); - - try { - outgoingLogger.info({ msg: 'Will evaluate script of Trigger', integration: integration.name }); - outgoingLogger.debug(script); - - const vmScript = new VMScript(`${script}; Script;`, 'script.js'); - const vm = new VM({ - sandbox, - }); - - const ScriptClass = vm.run(vmScript); - - if (ScriptClass) { - this.compiledScripts[integration._id] = { - script: new ScriptClass(), - store, - _updatedAt: integration._updatedAt, - }; - - return this.compiledScripts[integration._id].script; - } - } catch (err) { - outgoingLogger.error({ - msg: 'Error evaluating Script in Trigger', - integration: integration.name, - script, - err, - }); - throw new Meteor.Error('error-evaluating-script'); - } - - outgoingLogger.error(`Class "Script" not in Trigger ${integration.name}:`); - throw new Meteor.Error('class-script-not-found'); - } - - hasScriptAndMethod(integration, method) { - if ( - DISABLE_INTEGRATION_SCRIPTS || - integration.scriptEnabled !== true || - !integration.scriptCompiled || - integration.scriptCompiled.trim() === '' - ) { - return false; - } - - let script; - try { - script = this.getIntegrationScript(integration); - } catch (e) { - return false; - } - - return typeof script[method] !== 'undefined'; - } - - async executeScript(integration, method, params, historyId) { - if (DISABLE_INTEGRATION_SCRIPTS) { - return; - } - - let script; - try { - script = this.getIntegrationScript(integration); - } catch (e) { - await this.updateHistory({ - historyId, - step: 'execute-script-getting-script', - error: true, - errorStack: e, - }); - return; - } - - if (!script[method]) { - outgoingLogger.error(`Method "${method}" no found in the Integration "${integration.name}"`); - await this.updateHistory({ historyId, step: `execute-script-no-method-${method}` }); - return; - } - - try { - const { sandbox } = this.buildSandbox(this.compiledScripts[integration._id].store); - sandbox.script = script; - sandbox.method = method; - sandbox.params = params; - - await this.updateHistory({ historyId, step: `execute-script-before-running-${method}` }); - - const vm = new VM({ - timeout: 3000, - sandbox, - }); - - const result = await new Promise((resolve, reject) => { - process.nextTick(async () => { - try { - const scriptResult = await vm.run(` - new Promise((resolve, reject) => { - scriptTimeout(reject); - try { - resolve(script[method](params)) - } catch(e) { - reject(e); - } - }).catch((error) => { throw new Error(error); }); - `); - - resolve(scriptResult); - } catch (e) { - reject(e); - } - }); - }); - - outgoingLogger.debug({ - msg: `Script method "${method}" result of the Integration "${integration.name}" is:`, - result, - }); - - return result; - } catch (err) { - await this.updateHistory({ - historyId, - step: `execute-script-error-running-${method}`, - error: true, - errorStack: err.stack.replace(/^/gm, ' '), - }); - outgoingLogger.error({ - msg: 'Error running Script in the Integration', - integration: integration.name, - err, - }); - outgoingLogger.debug({ - msg: 'Error running Script in the Integration', - integration: integration.name, - script: integration.scriptCompiled, - }); // Only output the compiled script if debugging is enabled, so the logs don't get spammed. - } - } - eventNameArgumentsToObject(...args) { const argObject = { event: args[0], @@ -680,6 +378,17 @@ class RocketChatIntegrationHandler { } } + // Ensure that any errors thrown by the script engine will contibue to be compatible with Meteor.Error + async wrapScriptEngineCall(getter) { + return wrapExceptions(getter).catch((error) => { + if (error instanceof Error) { + throw new Meteor.Error(error.message); + } + + throw error; + }); + } + async executeTriggerUrl(url, trigger, { event, message, room, owner, user }, theHistoryId, tries = 0) { if (!this.isTriggerEnabled(trigger)) { outgoingLogger.warn(`The trigger "${trigger.name}" is no longer enabled, stopping execution of it at try: ${tries}`); @@ -715,7 +424,7 @@ class RocketChatIntegrationHandler { return; } - const historyId = await this.updateHistory({ + const historyId = await updateHistory({ step: 'start-execute-trigger-url', integration: trigger, event, @@ -731,36 +440,32 @@ class RocketChatIntegrationHandler { } this.mapEventArgsToData(data, { trigger, event, message, room, owner, user }); - await this.updateHistory({ historyId, step: 'mapped-args-to-data', data, triggerWord: word }); + await updateHistory({ historyId, step: 'mapped-args-to-data', data, triggerWord: word }); outgoingLogger.info(`Will be executing the Integration "${trigger.name}" to the url: ${url}`); outgoingLogger.debug({ data }); - let opts = { - params: {}, - method: 'POST', - url, - data, - auth: undefined, - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36', - }, - }; + const scriptEngine = this.getEngine(trigger); - if (this.hasScriptAndMethod(trigger, 'prepare_outgoing_request')) { - opts = await this.executeScript(trigger, 'prepare_outgoing_request', { request: opts }, historyId); - } + const opts = await this.wrapScriptEngineCall(() => + scriptEngine.prepareOutgoingRequest({ + integration: trigger, + data, + url, + historyId, + }), + ); - await this.updateHistory({ historyId, step: 'after-maybe-ran-prepare', ranPrepareScript: true }); + await updateHistory({ historyId, step: 'after-maybe-ran-prepare', ranPrepareScript: true }); if (!opts) { - await this.updateHistory({ historyId, step: 'after-prepare-no-opts', finished: true }); + await updateHistory({ historyId, step: 'after-prepare-no-opts', finished: true }); return; } if (opts.message) { const prepareMessage = await this.sendMessage({ trigger, room, message: opts.message, data }); - await this.updateHistory({ + await updateHistory({ historyId, step: 'after-prepare-send-message', prepareSentMessage: prepareMessage, @@ -768,7 +473,7 @@ class RocketChatIntegrationHandler { } if (!opts.url || !opts.method) { - await this.updateHistory({ historyId, step: 'after-prepare-no-url_or_method', finished: true }); + await updateHistory({ historyId, step: 'after-prepare-no-url_or_method', finished: true }); return; } @@ -782,7 +487,7 @@ class RocketChatIntegrationHandler { opts.headers.Authorization = `Basic ${base64}`; } - await this.updateHistory({ + await updateHistory({ historyId, step: 'pre-http-call', url: opts.url, @@ -823,47 +528,42 @@ class RocketChatIntegrationHandler { } })(); - await this.updateHistory({ + await updateHistory({ historyId, step: 'after-http-call', httpError: null, httpResult: content, }); - if (this.hasScriptAndMethod(trigger, 'process_outgoing_response')) { - const sandbox = { + const responseContent = await this.wrapScriptEngineCall(() => + scriptEngine.processOutgoingResponse({ + integration: trigger, request: opts, - response: { - error: null, - status_code: res.status, // These values will be undefined to close issues #4175, #5762, and #5896 - content, - content_raw: content, - headers: Object.fromEntries(res.headers), - }, - }; - - const scriptResult = await this.executeScript(trigger, 'process_outgoing_response', sandbox, historyId); - - if (scriptResult && scriptResult.content) { - const resultMessage = await this.sendMessage({ - trigger, - room, - message: scriptResult.content, - data, - }); - await this.updateHistory({ - historyId, - step: 'after-process-send-message', - processSentMessage: resultMessage, - finished: true, - }); - return; - } + response: res, + content, + historyId, + }), + ); + + if (responseContent) { + const resultMessage = await this.sendMessage({ + trigger, + room, + message: responseContent, + data, + }); + await updateHistory({ + historyId, + step: 'after-process-send-message', + processSentMessage: resultMessage, + finished: true, + }); + return; + } - if (scriptResult === false) { - await this.updateHistory({ historyId, step: 'after-process-false-result', finished: true }); - return; - } + if (responseContent === false) { + await updateHistory({ historyId, step: 'after-process-false-result', finished: true }); + return; } // if the result contained nothing or wasn't a successful statusCode @@ -875,14 +575,14 @@ class RocketChatIntegrationHandler { }); if (res.status === 410) { - await this.updateHistory({ historyId, step: 'after-process-http-status-410', error: true }); + await updateHistory({ historyId, step: 'after-process-http-status-410', error: true }); outgoingLogger.error(`Disabling the Integration "${trigger.name}" because the status code was 401 (Gone).`); await Integrations.updateOne({ _id: trigger._id }, { $set: { enabled: false } }); return; } if (res.status === 500) { - await this.updateHistory({ historyId, step: 'after-process-http-status-500', error: true }); + await updateHistory({ historyId, step: 'after-process-http-status-500', error: true }); outgoingLogger.error({ msg: `Error "500" for the Integration "${trigger.name}" to ${url}.`, content, @@ -893,7 +593,7 @@ class RocketChatIntegrationHandler { if (trigger.retryFailedCalls) { if (tries < trigger.retryCount && trigger.retryDelay) { - await this.updateHistory({ historyId, error: true, step: `going-to-retry-${tries + 1}` }); + await updateHistory({ historyId, error: true, step: `going-to-retry-${tries + 1}` }); let waitTime; @@ -912,7 +612,7 @@ class RocketChatIntegrationHandler { break; default: const er = new Error("The integration's retryDelay setting is invalid."); - await this.updateHistory({ + await updateHistory({ historyId, step: 'failed-and-retry-delay-is-invalid', error: true, @@ -926,10 +626,10 @@ class RocketChatIntegrationHandler { void this.executeTriggerUrl(url, trigger, { event, message, room, owner, user }, historyId, tries + 1); }, waitTime); } else { - await this.updateHistory({ historyId, step: 'too-many-retries', error: true }); + await updateHistory({ historyId, step: 'too-many-retries', error: true }); } } else { - await this.updateHistory({ + await updateHistory({ historyId, step: 'failed-and-not-configured-to-retry', error: true, @@ -943,7 +643,7 @@ class RocketChatIntegrationHandler { if (content && this.successResults.includes(res.status)) { if (data?.text || data?.attachments) { const resultMsg = await this.sendMessage({ trigger, room, message: data, data }); - await this.updateHistory({ + await updateHistory({ historyId, step: 'url-response-sent-message', resultMessage: resultMsg, @@ -954,7 +654,7 @@ class RocketChatIntegrationHandler { }) .catch(async (error) => { outgoingLogger.error(error); - await this.updateHistory({ + await updateHistory({ historyId, step: 'after-http-call', httpError: error, diff --git a/apps/meteor/app/integrations/server/lib/updateHistory.ts b/apps/meteor/app/integrations/server/lib/updateHistory.ts new file mode 100644 index 000000000000..9f7a3017108d --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/updateHistory.ts @@ -0,0 +1,96 @@ +import type { IIntegrationHistory, IIntegration, IMessage, AtLeast } from '@rocket.chat/core-typings'; +import { IntegrationHistory } from '@rocket.chat/models'; +import { Random } from '@rocket.chat/random'; + +import { omit } from '../../../../lib/utils/omit'; + +export const updateHistory = async ({ + historyId, + step, + integration, + event, + data, + triggerWord, + ranPrepareScript, + prepareSentMessage, + processSentMessage, + resultMessage, + finished, + url, + httpCallData, + httpError, + httpResult, + error, + errorStack, +}: { + historyId: IIntegrationHistory['_id']; + step: IIntegrationHistory['step']; + integration?: IIntegration; + event?: string; + triggerWord?: string; + ranPrepareScript?: boolean; + prepareSentMessage?: { channel: string; message: Partial }[]; + processSentMessage?: { channel: string; message: Partial }[]; + resultMessage?: { channel: string; message: Partial }[]; + finished?: boolean; + url?: string; + httpCallData?: Record; // ProcessedOutgoingRequest.data + httpError?: any; // null or whatever error type `fetch` may throw + httpResult?: string | null; + + error?: boolean; + errorStack?: any; // Error | Error['stack'] + + data?: Record; +}) => { + const { user: userData, room: roomData, ...fullData } = data || {}; + + const history: AtLeast = { + type: 'outgoing-webhook', + step, + + // Usually is only added on initial insert + ...(integration ? { integration } : {}), + // Usually is only added on initial insert + ...(event ? { event } : {}), + ...(fullData + ? { + data: { + ...fullData, + ...(userData ? { user: omit(userData, 'services') } : {}), + ...(roomData ? { room: roomData } : {}), + }, + } + : {}), + ...(triggerWord ? { triggerWord } : {}), + ...(typeof ranPrepareScript !== 'undefined' ? { ranPrepareScript } : {}), + ...(prepareSentMessage ? { prepareSentMessage } : {}), + ...(processSentMessage ? { processSentMessage } : {}), + ...(resultMessage ? { resultMessage } : {}), + ...(typeof finished !== 'undefined' ? { finished } : {}), + ...(url ? { url } : {}), + ...(typeof httpCallData !== 'undefined' ? { httpCallData } : {}), + ...(httpError ? { httpError } : {}), + ...(typeof httpResult !== 'undefined' ? { httpResult: JSON.stringify(httpResult, null, 2) } : {}), + ...(typeof error !== 'undefined' ? { error } : {}), + ...(typeof errorStack !== 'undefined' ? { errorStack } : {}), + }; + + if (historyId) { + await IntegrationHistory.updateOne({ _id: historyId }, { $set: history }); + return historyId; + } + + // Can't create a new history without there being an integration + if (!history.integration) { + throw new Error('error-invalid-integration'); + } + + history._createdAt = new Date(); + + const _id = Random.id(); + + await IntegrationHistory.insertOne({ _id, ...history } as IIntegrationHistory); + + return _id; +}; diff --git a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts index d9c2db78b62e..398f81161279 100644 --- a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts @@ -1,19 +1,18 @@ import type { IUser, INewOutgoingIntegration, IOutgoingIntegration, IUpdateOutgoingIntegration } from '@rocket.chat/core-typings'; import { Subscriptions, Users, Rooms } from '@rocket.chat/models'; +import { pick } from '@rocket.chat/tools'; import { Babel } from 'meteor/babel-compiler'; import { Match } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -import _ from 'underscore'; import { parseCSV } from '../../../../lib/utils/parseCSV'; import { hasPermissionAsync, hasAllPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { outgoingEvents } from '../../lib/outgoingEvents'; +import { isScriptEngineFrozen } from './validateScriptEngine'; const scopedChannels = ['all_public_channels', 'all_private_groups', 'all_direct_messages']; const validChannelChars = ['@', '#']; -const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); - function _verifyRequiredFields(integration: INewOutgoingIntegration | IUpdateOutgoingIntegration): void { if ( !integration.event || @@ -152,6 +151,7 @@ export const validateOutgoingIntegration = async function ( const integrationData: IOutgoingIntegration = { ...integration, + scriptEngine: integration.scriptEngine ?? 'isolated-vm', type: 'webhook-outgoing', channel: channels, userId: user._id, @@ -171,7 +171,13 @@ export const validateOutgoingIntegration = async function ( delete integrationData.triggerWords; } - if (!FREEZE_INTEGRATION_SCRIPTS && integration.scriptEnabled === true && integration.script && integration.script.trim() !== '') { + // Only compile the script if it is enabled and using a sandbox that is not frozen + if ( + !isScriptEngineFrozen(integrationData.scriptEngine) && + integration.scriptEnabled === true && + integration.script && + integration.script.trim() !== '' + ) { try { const babelOptions = Object.assign(Babel.getDefaultOptions({ runtime: false }), { compact: true, @@ -183,7 +189,7 @@ export const validateOutgoingIntegration = async function ( integrationData.scriptError = undefined; } catch (e) { integrationData.scriptCompiled = undefined; - integrationData.scriptError = e instanceof Error ? _.pick(e, 'name', 'message', 'stack') : undefined; + integrationData.scriptError = e instanceof Error ? pick(e, 'name', 'message', 'stack') : undefined; } } diff --git a/apps/meteor/app/integrations/server/lib/validateScriptEngine.ts b/apps/meteor/app/integrations/server/lib/validateScriptEngine.ts new file mode 100644 index 000000000000..c20dc9c59427 --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/validateScriptEngine.ts @@ -0,0 +1,26 @@ +import type { IntegrationScriptEngine } from '@rocket.chat/core-typings'; +import { wrapExceptions } from '@rocket.chat/tools'; + +const FREEZE_INTEGRATION_SCRIPTS_VALUE = String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase(); +const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(FREEZE_INTEGRATION_SCRIPTS_VALUE); + +export const validateScriptEngine = (engine?: IntegrationScriptEngine) => { + if (FREEZE_INTEGRATION_SCRIPTS) { + throw new Error('integration-scripts-disabled'); + } + + const engineCode = engine === 'isolated-vm' ? 'ivm' : 'vm2'; + + if (engineCode === FREEZE_INTEGRATION_SCRIPTS_VALUE) { + if (engineCode === 'ivm') { + throw new Error('integration-scripts-isolated-vm-disabled'); + } + + throw new Error('integration-scripts-vm2-disabled'); + } + + return true; +}; + +export const isScriptEngineFrozen = (engine?: IntegrationScriptEngine) => + wrapExceptions(() => !validateScriptEngine(engine)).catch(() => true); diff --git a/apps/meteor/app/integrations/server/lib/vm2/buildSandbox.ts b/apps/meteor/app/integrations/server/lib/vm2/buildSandbox.ts new file mode 100644 index 000000000000..9ba74404cf26 --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/vm2/buildSandbox.ts @@ -0,0 +1,88 @@ +import * as Models from '@rocket.chat/models'; +import moment from 'moment'; +import _ from 'underscore'; + +import * as s from '../../../../../lib/utils/stringUtils'; +import { deasyncPromise } from '../../../../../server/deasync/deasync'; +import { httpCall } from '../../../../../server/lib/http/call'; + +const forbiddenModelMethods: readonly (keyof typeof Models)[] = ['registerModel', 'getCollectionName']; + +type ModelName = Exclude; + +export type Vm2Sandbox = { + scriptTimeout: (reject: (reason?: any) => void) => ReturnType; + _: typeof _; + s: typeof s; + console: typeof console; + moment: typeof moment; + Promise: typeof Promise; + Store: { + set: IsIncoming extends true ? (key: string, value: any) => any : (key: string, value: any) => void; + get: (key: string) => any; + }; + HTTP: (method: string, url: string, options: Record) => unknown; +} & (IsIncoming extends true ? { Livechat: undefined } : never) & + Record; + +export const buildSandbox = ( + store: Record, + isIncoming?: IsIncoming, +): { + store: Record; + sandbox: Vm2Sandbox; +} => { + const httpAsync = async (method: string, url: string, options: Record) => { + try { + return { + result: await httpCall(method, url, options), + }; + } catch (error) { + return { error }; + } + }; + + const sandbox = { + scriptTimeout(reject: (reason?: any) => void) { + return setTimeout(() => reject('timed out'), 3000); + }, + _, + s, + console, + moment, + Promise, + // There's a small difference between the sandbox that is sent to incoming and to outgoing scripts + // Technically we could unify this but since we're deprecating vm2 anyway I'm keeping this old behavior here until the feature is removed completely + ...(isIncoming + ? { + Livechat: undefined, + Store: { + set: (key: string, val: any): any => { + store[key] = val; + return val; + }, + get: (key: string) => store[key], + }, + } + : { + Store: { + set: (key: string, val: any): void => { + store[key] = val; + }, + get: (key: string) => store[key], + }, + }), + HTTP: (method: string, url: string, options: Record) => { + // TODO: deprecate, track and alert + return deasyncPromise(httpAsync(method, url, options)); + }, + } as Vm2Sandbox; + + (Object.keys(Models) as ModelName[]) + .filter((k) => !forbiddenModelMethods.includes(k)) + .forEach((k) => { + sandbox[k] = Models[k]; + }); + + return { store, sandbox }; +}; diff --git a/apps/meteor/app/integrations/server/lib/vm2/vm2.ts b/apps/meteor/app/integrations/server/lib/vm2/vm2.ts new file mode 100644 index 000000000000..5f7519d69346 --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/vm2/vm2.ts @@ -0,0 +1,111 @@ +import type { IIntegration } from '@rocket.chat/core-typings'; +import { VM, VMScript } from 'vm2'; + +import { IntegrationScriptEngine } from '../ScriptEngine'; +import type { IScriptClass } from '../definition'; +import { buildSandbox, type Vm2Sandbox } from './buildSandbox'; + +const DISABLE_INTEGRATION_SCRIPTS = ['yes', 'true', 'vm2'].includes(String(process.env.DISABLE_INTEGRATION_SCRIPTS).toLowerCase()); + +export class VM2ScriptEngine extends IntegrationScriptEngine { + protected isDisabled(): boolean { + return DISABLE_INTEGRATION_SCRIPTS; + } + + protected buildSandbox(store: Record = {}): { store: Record; sandbox: Vm2Sandbox } { + return buildSandbox(store, this.incoming); + } + + protected async runScriptMethod({ + integrationId, + script, + method, + params, + }: { + integrationId: IIntegration['_id']; + script: IScriptClass; + method: keyof IScriptClass; + params: Record; + }): Promise { + const { sandbox } = this.buildSandbox(this.compiledScripts[integrationId].store); + + const vm = new VM({ + timeout: 3000, + sandbox: { + ...sandbox, + script, + method, + params, + ...(this.incoming && 'request' in params ? { request: params.request } : {}), + }, + }); + + return new Promise((resolve, reject) => { + process.nextTick(async () => { + try { + const scriptResult = await vm.run(` + new Promise((resolve, reject) => { + scriptTimeout(reject); + try { + resolve(script[method](params)) + } catch(e) { + reject(e); + } + }).catch((error) => { throw new Error(error); }); + `); + + resolve(scriptResult); + } catch (e) { + reject(e); + } + }); + }); + } + + protected async getIntegrationScript(integration: IIntegration): Promise> { + if (this.disabled) { + throw new Error('integration-scripts-disabled'); + } + + const compiledScript = this.compiledScripts[integration._id]; + if (compiledScript && +compiledScript._updatedAt === +integration._updatedAt) { + return compiledScript.script; + } + + const script = integration.scriptCompiled; + const { store, sandbox } = this.buildSandbox(); + + try { + this.logger.info({ msg: 'Will evaluate script of Trigger', integration: integration.name }); + this.logger.debug(script); + + const vmScript = new VMScript(`${script}; Script;`, 'script.js'); + const vm = new VM({ + sandbox, + }); + + const ScriptClass = vm.run(vmScript); + + if (ScriptClass) { + this.compiledScripts[integration._id] = { + script: new ScriptClass(), + store, + _updatedAt: integration._updatedAt, + }; + + return this.compiledScripts[integration._id].script; + } + } catch (err) { + this.logger.error({ + msg: 'Error evaluating Script in Trigger', + integration: integration.name, + script, + err, + }); + throw new Error('error-evaluating-script'); + } + + this.logger.error({ msg: 'Class "Script" not in Trigger', integration: integration.name }); + throw new Error('class-script-not-found'); + } +} diff --git a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts index bf84957ba8ea..45548a17a565 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts @@ -8,11 +8,10 @@ import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import { hasPermissionAsync, hasAllPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; +import { validateScriptEngine, isScriptEngineFrozen } from '../../lib/validateScriptEngine'; const validChannelChars = ['@', '#']; -const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); - declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { @@ -32,6 +31,7 @@ export const addIncomingIntegration = async (userId: string, integration: INewIn alias: Match.Maybe(String), emoji: Match.Maybe(String), scriptEnabled: Boolean, + scriptEngine: Match.Maybe(String), overrideDestinationChannelEnabled: Match.Maybe(Boolean), script: Match.Maybe(String), avatar: Match.Maybe(String), @@ -76,8 +76,8 @@ export const addIncomingIntegration = async (userId: string, integration: INewIn }); } - if (FREEZE_INTEGRATION_SCRIPTS && integration.script?.trim()) { - throw new Meteor.Error('integration-scripts-disabled'); + if (integration.script?.trim()) { + validateScriptEngine(integration.scriptEngine ?? 'isolated-vm'); } const user = await Users.findOne({ username: integration.username }); @@ -90,6 +90,7 @@ export const addIncomingIntegration = async (userId: string, integration: INewIn const integrationData: IIncomingIntegration = { ...integration, + scriptEngine: integration.scriptEngine ?? 'isolated-vm', type: 'webhook-incoming', channel: channels, overrideDestinationChannelEnabled: integration.overrideDestinationChannelEnabled ?? false, @@ -99,7 +100,13 @@ export const addIncomingIntegration = async (userId: string, integration: INewIn _createdBy: await Users.findOne({ _id: userId }, { projection: { username: 1 } }), }; - if (integration.scriptEnabled === true && integration.script && integration.script.trim() !== '') { + // Only compile the script if it is enabled and using a sandbox that is not frozen + if ( + !isScriptEngineFrozen(integrationData.scriptEngine) && + integration.scriptEnabled === true && + integration.script && + integration.script.trim() !== '' + ) { try { let babelOptions = Babel.getDefaultOptions({ runtime: false }); babelOptions = _.extend(babelOptions, { compact: true, minified: true, comments: false }); diff --git a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts index b865c72e0cca..5358e3233ce7 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts @@ -1,16 +1,16 @@ import type { IIntegration, INewIncomingIntegration, IUpdateIncomingIntegration } from '@rocket.chat/core-typings'; import { Integrations, Roles, Subscriptions, Users, Rooms } from '@rocket.chat/models'; +import { wrapExceptions } from '@rocket.chat/tools'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Babel } from 'meteor/babel-compiler'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import { hasAllPermissionAsync, hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; +import { isScriptEngineFrozen, validateScriptEngine } from '../../lib/validateScriptEngine'; const validChannelChars = ['@', '#']; -const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); - declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { @@ -66,11 +66,20 @@ Meteor.methods({ }); } - if (FREEZE_INTEGRATION_SCRIPTS) { - if (currentIntegration.script?.trim() !== integration.script?.trim()) { - throw new Meteor.Error('integration-scripts-disabled'); - } - } else { + const oldScriptEngine = currentIntegration.scriptEngine ?? 'vm2'; + const scriptEngine = integration.scriptEngine ?? oldScriptEngine; + if ( + integration.script?.trim() && + (scriptEngine !== oldScriptEngine || integration.script?.trim() !== currentIntegration.script?.trim()) + ) { + wrapExceptions(() => validateScriptEngine(scriptEngine)).catch((e) => { + throw new Meteor.Error(e.message); + }); + } + + const isFrozen = isScriptEngineFrozen(scriptEngine); + + if (!isFrozen) { let scriptCompiled: string | undefined; let scriptError: Pick | undefined; @@ -165,11 +174,12 @@ Meteor.methods({ emoji: integration.emoji, alias: integration.alias, channel: channels, - ...(FREEZE_INTEGRATION_SCRIPTS + ...(isFrozen ? {} : { script: integration.script, scriptEnabled: integration.scriptEnabled, + scriptEngine, }), ...(typeof integration.overrideDestinationChannelEnabled !== 'undefined' && { overrideDestinationChannelEnabled: integration.overrideDestinationChannelEnabled, diff --git a/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts b/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts index 9e5d29261b36..59879f99d475 100644 --- a/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts @@ -6,6 +6,7 @@ import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; import { validateOutgoingIntegration } from '../../lib/validateOutgoingIntegration'; +import { validateScriptEngine } from '../../lib/validateScriptEngine'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -14,8 +15,6 @@ declare module '@rocket.chat/ui-contexts' { } } -const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); - export const addOutgoingIntegration = async (userId: string, integration: INewOutgoingIntegration): Promise => { check( integration, @@ -29,6 +28,7 @@ export const addOutgoingIntegration = async (userId: string, integration: INewOu emoji: Match.Maybe(String), scriptEnabled: Boolean, script: Match.Maybe(String), + scriptEngine: Match.Maybe(String), urls: Match.Maybe([String]), event: Match.Maybe(String), triggerWords: Match.Maybe([String]), @@ -52,8 +52,8 @@ export const addOutgoingIntegration = async (userId: string, integration: INewOu throw new Meteor.Error('not_authorized'); } - if (FREEZE_INTEGRATION_SCRIPTS && integration.script?.trim()) { - throw new Meteor.Error('integration-scripts-disabled'); + if (integration.script?.trim()) { + validateScriptEngine(integration.scriptEngine ?? 'isolated-vm'); } const integrationData = await validateOutgoingIntegration(integration, userId); diff --git a/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts index 166badee823d..9e62561ebf9a 100644 --- a/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts @@ -1,10 +1,12 @@ import type { IIntegration, INewOutgoingIntegration, IUpdateOutgoingIntegration } from '@rocket.chat/core-typings'; import { Integrations, Users } from '@rocket.chat/models'; +import { wrapExceptions } from '@rocket.chat/tools'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; import { validateOutgoingIntegration } from '../../lib/validateOutgoingIntegration'; +import { isScriptEngineFrozen, validateScriptEngine } from '../../lib/validateScriptEngine'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -16,8 +18,6 @@ declare module '@rocket.chat/ui-contexts' { } } -const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); - Meteor.methods({ async updateOutgoingIntegration(integrationId, _integration) { if (!this.userId) { @@ -53,10 +53,19 @@ Meteor.methods({ throw new Meteor.Error('invalid_integration', '[methods] updateOutgoingIntegration -> integration not found'); } - if (FREEZE_INTEGRATION_SCRIPTS && integration.script?.trim() !== currentIntegration.script?.trim()) { - throw new Meteor.Error('integration-scripts-disabled'); + const oldScriptEngine = currentIntegration.scriptEngine ?? 'vm2'; + const scriptEngine = integration.scriptEngine ?? oldScriptEngine; + if ( + integration.script?.trim() && + (scriptEngine !== oldScriptEngine || integration.script?.trim() !== currentIntegration.script?.trim()) + ) { + wrapExceptions(() => validateScriptEngine(scriptEngine)).catch((e) => { + throw new Meteor.Error(e.message); + }); } + const isFrozen = isScriptEngineFrozen(scriptEngine); + await Integrations.updateOne( { _id: integrationId }, { @@ -74,11 +83,12 @@ Meteor.methods({ userId: integration.userId, urls: integration.urls, token: integration.token, - ...(FREEZE_INTEGRATION_SCRIPTS + ...(isFrozen ? {} : { script: integration.script, scriptEnabled: integration.scriptEnabled, + scriptEngine, ...(integration.scriptCompiled ? { scriptCompiled: integration.scriptCompiled } : { scriptError: integration.scriptError }), }), triggerWords: integration.triggerWords, @@ -90,7 +100,7 @@ Meteor.methods({ _updatedAt: new Date(), _updatedBy: await Users.findOne({ _id: this.userId }, { projection: { username: 1 } }), }, - ...(FREEZE_INTEGRATION_SCRIPTS + ...(isFrozen ? {} : { $unset: { diff --git a/apps/meteor/client/views/admin/integrations/IncomingWebhookForm.js b/apps/meteor/client/views/admin/integrations/IncomingWebhookForm.js index 94bbd156b86c..ae4d4fa411b5 100644 --- a/apps/meteor/client/views/admin/integrations/IncomingWebhookForm.js +++ b/apps/meteor/client/views/admin/integrations/IncomingWebhookForm.js @@ -1,4 +1,4 @@ -import { Field, TextInput, Box, ToggleSwitch, Icon, TextAreaInput, FieldGroup, Margins } from '@rocket.chat/fuselage'; +import { Field, TextInput, Box, ToggleSwitch, Icon, TextAreaInput, FieldGroup, Margins, Select } from '@rocket.chat/fuselage'; import { useAbsoluteUrl, useTranslation } from '@rocket.chat/ui-contexts'; import React, { useMemo, useCallback } from 'react'; @@ -11,7 +11,8 @@ export default function IncomingWebhookForm({ formValues, formHandlers, extraDat const absoluteUrl = useAbsoluteUrl(); - const { enabled, channel, username, name, alias, avatar, emoji, scriptEnabled, script, overrideDestinationChannelEnabled } = formValues; + const { enabled, channel, username, name, alias, avatar, emoji, scriptEnabled, script, scriptEngine, overrideDestinationChannelEnabled } = + formValues; const { handleEnabled, @@ -24,6 +25,7 @@ export default function IncomingWebhookForm({ formValues, formHandlers, extraDat handleScriptEnabled, handleOverrideDestinationChannelEnabled, handleScript, + handleScriptEngine, } = formHandlers; const url = absoluteUrl(`hooks/${extraData._id}/${extraData.token}`); @@ -42,6 +44,14 @@ export default function IncomingWebhookForm({ formValues, formHandlers, extraDat url, }); + const scriptEngineOptions = useMemo( + () => [ + ['vm2', t('Script_Engine_vm2')], + ['isolated-vm', t('Script_Engine_isolated_vm')], + ], + [t], + ); + const hilightedExampleJson = useHighlightedCode('json', JSON.stringify(exampleData, null, 2)); return ( @@ -172,6 +182,18 @@ export default function IncomingWebhookForm({ formValues, formHandlers, extraDat ), [t, scriptEnabled, handleScriptEnabled], )} + {useMemo( + () => ( + + {t('Script_Engine')} + + + + {t('Script_Engine_Description')} + + ), + [scriptEngine, scriptEngineOptions, handleScriptEngine, t], + )} {useMemo( () => ( diff --git a/apps/meteor/client/views/admin/integrations/edit/EditIncomingWebhook.js b/apps/meteor/client/views/admin/integrations/edit/EditIncomingWebhook.js index cbe3c3e5377d..e785f63ca29d 100644 --- a/apps/meteor/client/views/admin/integrations/edit/EditIncomingWebhook.js +++ b/apps/meteor/client/views/admin/integrations/edit/EditIncomingWebhook.js @@ -17,6 +17,7 @@ const getInitialValue = (data) => { avatar: data.avatar ?? '', emoji: data.emoji ?? '', scriptEnabled: data.scriptEnabled, + scriptEngine: data.scriptEngine ?? 'vm2', overrideDestinationChannelEnabled: data.overrideDestinationChannelEnabled, script: data.script, }; diff --git a/apps/meteor/client/views/admin/integrations/edit/EditOutgoingWebhook.js b/apps/meteor/client/views/admin/integrations/edit/EditOutgoingWebhook.js index 1734f32968c9..383b9209519d 100644 --- a/apps/meteor/client/views/admin/integrations/edit/EditOutgoingWebhook.js +++ b/apps/meteor/client/views/admin/integrations/edit/EditOutgoingWebhook.js @@ -24,6 +24,7 @@ const getInitialValue = (data) => { avatar: data.avatar ?? '', emoji: data.emoji ?? '', scriptEnabled: data.scriptEnabled ?? false, + scriptEngine: data.scriptEngine ?? 'vm2', script: data.script ?? '', retryFailedCalls: data.retryFailedCalls ?? true, retryCount: data.retryCount ?? 5, diff --git a/apps/meteor/client/views/admin/integrations/new/NewIncomingWebhook.js b/apps/meteor/client/views/admin/integrations/new/NewIncomingWebhook.js index 019dc6d0d730..7b4e0880e57f 100644 --- a/apps/meteor/client/views/admin/integrations/new/NewIncomingWebhook.js +++ b/apps/meteor/client/views/admin/integrations/new/NewIncomingWebhook.js @@ -15,6 +15,7 @@ const initialState = { avatar: '', emoji: '', scriptEnabled: false, + scriptEngine: 'isolated-vm', overrideDestinationChannelEnabled: false, script: '', }; diff --git a/apps/meteor/client/views/admin/integrations/new/NewOutgoingWebhook.js b/apps/meteor/client/views/admin/integrations/new/NewOutgoingWebhook.js index 818082f5f5de..153dc4c6eb7f 100644 --- a/apps/meteor/client/views/admin/integrations/new/NewOutgoingWebhook.js +++ b/apps/meteor/client/views/admin/integrations/new/NewOutgoingWebhook.js @@ -23,6 +23,7 @@ const defaultData = { avatar: '', emoji: '', scriptEnabled: false, + scriptEngine: 'isolated-vm', script: '', retryFailedCalls: true, retryCount: 6, diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 9e68456a78c8..5dea47ff3a10 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -347,6 +347,7 @@ "imap": "^0.8.19", "ip-range-check": "^0.2.0", "is-svg": "^4.3.2", + "isolated-vm": "4.4.2", "jquery": "^3.6.0", "jschardet": "^3.0.0", "jsdom": "^16.7.0", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 197d38d603f0..e3bf5ef3194c 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -2610,6 +2610,8 @@ "Integration_Incoming_WebHook": "Incoming WebHook Integration", "Integration_New": "New Integration", "integration-scripts-disabled": "Integration Scripts are Disabled", + "integration-scripts-isolated-vm-disabled": "The \"Secure Sandbox\" may not be used on new or modified scripts.", + "integration-scripts-vm2-disabled": "The \"Compatible Sandbox\" may not be used on new or modified scripts.", "Integration_Outgoing_WebHook": "Outgoing WebHook Integration", "Integration_Outgoing_WebHook_History": "Outgoing WebHook Integration History", "Integration_Outgoing_WebHook_History_Data_Passed_To_Trigger": "Data Passed to Integration", @@ -4520,6 +4522,10 @@ "Screen_Share": "Screen Share", "Script": "Script", "Script_Enabled": "Script Enabled", + "Script_Engine": "Script Sandbox", + "Script_Engine_Description": "Older scripts may require the compatible sandbox to run properly, but all new scripts should try to use the secure sandbox instead.", + "Script_Engine_vm2": "Compatible Sandbox (Deprecated)", + "Script_Engine_isolated_vm": "Secure Sandbox", "Search": "Search", "Searchable": "Searchable", "Search_Apps": "Search apps", diff --git a/packages/core-typings/src/IIntegration.ts b/packages/core-typings/src/IIntegration.ts index 6b99424264b2..cffff75767f4 100644 --- a/packages/core-typings/src/IIntegration.ts +++ b/packages/core-typings/src/IIntegration.ts @@ -1,6 +1,8 @@ import type { IRocketChatRecord } from './IRocketChatRecord'; import type { IUser } from './IUser'; +export type IntegrationScriptEngine = 'vm2' | 'isolated-vm'; + export interface IIncomingIntegration extends IRocketChatRecord { type: 'webhook-incoming'; _createdBy: Pick | null; @@ -22,6 +24,8 @@ export interface IIncomingIntegration extends IRocketChatRecord { alias?: string; avatar?: string; emoji?: string; + + scriptEngine?: IntegrationScriptEngine; } export type OutgoingIntegrationEvent = @@ -65,6 +69,8 @@ export interface IOutgoingIntegration extends IRocketChatRecord { alias?: string; avatar?: string; emoji?: string; + + scriptEngine?: IntegrationScriptEngine; } export type IIntegration = IIncomingIntegration | IOutgoingIntegration; diff --git a/packages/core-typings/src/IIntegrationHistory.ts b/packages/core-typings/src/IIntegrationHistory.ts index 6297cd7d74a0..6594d611fb49 100644 --- a/packages/core-typings/src/IIntegrationHistory.ts +++ b/packages/core-typings/src/IIntegrationHistory.ts @@ -1,3 +1,4 @@ +import type { IMessage } from './IMessage'; import type { IRocketChatRecord } from './IRocketChatRecord'; export interface IIntegrationHistory extends IRocketChatRecord { @@ -17,10 +18,10 @@ export interface IIntegrationHistory extends IRocketChatRecord { finished: boolean; triggerWord?: string; - prepareSentMessage?: string; - processSentMessage?: string; + prepareSentMessage?: { channel: string; message: Partial }[]; + processSentMessage?: { channel: string; message: Partial }[]; url?: string; - httpCallData?: string; + httpCallData?: Record; httpError?: any; httpResult?: string; error?: any; diff --git a/packages/rest-typings/src/v1/integrations/IntegrationsCreateProps.ts b/packages/rest-typings/src/v1/integrations/IntegrationsCreateProps.ts index e9ef650656cd..249a12096729 100644 --- a/packages/rest-typings/src/v1/integrations/IntegrationsCreateProps.ts +++ b/packages/rest-typings/src/v1/integrations/IntegrationsCreateProps.ts @@ -1,4 +1,4 @@ -import type { OutgoingIntegrationEvent } from '@rocket.chat/core-typings'; +import type { OutgoingIntegrationEvent, IntegrationScriptEngine } from '@rocket.chat/core-typings'; import Ajv from 'ajv'; const ajv = new Ajv(); @@ -16,6 +16,7 @@ export type IntegrationsCreateProps = alias?: string; avatar?: string; emoji?: string; + scriptEngine?: IntegrationScriptEngine; } | { type: 'webhook-outgoing'; @@ -44,6 +45,7 @@ export type IntegrationsCreateProps = alias?: string; avatar?: string; emoji?: string; + scriptEngine?: IntegrationScriptEngine; }; const integrationsCreateSchema = { @@ -96,6 +98,10 @@ const integrationsCreateSchema = { type: 'string', nullable: true, }, + scriptEngine: { + type: 'string', + nullable: true, + }, }, required: ['type', 'username', 'channel', 'scriptEnabled', 'name', 'enabled'], additionalProperties: false, @@ -196,6 +202,10 @@ const integrationsCreateSchema = { type: 'string', nullable: true, }, + scriptEngine: { + type: 'string', + nullable: true, + }, }, required: ['type', 'username', 'channel', 'event', 'scriptEnabled', 'name', 'enabled'], additionalProperties: false, diff --git a/packages/tools/src/index.ts b/packages/tools/src/index.ts index 261823100d0a..b8bc90d9cb54 100644 --- a/packages/tools/src/index.ts +++ b/packages/tools/src/index.ts @@ -1,3 +1,4 @@ export * from './pick'; export * from './timezone'; export * from './stream'; +export * from './wrapExceptions'; diff --git a/packages/tools/src/wrapExceptions.ts b/packages/tools/src/wrapExceptions.ts new file mode 100644 index 000000000000..bd830a92bfeb --- /dev/null +++ b/packages/tools/src/wrapExceptions.ts @@ -0,0 +1,46 @@ +const isPromise = (value: unknown): value is Promise => !!value && value instanceof Promise; + +export function wrapExceptions( + getter: () => T, +): { + catch: (errorWrapper: (error: any) => T) => T; + suppress: (errorWrapper?: (error: any) => void) => T | undefined; +}; +export function wrapExceptions( + getter: () => Promise, +): { + catch: (errorWrapper: (error: any) => T | Awaited) => Promise; + suppress: (errorWrapper?: (error: any) => void) => Promise; +}; +export function wrapExceptions(getter: () => T) { + const doCatch = (errorWrapper: (error: any) => T | Awaited): T => { + try { + const value = getter(); + if (isPromise(value)) { + return value.catch(errorWrapper) as T; + } + + return value; + } catch (error) { + return errorWrapper(error); + } + }; + + const doSuppress = (errorWrapper?: (error: any) => void) => { + try { + const value = getter(); + if (isPromise(value)) { + return value.catch((error) => errorWrapper?.(error)); + } + + return value; + } catch (error) { + errorWrapper?.(error); + } + }; + + return { + catch: doCatch, + suppress: doSuppress, + }; +} diff --git a/yarn.lock b/yarn.lock index 7d7b23691683..145079c6eb7a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8796,6 +8796,7 @@ __metadata: imap: ^0.8.19 ip-range-check: ^0.2.0 is-svg: ^4.3.2 + isolated-vm: 4.4.2 jest: ~29.6.1 jquery: ^3.6.0 jschardet: ^3.0.0 @@ -25272,6 +25273,15 @@ __metadata: languageName: node linkType: hard +"isolated-vm@npm:4.4.2": + version: 4.4.2 + resolution: "isolated-vm@npm:4.4.2" + dependencies: + node-gyp: latest + checksum: 86d12d96f90ceef74a3fc096439c71b0c115235ae3053d600eb8f7c678443d9ca3c8a2805dcd7f97463d11eb7d2e667868946b90e377a3e6d50fdd4085506fbc + languageName: node + linkType: hard + "isomorphic-unfetch@npm:^3.1.0": version: 3.1.0 resolution: "isomorphic-unfetch@npm:3.1.0" From 1041d4d3619b656cbdcf9df420ed5e720dad6226 Mon Sep 17 00:00:00 2001 From: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com> Date: Tue, 26 Sep 2023 20:05:21 -0300 Subject: [PATCH 198/275] feat: use isolated-vm to run integration scripts (#30229) Co-authored-by: Marcos Spessatto Defendi Co-authored-by: Tasso Evangelista --- .changeset/thirty-pumpkins-fix.md | 8 + apps/meteor/.docker/Dockerfile.alpine | 5 + .../meteor/app/integrations/server/api/api.js | 155 +----- .../integrations/server/lib/ScriptEngine.ts | 385 +++++++++++++++ .../app/integrations/server/lib/definition.ts | 19 + .../server/lib/isolated-vm/buildSandbox.ts | 127 +++++ .../lib/isolated-vm/getCompatibilityScript.ts | 60 +++ .../server/lib/isolated-vm/isolated-vm.ts | 99 ++++ .../integrations/server/lib/triggerHandler.js | 448 +++--------------- .../integrations/server/lib/updateHistory.ts | 96 ++++ .../server/lib/validateOutgoingIntegration.ts | 16 +- .../server/lib/validateScriptEngine.ts | 26 + .../server/lib/vm2/buildSandbox.ts | 88 ++++ .../app/integrations/server/lib/vm2/vm2.ts | 111 +++++ .../incoming/addIncomingIntegration.ts | 17 +- .../incoming/updateIncomingIntegration.ts | 26 +- .../outgoing/addOutgoingIntegration.ts | 8 +- .../outgoing/updateOutgoingIntegration.ts | 22 +- .../admin/integrations/IncomingWebhookForm.js | 26 +- .../integrations/OutgoiongWebhookForm.js | 21 + .../integrations/edit/EditIncomingWebhook.js | 1 + .../integrations/edit/EditOutgoingWebhook.js | 1 + .../integrations/new/NewIncomingWebhook.js | 1 + .../integrations/new/NewOutgoingWebhook.js | 1 + apps/meteor/package.json | 1 + .../rocketchat-i18n/i18n/en.i18n.json | 6 + packages/core-typings/src/IIntegration.ts | 6 + .../core-typings/src/IIntegrationHistory.ts | 7 +- .../integrations/IntegrationsCreateProps.ts | 12 +- packages/tools/src/index.ts | 1 + packages/tools/src/wrapExceptions.ts | 46 ++ yarn.lock | 10 + 32 files changed, 1306 insertions(+), 550 deletions(-) create mode 100644 .changeset/thirty-pumpkins-fix.md create mode 100644 apps/meteor/app/integrations/server/lib/ScriptEngine.ts create mode 100644 apps/meteor/app/integrations/server/lib/definition.ts create mode 100644 apps/meteor/app/integrations/server/lib/isolated-vm/buildSandbox.ts create mode 100644 apps/meteor/app/integrations/server/lib/isolated-vm/getCompatibilityScript.ts create mode 100644 apps/meteor/app/integrations/server/lib/isolated-vm/isolated-vm.ts create mode 100644 apps/meteor/app/integrations/server/lib/updateHistory.ts create mode 100644 apps/meteor/app/integrations/server/lib/validateScriptEngine.ts create mode 100644 apps/meteor/app/integrations/server/lib/vm2/buildSandbox.ts create mode 100644 apps/meteor/app/integrations/server/lib/vm2/vm2.ts create mode 100644 packages/tools/src/wrapExceptions.ts diff --git a/.changeset/thirty-pumpkins-fix.md b/.changeset/thirty-pumpkins-fix.md new file mode 100644 index 000000000000..11b92b064e15 --- /dev/null +++ b/.changeset/thirty-pumpkins-fix.md @@ -0,0 +1,8 @@ +--- +'@rocket.chat/core-typings': minor +'@rocket.chat/rest-typings': minor +'@rocket.chat/tools': minor +'@rocket.chat/meteor': minor +--- + +Added option to select between two script engine options for the integrations diff --git a/apps/meteor/.docker/Dockerfile.alpine b/apps/meteor/.docker/Dockerfile.alpine index 62a0476d9077..003baa57aa8b 100644 --- a/apps/meteor/.docker/Dockerfile.alpine +++ b/apps/meteor/.docker/Dockerfile.alpine @@ -15,6 +15,11 @@ RUN set -x \ && npm install sharp@0.30.4 \ && mv node_modules/sharp npm/node_modules/sharp \ # End hack for sharp + # Start hack for isolated-vm... + && rm -rf npm/node_modules/isolated-vm \ + && npm install isolated-vm@4.4.2 \ + && mv node_modules/isolated-vm npm/node_modules/isolated-vm \ + # End hack for isolated-vm && cd npm \ && npm rebuild bcrypt --build-from-source \ && npm cache clear --force \ diff --git a/apps/meteor/app/integrations/server/api/api.js b/apps/meteor/app/integrations/server/api/api.js index e1db46729011..5162fa54ad9c 100644 --- a/apps/meteor/app/integrations/server/api/api.js +++ b/apps/meteor/app/integrations/server/api/api.js @@ -1,114 +1,21 @@ import { Integrations, Users } from '@rocket.chat/models'; -import * as Models from '@rocket.chat/models'; import { Random } from '@rocket.chat/random'; -import { Livechat } from 'meteor/rocketchat:livechat'; -import moment from 'moment'; import _ from 'underscore'; -import { VM, VMScript } from 'vm2'; -import * as s from '../../../../lib/utils/stringUtils'; -import { deasyncPromise } from '../../../../server/deasync/deasync'; -import { httpCall } from '../../../../server/lib/http/call'; import { API, APIClass, defaultRateLimiterOptions } from '../../../api/server'; import { processWebhookMessage } from '../../../lib/server/functions/processWebhookMessage'; import { settings } from '../../../settings/server'; +import { IsolatedVMScriptEngine } from '../lib/isolated-vm/isolated-vm'; +import { VM2ScriptEngine } from '../lib/vm2/vm2'; import { incomingLogger } from '../logger'; import { addOutgoingIntegration } from '../methods/outgoing/addOutgoingIntegration'; import { deleteOutgoingIntegration } from '../methods/outgoing/deleteOutgoingIntegration'; -const DISABLE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.DISABLE_INTEGRATION_SCRIPTS).toLowerCase()); +const vm2Engine = new VM2ScriptEngine(true); +const ivmEngine = new IsolatedVMScriptEngine(true); -export const forbiddenModelMethods = ['registerModel', 'getCollectionName']; - -const compiledScripts = {}; -function buildSandbox(store = {}) { - const httpAsync = async (method, url, options) => { - try { - return { - result: await httpCall(method, url, options), - }; - } catch (error) { - return { error }; - } - }; - - const sandbox = { - scriptTimeout(reject) { - return setTimeout(() => reject('timed out'), 3000); - }, - _, - s, - console, - moment, - Promise, - Livechat, - Store: { - set(key, val) { - store[key] = val; - return val; - }, - get(key) { - return store[key]; - }, - }, - HTTP: (method, url, options) => { - // TODO: deprecate, track and alert - return deasyncPromise(httpAsync(method, url, options)); - }, - // TODO: Export fetch as the non deprecated method - }; - Object.keys(Models) - .filter((k) => !forbiddenModelMethods.includes(k)) - .forEach((k) => { - sandbox[k] = Models[k]; - }); - return { store, sandbox }; -} - -function getIntegrationScript(integration) { - if (DISABLE_INTEGRATION_SCRIPTS) { - throw API.v1.failure('integration-scripts-disabled'); - } - - const compiledScript = compiledScripts[integration._id]; - if (compiledScript && +compiledScript._updatedAt === +integration._updatedAt) { - return compiledScript.script; - } - - const script = integration.scriptCompiled; - const { sandbox, store } = buildSandbox(); - try { - incomingLogger.info({ msg: 'Will evaluate script of Trigger', integration: integration.name }); - incomingLogger.debug(script); - - const vmScript = new VMScript(`${script}; Script;`, 'script.js'); - const vm = new VM({ - sandbox, - }); - - const ScriptClass = vm.run(vmScript); - - if (ScriptClass) { - compiledScripts[integration._id] = { - script: new ScriptClass(), - store, - _updatedAt: integration._updatedAt, - }; - - return compiledScripts[integration._id].script; - } - } catch (err) { - incomingLogger.error({ - msg: 'Error evaluating Script in Trigger', - integration: integration.name, - script, - err, - }); - throw API.v1.failure('error-evaluating-script'); - } - - incomingLogger.error({ msg: 'Class "Script" not in Trigger', integration: integration.name }); - throw API.v1.failure('class-script-not-found'); +function getEngine(integration) { + return integration.scriptEngine === 'isolated-vm' ? ivmEngine : vm2Engine; } async function createIntegration(options, user) { @@ -178,20 +85,9 @@ async function executeIntegrationRest() { emoji: this.integration.emoji, }; - if ( - !DISABLE_INTEGRATION_SCRIPTS && - this.integration.scriptEnabled && - this.integration.scriptCompiled && - this.integration.scriptCompiled.trim() !== '' - ) { - let script; - try { - script = getIntegrationScript(this.integration); - } catch (e) { - incomingLogger.error(e); - return API.v1.failure(e.message); - } + const scriptEngine = getEngine(this.integration); + if (scriptEngine.integrationHasValidScript(this.integration)) { this.request.setEncoding('utf8'); const content_raw = this.request.read(); @@ -216,37 +112,12 @@ async function executeIntegrationRest() { }, }; - try { - const { sandbox } = buildSandbox(compiledScripts[this.integration._id].store); - sandbox.script = script; - sandbox.request = request; - - const vm = new VM({ - timeout: 3000, - sandbox, - }); - - const result = await new Promise((resolve, reject) => { - process.nextTick(async () => { - try { - const scriptResult = await vm.run(` - new Promise((resolve, reject) => { - scriptTimeout(reject); - try { - resolve(script.process_incoming_request({ request: request })); - } catch(e) { - reject(e); - } - }).catch((error) => { throw new Error(error); }); - `); - - resolve(scriptResult); - } catch (e) { - reject(e); - } - }); - }); + const result = await scriptEngine.processIncomingRequest({ + integration: this.integration, + request, + }); + try { if (!result) { incomingLogger.debug({ msg: 'Process Incoming Request result of Trigger has no data', diff --git a/apps/meteor/app/integrations/server/lib/ScriptEngine.ts b/apps/meteor/app/integrations/server/lib/ScriptEngine.ts new file mode 100644 index 000000000000..e46984a893ef --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/ScriptEngine.ts @@ -0,0 +1,385 @@ +import type { + IUser, + IRoom, + IMessage, + IOutgoingIntegration, + IIncomingIntegration, + IIntegration, + IIntegrationHistory, +} from '@rocket.chat/core-typings'; +import type { Logger } from '@rocket.chat/logger'; +import type { serverFetch } from '@rocket.chat/server-fetch'; +import { wrapExceptions } from '@rocket.chat/tools'; + +import { incomingLogger, outgoingLogger } from '../logger'; +import type { IScriptClass, CompiledScript } from './definition'; +import { updateHistory } from './updateHistory'; + +type OutgoingRequestBaseData = { + token: IOutgoingIntegration['token']; + bot: false; + trigger_word: string; +}; + +type OutgoingRequestSendMessageData = OutgoingRequestBaseData & { + channel_id: string; + channel_name: string; + message_id: string; + timestamp: Date; + user_id: string; + user_name: string; + text: string; + siteUrl: string; + alias?: string; + bot?: boolean; + isEdited?: true; + tmid?: string; +}; + +type OutgoingRequestUploadedFileData = OutgoingRequestBaseData & { + channel_id: string; + channel_name: string; + message_id: string; + timestamp: Date; + user_id: string; + user_name: string; + text: string; + + user: IUser; + room: IRoom; + message: IMessage; + + alias?: string; + bot?: boolean; +}; + +type OutgoingRequestRoomCreatedData = OutgoingRequestBaseData & { + channel_id: string; + channel_name: string; + timestamp: Date; + user_id: string; + user_name: string; + owner: IUser; + room: IRoom; +}; + +type OutgoingRequestRoomData = OutgoingRequestBaseData & { + channel_id: string; + channel_name: string; + timestamp: Date; + user_id: string; + user_name: string; + owner: IUser; + room: IRoom; + bot?: boolean; +}; + +type OutgoingRequestUserCreatedData = OutgoingRequestBaseData & { + timestamp: Date; + user_id: string; + user_name: string; + user: IUser; + bot?: boolean; +}; + +type OutgoingRequestData = + | OutgoingRequestSendMessageData + | OutgoingRequestUploadedFileData + | OutgoingRequestRoomCreatedData + | OutgoingRequestRoomData + | OutgoingRequestUserCreatedData; + +type OutgoingRequest = { + params: Record; + method: 'POST'; + url: string; + data: OutgoingRequestData; + auth: undefined; + headers: Record; +}; + +type OutgoingRequestFromScript = { + url?: string; + headers?: Record; + method?: string; + message?: { + text?: string; + channel?: string; + attachments?: { + color?: string; + author_name?: string; + author_link?: string; + author_icon?: string; + title?: string; + title_link?: string; + text?: string; + fields?: { + title?: string; + value?: string; + short?: boolean; + }[]; + image_url?: string; + thumb_url?: string; + }[]; + }; + + auth?: string; + data?: Record; +}; + +type OutgoingRequestContext = { + integration: IOutgoingIntegration; + data: OutgoingRequestData; + historyId: IIntegrationHistory['_id']; + url: string; +}; + +type ProcessedOutgoingRequest = OutgoingRequest | OutgoingRequestFromScript; + +type OutgoingResponseContext = { + integration: IOutgoingIntegration; + request: ProcessedOutgoingRequest; + response: Awaited>; + content: string; + historyId: IIntegrationHistory['_id']; +}; + +type IncomingIntegrationRequest = { + url: { + hash: string | null | undefined; + search: string | null | undefined; + query: Record; + pathname: string | null | undefined; + path: string | null | undefined; + }; + url_raw: string; + url_params: Record; + content: Record; + content_raw: string; + headers: Record; + body: Record; + user: Pick, '_id' | 'name' | 'username'>; +}; + +export abstract class IntegrationScriptEngine { + protected compiledScripts: Record; + + public get disabled(): boolean { + return this.isDisabled(); + } + + public get incoming(): IsIncoming { + return this.isIncoming; + } + + constructor(private isIncoming: IsIncoming) { + this.compiledScripts = {}; + } + + public integrationHasValidScript(integration: IIntegration): boolean { + return Boolean(!this.disabled && integration.scriptEnabled && integration.scriptCompiled && integration.scriptCompiled.trim() !== ''); + } + + // PrepareOutgoingRequest will execute a script to build the request object that will be used for the actual integration request + // It may also return a message object to be sent to the room where the integration was triggered + public async prepareOutgoingRequest({ integration, data, historyId, url }: OutgoingRequestContext): Promise { + const request: OutgoingRequest = { + params: {}, + method: 'POST', + url, + data, + auth: undefined, + headers: { + 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36', + }, + }; + + if (!(await this.hasScriptAndMethod(integration, 'prepare_outgoing_request'))) { + return request; + } + + return this.executeOutgoingScript(integration, 'prepare_outgoing_request', { request }, historyId); + } + + public async processOutgoingResponse({ + integration, + request, + response, + content, + historyId, + }: OutgoingResponseContext): Promise { + if (!(await this.hasScriptAndMethod(integration, 'process_outgoing_response'))) { + return; + } + + const sandbox = { + request, + response: { + error: null, + status_code: response.status, + content, + content_raw: content, + headers: Object.fromEntries(response.headers), + }, + }; + + const scriptResult = await this.executeOutgoingScript(integration, 'process_outgoing_response', sandbox, historyId); + + if (scriptResult === false) { + return scriptResult; + } + + if (scriptResult?.content) { + return scriptResult.content; + } + } + + public async processIncomingRequest({ + integration, + request, + }: { + integration: IIncomingIntegration; + request: IncomingIntegrationRequest; + }): Promise { + return this.executeIncomingScript(integration, 'process_incoming_request', { request }); + } + + protected get logger(): ReturnType { + if (this.isIncoming) { + return incomingLogger; + } + + return outgoingLogger; + } + + protected async executeOutgoingScript( + integration: IOutgoingIntegration, + method: keyof IScriptClass, + params: Record, + historyId: IIntegrationHistory['_id'], + ): Promise { + if (this.disabled) { + return; + } + + const script = await wrapExceptions(() => this.getIntegrationScript(integration)).suppress((e: any) => + updateHistory({ + historyId, + step: 'execute-script-getting-script', + error: true, + errorStack: e, + }), + ); + + if (!script) { + return; + } + + if (!script[method]) { + this.logger.error(`Method "${method}" not found in the Integration "${integration.name}"`); + await updateHistory({ historyId, step: `execute-script-no-method-${method}` }); + return; + } + + try { + await updateHistory({ historyId, step: `execute-script-before-running-${method}` }); + + const result = await this.runScriptMethod({ + integrationId: integration._id, + script, + method, + params, + }); + + this.logger.debug({ + msg: `Script method "${method}" result of the Integration "${integration.name}" is:`, + result, + }); + + return result; + } catch (err: any) { + await updateHistory({ + historyId, + step: `execute-script-error-running-${method}`, + error: true, + errorStack: err.stack.replace(/^/gm, ' '), + }); + this.logger.error({ + msg: 'Error running Script in the Integration', + integration: integration.name, + err, + }); + this.logger.debug({ + msg: 'Error running Script in the Integration', + integration: integration.name, + script: integration.scriptCompiled, + }); + } + } + + protected async executeIncomingScript( + integration: IIncomingIntegration, + method: keyof IScriptClass, + params: Record, + ): Promise { + if (!this.integrationHasValidScript(integration)) { + return; + } + + const script = await wrapExceptions(() => this.getIntegrationScript(integration)).catch((e) => { + this.logger.error(e); + throw e; + }); + + if (!script[method]) { + this.logger.error(`Method "${method}" not found in the Integration "${integration.name}"`); + return; + } + + return wrapExceptions(() => + this.runScriptMethod({ + integrationId: integration._id, + script, + method, + params, + }), + ).catch((err: any) => { + this.logger.error({ + msg: 'Error running Script in Trigger', + integration: integration.name, + script: integration.scriptCompiled, + err, + }); + throw new Error('error-running-script'); + }); + } + + protected async hasScriptAndMethod(integration: IIntegration, method: keyof IScriptClass): Promise { + const script = await this.getScriptSafely(integration); + return typeof script?.[method] === 'function'; + } + + protected async getScriptSafely(integration: IIntegration): Promise | undefined> { + if (this.disabled || integration.scriptEnabled !== true || !integration.scriptCompiled || integration.scriptCompiled.trim() === '') { + return; + } + + return wrapExceptions(() => this.getIntegrationScript(integration)).suppress(); + } + + protected abstract isDisabled(): boolean; + + protected abstract runScriptMethod({ + integrationId, + script, + method, + params, + }: { + integrationId: IIntegration['_id']; + script: IScriptClass; + method: keyof IScriptClass; + params: Record; + }): Promise; + + protected abstract getIntegrationScript(integration: IIntegration): Promise>; +} diff --git a/apps/meteor/app/integrations/server/lib/definition.ts b/apps/meteor/app/integrations/server/lib/definition.ts new file mode 100644 index 000000000000..b4d11b9f4e8b --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/definition.ts @@ -0,0 +1,19 @@ +import type { IIntegration } from '@rocket.chat/core-typings'; + +export interface IScriptClass { + prepare_outgoing_request?: (params: Record) => any; + process_outgoing_response?: (params: Record) => any; + process_incoming_request?: (params: Record) => any; +} + +export type FullScriptClass = Required; + +export type CompiledScript = { + script: Partial; + store: Record; + _updatedAt: IIntegration['_updatedAt']; +}; + +export type CompatibilityScriptResult = IScriptClass & { + availableFunctions: (keyof IScriptClass)[]; +}; diff --git a/apps/meteor/app/integrations/server/lib/isolated-vm/buildSandbox.ts b/apps/meteor/app/integrations/server/lib/isolated-vm/buildSandbox.ts new file mode 100644 index 000000000000..1bbefb6a2ee7 --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/isolated-vm/buildSandbox.ts @@ -0,0 +1,127 @@ +import { EventEmitter } from 'events'; + +import { serverFetch as fetch, Response } from '@rocket.chat/server-fetch'; +import ivm, { type Context } from 'isolated-vm'; + +import * as s from '../../../../../lib/utils/stringUtils'; + +const proxyObject = (obj: Record, forbiddenKeys: string[] = []): Record => { + return copyObject({ + isProxy: true, + get: (key: string) => { + if (forbiddenKeys.includes(key)) { + return undefined; + } + + const value = obj[key]; + + if (typeof value === 'function') { + return new ivm.Reference(async (...args: any[]) => { + const result = (obj[key] as any)(...args); + + if (result && result instanceof Promise) { + return new Promise(async (resolve, reject) => { + try { + const awaitedResult = await result; + resolve(makeTransferable(awaitedResult)); + } catch (e) { + reject(e); + } + }); + } + + return makeTransferable(result); + }); + } + + return makeTransferable(value); + }, + }); +}; + +const copyObject = (obj: Record | any[]): Record | any[] => { + if (Array.isArray(obj)) { + return obj.map((data) => copyData(data)); + } + + if (obj instanceof Response) { + return proxyObject(obj, ['clone']); + } + + if (isSemiTransferable(obj)) { + return obj; + } + + if (typeof obj[Symbol.iterator as any] === 'function') { + return copyObject(Array.from(obj as any)); + } + + if (obj instanceof EventEmitter) { + return {}; + } + + const keys = Object.keys(obj); + + return { + ...Object.fromEntries( + keys.map((key) => { + const data = obj[key]; + + if (typeof data === 'function') { + return [key, new ivm.Callback((...args: any[]) => obj[key](...args))]; + } + + return [key, copyData(data)]; + }), + ), + }; +}; + +// Transferable data can be passed to isolates directly +const isTransferable = (data: any): data is ivm.Transferable => { + const dataType = typeof data; + + if (data === ivm) { + return true; + } + + if (['null', 'undefined', 'string', 'number', 'boolean', 'function'].includes(dataType)) { + return true; + } + + if (dataType !== 'object') { + return false; + } + + return ( + data instanceof ivm.Isolate || + data instanceof ivm.Context || + data instanceof ivm.Script || + data instanceof ivm.ExternalCopy || + data instanceof ivm.Callback || + data instanceof ivm.Reference + ); +}; + +// Semi-transferable data can be copied with an ivm.ExternalCopy without needing any manipulation. +const isSemiTransferable = (data: any) => data instanceof ArrayBuffer; + +const copyData = | any[]>(data: T) => (isTransferable(data) ? data : copyObject(data)); +const makeTransferable = (data: any) => (isTransferable(data) ? data : new ivm.ExternalCopy(copyObject(data)).copyInto()); + +export const buildSandbox = (context: Context) => { + const { global: jail } = context; + jail.setSync('global', jail.derefInto()); + jail.setSync('ivm', ivm); + + jail.setSync('s', makeTransferable(s)); + jail.setSync('console', makeTransferable(console)); + + jail.setSync( + 'serverFetch', + new ivm.Reference(async (url: string, ...args: any[]) => { + const result = await fetch(url, ...args); + return makeTransferable(result); + }), + ); +}; diff --git a/apps/meteor/app/integrations/server/lib/isolated-vm/getCompatibilityScript.ts b/apps/meteor/app/integrations/server/lib/isolated-vm/getCompatibilityScript.ts new file mode 100644 index 000000000000..77ce2475e8c2 --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/isolated-vm/getCompatibilityScript.ts @@ -0,0 +1,60 @@ +export const getCompatibilityScript = (customScript?: string) => ` + const Store = (function() { + const store = {}; + return { + set(key, val) { + store[key] = val; + return val; + }, + get(key) { + return store[key]; + }, + }; + })(); + + const reproxy = (reference) => { + return new Proxy(reference, { + get(target, p, receiver) { + if (target !== reference || p === 'then') { + return Reflect.get(target, p, receiver); + } + + const data = reference.get(p); + + if (typeof data === 'object' && data instanceof ivm.Reference && data.typeof === 'function') { + return (...args) => data.apply(undefined, args, { arguments: { copy: true }, result: { promise: true } }); + } + + return data; + } + }); + }; + + //url, options, allowSelfSignedCertificate + const fetch = async (...args) => { + const result = await serverFetch.apply(undefined, args, { arguments: { copy: true }, result: { promise: true } }); + + if (result && typeof result === 'object' && result.isProxy) { + return reproxy(result); + } + + return result; + }; + + ${customScript} + + (function() { + const instance = new Script(); + + const functions = { + ...(typeof instance['prepare_outgoing_request'] === 'function' ? { prepare_outgoing_request : (...args) => instance.prepare_outgoing_request(...args) } : {}), + ...(typeof instance['process_outgoing_response'] === 'function' ? { process_outgoing_response : (...args) => instance.process_outgoing_response(...args) } : {}), + ...(typeof instance['process_incoming_request'] === 'function' ? { process_incoming_request : (...args) => instance.process_incoming_request(...args) } : {}), + }; + + return { + ...functions, + availableFunctions: Object.keys(functions), + } + })(); +`; diff --git a/apps/meteor/app/integrations/server/lib/isolated-vm/isolated-vm.ts b/apps/meteor/app/integrations/server/lib/isolated-vm/isolated-vm.ts new file mode 100644 index 000000000000..2c78b6d98a7c --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/isolated-vm/isolated-vm.ts @@ -0,0 +1,99 @@ +import type { IIntegration, ValueOf } from '@rocket.chat/core-typings'; +import { pick } from '@rocket.chat/tools'; +import ivm, { type Reference } from 'isolated-vm'; + +import { IntegrationScriptEngine } from '../ScriptEngine'; +import type { IScriptClass, CompatibilityScriptResult, FullScriptClass } from '../definition'; +import { buildSandbox } from './buildSandbox'; +import { getCompatibilityScript } from './getCompatibilityScript'; + +const DISABLE_INTEGRATION_SCRIPTS = ['yes', 'true', 'ivm'].includes(String(process.env.DISABLE_INTEGRATION_SCRIPTS).toLowerCase()); + +export class IsolatedVMScriptEngine extends IntegrationScriptEngine { + protected isDisabled(): boolean { + return DISABLE_INTEGRATION_SCRIPTS; + } + + protected async callScriptFunction( + scriptReference: Reference>, + ...params: Parameters> + ): Promise { + return scriptReference.applySync(undefined, params, { + arguments: { copy: true }, + result: { copy: true, promise: true }, + }); + } + + protected async runScriptMethod({ + script, + method, + params, + }: { + integrationId: IIntegration['_id']; + script: Partial; + method: keyof IScriptClass; + params: Record; + }): Promise { + const fn = script[method]; + + if (typeof fn !== 'function') { + throw new Error('integration-method-not-found'); + } + + return fn(params); + } + + protected async getIntegrationScript(integration: IIntegration): Promise> { + if (this.disabled) { + throw new Error('integration-scripts-disabled'); + } + + const compiledScript = this.compiledScripts[integration._id]; + if (compiledScript && +compiledScript._updatedAt === +integration._updatedAt) { + return compiledScript.script; + } + + const script = integration.scriptCompiled; + try { + this.logger.info({ msg: 'Will evaluate the integration script', integration: pick(integration, 'name', '_id') }); + this.logger.debug(script); + + const isolate = new ivm.Isolate({ memoryLimit: 8 }); + + const ivmScript = await isolate.compileScript(getCompatibilityScript(script)); + + const ivmContext = isolate.createContextSync(); + buildSandbox(ivmContext); + + const ivmResult: Reference = await ivmScript.run(ivmContext, { + reference: true, + timeout: 3000, + }); + + const availableFunctions = await ivmResult.get('availableFunctions', { copy: true }); + const scriptFunctions = Object.fromEntries( + availableFunctions.map((functionName) => { + const fnReference = ivmResult.getSync(functionName, { reference: true }); + return [functionName, (...params: Parameters>) => this.callScriptFunction(fnReference, ...params)]; + }), + ) as Partial; + + this.compiledScripts[integration._id] = { + script: scriptFunctions, + store: {}, + _updatedAt: integration._updatedAt, + }; + + return scriptFunctions; + } catch (err: any) { + this.logger.error({ + msg: 'Error evaluating integration script', + integration: integration.name, + script, + err, + }); + + throw new Error('error-evaluating-script'); + } + } +} diff --git a/apps/meteor/app/integrations/server/lib/triggerHandler.js b/apps/meteor/app/integrations/server/lib/triggerHandler.js index b122b22ff355..b5050b8c4716 100644 --- a/apps/meteor/app/integrations/server/lib/triggerHandler.js +++ b/apps/meteor/app/integrations/server/lib/triggerHandler.js @@ -1,30 +1,25 @@ -import { Integrations, IntegrationHistory, Users, Rooms, Messages } from '@rocket.chat/models'; -import * as Models from '@rocket.chat/models'; -import { Random } from '@rocket.chat/random'; +import { Integrations, Users, Rooms, Messages } from '@rocket.chat/models'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; +import { wrapExceptions } from '@rocket.chat/tools'; import { Meteor } from 'meteor/meteor'; -import moment from 'moment'; import _ from 'underscore'; -import { VM, VMScript } from 'vm2'; -import { omit } from '../../../../lib/utils/omit'; -import * as s from '../../../../lib/utils/stringUtils'; -import { deasyncPromise } from '../../../../server/deasync/deasync'; -import { httpCall } from '../../../../server/lib/http/call'; import { getRoomByNameOrIdWithOptionToJoin } from '../../../lib/server/functions/getRoomByNameOrIdWithOptionToJoin'; import { processWebhookMessage } from '../../../lib/server/functions/processWebhookMessage'; import { settings } from '../../../settings/server'; import { outgoingEvents } from '../../lib/outgoingEvents'; -import { forbiddenModelMethods } from '../api/api'; import { outgoingLogger } from '../logger'; - -const DISABLE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.DISABLE_INTEGRATION_SCRIPTS).toLowerCase()); +import { IsolatedVMScriptEngine } from './isolated-vm/isolated-vm'; +import { updateHistory } from './updateHistory'; +import { VM2ScriptEngine } from './vm2/vm2'; class RocketChatIntegrationHandler { constructor() { this.successResults = [200, 201, 202]; this.compiledScripts = {}; this.triggers = {}; + this.vm2Engine = new VM2ScriptEngine(false); + this.ivmEngine = new IsolatedVMScriptEngine(false); } addIntegration(record) { @@ -51,6 +46,10 @@ class RocketChatIntegrationHandler { } } + getEngine(integration) { + return integration.scriptEngine === 'isolated-vm' ? this.ivmEngine : this.vm2Engine; + } + removeIntegration(record) { for (const trigger of Object.values(this.triggers)) { delete trigger[record._id]; @@ -67,114 +66,6 @@ class RocketChatIntegrationHandler { return false; } - async updateHistory({ - historyId, - step, - integration, - event, - data, - triggerWord, - ranPrepareScript, - prepareSentMessage, - processSentMessage, - resultMessage, - finished, - url, - httpCallData, - httpError, - httpResult, - error, - errorStack, - }) { - const history = { - type: 'outgoing-webhook', - step, - }; - - // Usually is only added on initial insert - if (integration) { - history.integration = integration; - } - - // Usually is only added on initial insert - if (event) { - history.event = event; - } - - if (data) { - history.data = { ...data }; - - if (data.user) { - history.data.user = omit(data.user, 'services'); - } - - if (data.room) { - history.data.room = data.room; - } - } - - if (triggerWord) { - history.triggerWord = triggerWord; - } - - if (typeof ranPrepareScript !== 'undefined') { - history.ranPrepareScript = ranPrepareScript; - } - - if (prepareSentMessage) { - history.prepareSentMessage = prepareSentMessage; - } - - if (processSentMessage) { - history.processSentMessage = processSentMessage; - } - - if (resultMessage) { - history.resultMessage = resultMessage; - } - - if (typeof finished !== 'undefined') { - history.finished = finished; - } - - if (url) { - history.url = url; - } - - if (typeof httpCallData !== 'undefined') { - history.httpCallData = httpCallData; - } - - if (httpError) { - history.httpError = httpError; - } - - if (typeof httpResult !== 'undefined') { - history.httpResult = JSON.stringify(httpResult, null, 2); - } - - if (typeof error !== 'undefined') { - history.error = error; - } - - if (typeof errorStack !== 'undefined') { - history.errorStack = errorStack; - } - - if (historyId) { - await IntegrationHistory.updateOne({ _id: historyId }, { $set: history }); - return historyId; - } - - history._createdAt = new Date(); - - const _id = Random.id(); - - await IntegrationHistory.insertOne({ _id, ...history }); - - return _id; - } - // Trigger is the trigger, nameOrId is a string which is used to try and find a room, room is a room, message is a message, and data contains "user_name" if trigger.impersonateUser is truthful. async sendMessage({ trigger, nameOrId = '', room, message, data }) { let user; @@ -229,199 +120,6 @@ class RocketChatIntegrationHandler { return message; } - buildSandbox(store = {}) { - const httpAsync = async (method, url, options) => { - try { - return { - result: await httpCall(method, url, options), - }; - } catch (error) { - return { error }; - } - }; - - const sandbox = { - scriptTimeout(reject) { - return setTimeout(() => reject('timed out'), 3000); - }, - _, - s, - console, - moment, - Promise, - Store: { - set: (key, val) => { - store[key] = val; - }, - get: (key) => store[key], - }, - HTTP: (method, url, options) => { - // TODO: deprecate, track and alert - return deasyncPromise(httpAsync(method, url, options)); - }, - // TODO: Export fetch as the non deprecated method - }; - - Object.keys(Models) - .filter((k) => !forbiddenModelMethods.includes(k)) - .forEach((k) => { - sandbox[k] = Models[k]; - }); - - return { store, sandbox }; - } - - getIntegrationScript(integration) { - if (DISABLE_INTEGRATION_SCRIPTS) { - throw new Meteor.Error('integration-scripts-disabled'); - } - - const compiledScript = this.compiledScripts[integration._id]; - if (compiledScript && +compiledScript._updatedAt === +integration._updatedAt) { - return compiledScript.script; - } - - const script = integration.scriptCompiled; - const { store, sandbox } = this.buildSandbox(); - - try { - outgoingLogger.info({ msg: 'Will evaluate script of Trigger', integration: integration.name }); - outgoingLogger.debug(script); - - const vmScript = new VMScript(`${script}; Script;`, 'script.js'); - const vm = new VM({ - sandbox, - }); - - const ScriptClass = vm.run(vmScript); - - if (ScriptClass) { - this.compiledScripts[integration._id] = { - script: new ScriptClass(), - store, - _updatedAt: integration._updatedAt, - }; - - return this.compiledScripts[integration._id].script; - } - } catch (err) { - outgoingLogger.error({ - msg: 'Error evaluating Script in Trigger', - integration: integration.name, - script, - err, - }); - throw new Meteor.Error('error-evaluating-script'); - } - - outgoingLogger.error(`Class "Script" not in Trigger ${integration.name}:`); - throw new Meteor.Error('class-script-not-found'); - } - - hasScriptAndMethod(integration, method) { - if ( - DISABLE_INTEGRATION_SCRIPTS || - integration.scriptEnabled !== true || - !integration.scriptCompiled || - integration.scriptCompiled.trim() === '' - ) { - return false; - } - - let script; - try { - script = this.getIntegrationScript(integration); - } catch (e) { - return false; - } - - return typeof script[method] !== 'undefined'; - } - - async executeScript(integration, method, params, historyId) { - if (DISABLE_INTEGRATION_SCRIPTS) { - return; - } - - let script; - try { - script = this.getIntegrationScript(integration); - } catch (e) { - await this.updateHistory({ - historyId, - step: 'execute-script-getting-script', - error: true, - errorStack: e, - }); - return; - } - - if (!script[method]) { - outgoingLogger.error(`Method "${method}" no found in the Integration "${integration.name}"`); - await this.updateHistory({ historyId, step: `execute-script-no-method-${method}` }); - return; - } - - try { - const { sandbox } = this.buildSandbox(this.compiledScripts[integration._id].store); - sandbox.script = script; - sandbox.method = method; - sandbox.params = params; - - await this.updateHistory({ historyId, step: `execute-script-before-running-${method}` }); - - const vm = new VM({ - timeout: 3000, - sandbox, - }); - - const result = await new Promise((resolve, reject) => { - process.nextTick(async () => { - try { - const scriptResult = await vm.run(` - new Promise((resolve, reject) => { - scriptTimeout(reject); - try { - resolve(script[method](params)) - } catch(e) { - reject(e); - } - }).catch((error) => { throw new Error(error); }); - `); - - resolve(scriptResult); - } catch (e) { - reject(e); - } - }); - }); - - outgoingLogger.debug({ - msg: `Script method "${method}" result of the Integration "${integration.name}" is:`, - result, - }); - - return result; - } catch (err) { - await this.updateHistory({ - historyId, - step: `execute-script-error-running-${method}`, - error: true, - errorStack: err.stack.replace(/^/gm, ' '), - }); - outgoingLogger.error({ - msg: 'Error running Script in the Integration', - integration: integration.name, - err, - }); - outgoingLogger.debug({ - msg: 'Error running Script in the Integration', - integration: integration.name, - script: integration.scriptCompiled, - }); // Only output the compiled script if debugging is enabled, so the logs don't get spammed. - } - } - eventNameArgumentsToObject(...args) { const argObject = { event: args[0], @@ -680,6 +378,17 @@ class RocketChatIntegrationHandler { } } + // Ensure that any errors thrown by the script engine will contibue to be compatible with Meteor.Error + async wrapScriptEngineCall(getter) { + return wrapExceptions(getter).catch((error) => { + if (error instanceof Error) { + throw new Meteor.Error(error.message); + } + + throw error; + }); + } + async executeTriggerUrl(url, trigger, { event, message, room, owner, user }, theHistoryId, tries = 0) { if (!this.isTriggerEnabled(trigger)) { outgoingLogger.warn(`The trigger "${trigger.name}" is no longer enabled, stopping execution of it at try: ${tries}`); @@ -715,7 +424,7 @@ class RocketChatIntegrationHandler { return; } - const historyId = await this.updateHistory({ + const historyId = await updateHistory({ step: 'start-execute-trigger-url', integration: trigger, event, @@ -731,36 +440,32 @@ class RocketChatIntegrationHandler { } this.mapEventArgsToData(data, { trigger, event, message, room, owner, user }); - await this.updateHistory({ historyId, step: 'mapped-args-to-data', data, triggerWord: word }); + await updateHistory({ historyId, step: 'mapped-args-to-data', data, triggerWord: word }); outgoingLogger.info(`Will be executing the Integration "${trigger.name}" to the url: ${url}`); outgoingLogger.debug({ data }); - let opts = { - params: {}, - method: 'POST', - url, - data, - auth: undefined, - headers: { - 'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2227.0 Safari/537.36', - }, - }; + const scriptEngine = this.getEngine(trigger); - if (this.hasScriptAndMethod(trigger, 'prepare_outgoing_request')) { - opts = await this.executeScript(trigger, 'prepare_outgoing_request', { request: opts }, historyId); - } + const opts = await this.wrapScriptEngineCall(() => + scriptEngine.prepareOutgoingRequest({ + integration: trigger, + data, + url, + historyId, + }), + ); - await this.updateHistory({ historyId, step: 'after-maybe-ran-prepare', ranPrepareScript: true }); + await updateHistory({ historyId, step: 'after-maybe-ran-prepare', ranPrepareScript: true }); if (!opts) { - await this.updateHistory({ historyId, step: 'after-prepare-no-opts', finished: true }); + await updateHistory({ historyId, step: 'after-prepare-no-opts', finished: true }); return; } if (opts.message) { const prepareMessage = await this.sendMessage({ trigger, room, message: opts.message, data }); - await this.updateHistory({ + await updateHistory({ historyId, step: 'after-prepare-send-message', prepareSentMessage: prepareMessage, @@ -768,7 +473,7 @@ class RocketChatIntegrationHandler { } if (!opts.url || !opts.method) { - await this.updateHistory({ historyId, step: 'after-prepare-no-url_or_method', finished: true }); + await updateHistory({ historyId, step: 'after-prepare-no-url_or_method', finished: true }); return; } @@ -782,7 +487,7 @@ class RocketChatIntegrationHandler { opts.headers.Authorization = `Basic ${base64}`; } - await this.updateHistory({ + await updateHistory({ historyId, step: 'pre-http-call', url: opts.url, @@ -823,47 +528,42 @@ class RocketChatIntegrationHandler { } })(); - await this.updateHistory({ + await updateHistory({ historyId, step: 'after-http-call', httpError: null, httpResult: content, }); - if (this.hasScriptAndMethod(trigger, 'process_outgoing_response')) { - const sandbox = { + const responseContent = await this.wrapScriptEngineCall(() => + scriptEngine.processOutgoingResponse({ + integration: trigger, request: opts, - response: { - error: null, - status_code: res.status, // These values will be undefined to close issues #4175, #5762, and #5896 - content, - content_raw: content, - headers: Object.fromEntries(res.headers), - }, - }; - - const scriptResult = await this.executeScript(trigger, 'process_outgoing_response', sandbox, historyId); - - if (scriptResult && scriptResult.content) { - const resultMessage = await this.sendMessage({ - trigger, - room, - message: scriptResult.content, - data, - }); - await this.updateHistory({ - historyId, - step: 'after-process-send-message', - processSentMessage: resultMessage, - finished: true, - }); - return; - } + response: res, + content, + historyId, + }), + ); + + if (responseContent) { + const resultMessage = await this.sendMessage({ + trigger, + room, + message: responseContent, + data, + }); + await updateHistory({ + historyId, + step: 'after-process-send-message', + processSentMessage: resultMessage, + finished: true, + }); + return; + } - if (scriptResult === false) { - await this.updateHistory({ historyId, step: 'after-process-false-result', finished: true }); - return; - } + if (responseContent === false) { + await updateHistory({ historyId, step: 'after-process-false-result', finished: true }); + return; } // if the result contained nothing or wasn't a successful statusCode @@ -875,14 +575,14 @@ class RocketChatIntegrationHandler { }); if (res.status === 410) { - await this.updateHistory({ historyId, step: 'after-process-http-status-410', error: true }); + await updateHistory({ historyId, step: 'after-process-http-status-410', error: true }); outgoingLogger.error(`Disabling the Integration "${trigger.name}" because the status code was 401 (Gone).`); await Integrations.updateOne({ _id: trigger._id }, { $set: { enabled: false } }); return; } if (res.status === 500) { - await this.updateHistory({ historyId, step: 'after-process-http-status-500', error: true }); + await updateHistory({ historyId, step: 'after-process-http-status-500', error: true }); outgoingLogger.error({ msg: `Error "500" for the Integration "${trigger.name}" to ${url}.`, content, @@ -893,7 +593,7 @@ class RocketChatIntegrationHandler { if (trigger.retryFailedCalls) { if (tries < trigger.retryCount && trigger.retryDelay) { - await this.updateHistory({ historyId, error: true, step: `going-to-retry-${tries + 1}` }); + await updateHistory({ historyId, error: true, step: `going-to-retry-${tries + 1}` }); let waitTime; @@ -912,7 +612,7 @@ class RocketChatIntegrationHandler { break; default: const er = new Error("The integration's retryDelay setting is invalid."); - await this.updateHistory({ + await updateHistory({ historyId, step: 'failed-and-retry-delay-is-invalid', error: true, @@ -926,10 +626,10 @@ class RocketChatIntegrationHandler { void this.executeTriggerUrl(url, trigger, { event, message, room, owner, user }, historyId, tries + 1); }, waitTime); } else { - await this.updateHistory({ historyId, step: 'too-many-retries', error: true }); + await updateHistory({ historyId, step: 'too-many-retries', error: true }); } } else { - await this.updateHistory({ + await updateHistory({ historyId, step: 'failed-and-not-configured-to-retry', error: true, @@ -943,7 +643,7 @@ class RocketChatIntegrationHandler { if (content && this.successResults.includes(res.status)) { if (data?.text || data?.attachments) { const resultMsg = await this.sendMessage({ trigger, room, message: data, data }); - await this.updateHistory({ + await updateHistory({ historyId, step: 'url-response-sent-message', resultMessage: resultMsg, @@ -954,7 +654,7 @@ class RocketChatIntegrationHandler { }) .catch(async (error) => { outgoingLogger.error(error); - await this.updateHistory({ + await updateHistory({ historyId, step: 'after-http-call', httpError: error, diff --git a/apps/meteor/app/integrations/server/lib/updateHistory.ts b/apps/meteor/app/integrations/server/lib/updateHistory.ts new file mode 100644 index 000000000000..9f7a3017108d --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/updateHistory.ts @@ -0,0 +1,96 @@ +import type { IIntegrationHistory, IIntegration, IMessage, AtLeast } from '@rocket.chat/core-typings'; +import { IntegrationHistory } from '@rocket.chat/models'; +import { Random } from '@rocket.chat/random'; + +import { omit } from '../../../../lib/utils/omit'; + +export const updateHistory = async ({ + historyId, + step, + integration, + event, + data, + triggerWord, + ranPrepareScript, + prepareSentMessage, + processSentMessage, + resultMessage, + finished, + url, + httpCallData, + httpError, + httpResult, + error, + errorStack, +}: { + historyId: IIntegrationHistory['_id']; + step: IIntegrationHistory['step']; + integration?: IIntegration; + event?: string; + triggerWord?: string; + ranPrepareScript?: boolean; + prepareSentMessage?: { channel: string; message: Partial }[]; + processSentMessage?: { channel: string; message: Partial }[]; + resultMessage?: { channel: string; message: Partial }[]; + finished?: boolean; + url?: string; + httpCallData?: Record; // ProcessedOutgoingRequest.data + httpError?: any; // null or whatever error type `fetch` may throw + httpResult?: string | null; + + error?: boolean; + errorStack?: any; // Error | Error['stack'] + + data?: Record; +}) => { + const { user: userData, room: roomData, ...fullData } = data || {}; + + const history: AtLeast = { + type: 'outgoing-webhook', + step, + + // Usually is only added on initial insert + ...(integration ? { integration } : {}), + // Usually is only added on initial insert + ...(event ? { event } : {}), + ...(fullData + ? { + data: { + ...fullData, + ...(userData ? { user: omit(userData, 'services') } : {}), + ...(roomData ? { room: roomData } : {}), + }, + } + : {}), + ...(triggerWord ? { triggerWord } : {}), + ...(typeof ranPrepareScript !== 'undefined' ? { ranPrepareScript } : {}), + ...(prepareSentMessage ? { prepareSentMessage } : {}), + ...(processSentMessage ? { processSentMessage } : {}), + ...(resultMessage ? { resultMessage } : {}), + ...(typeof finished !== 'undefined' ? { finished } : {}), + ...(url ? { url } : {}), + ...(typeof httpCallData !== 'undefined' ? { httpCallData } : {}), + ...(httpError ? { httpError } : {}), + ...(typeof httpResult !== 'undefined' ? { httpResult: JSON.stringify(httpResult, null, 2) } : {}), + ...(typeof error !== 'undefined' ? { error } : {}), + ...(typeof errorStack !== 'undefined' ? { errorStack } : {}), + }; + + if (historyId) { + await IntegrationHistory.updateOne({ _id: historyId }, { $set: history }); + return historyId; + } + + // Can't create a new history without there being an integration + if (!history.integration) { + throw new Error('error-invalid-integration'); + } + + history._createdAt = new Date(); + + const _id = Random.id(); + + await IntegrationHistory.insertOne({ _id, ...history } as IIntegrationHistory); + + return _id; +}; diff --git a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts index d9c2db78b62e..398f81161279 100644 --- a/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/lib/validateOutgoingIntegration.ts @@ -1,19 +1,18 @@ import type { IUser, INewOutgoingIntegration, IOutgoingIntegration, IUpdateOutgoingIntegration } from '@rocket.chat/core-typings'; import { Subscriptions, Users, Rooms } from '@rocket.chat/models'; +import { pick } from '@rocket.chat/tools'; import { Babel } from 'meteor/babel-compiler'; import { Match } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -import _ from 'underscore'; import { parseCSV } from '../../../../lib/utils/parseCSV'; import { hasPermissionAsync, hasAllPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { outgoingEvents } from '../../lib/outgoingEvents'; +import { isScriptEngineFrozen } from './validateScriptEngine'; const scopedChannels = ['all_public_channels', 'all_private_groups', 'all_direct_messages']; const validChannelChars = ['@', '#']; -const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); - function _verifyRequiredFields(integration: INewOutgoingIntegration | IUpdateOutgoingIntegration): void { if ( !integration.event || @@ -152,6 +151,7 @@ export const validateOutgoingIntegration = async function ( const integrationData: IOutgoingIntegration = { ...integration, + scriptEngine: integration.scriptEngine ?? 'isolated-vm', type: 'webhook-outgoing', channel: channels, userId: user._id, @@ -171,7 +171,13 @@ export const validateOutgoingIntegration = async function ( delete integrationData.triggerWords; } - if (!FREEZE_INTEGRATION_SCRIPTS && integration.scriptEnabled === true && integration.script && integration.script.trim() !== '') { + // Only compile the script if it is enabled and using a sandbox that is not frozen + if ( + !isScriptEngineFrozen(integrationData.scriptEngine) && + integration.scriptEnabled === true && + integration.script && + integration.script.trim() !== '' + ) { try { const babelOptions = Object.assign(Babel.getDefaultOptions({ runtime: false }), { compact: true, @@ -183,7 +189,7 @@ export const validateOutgoingIntegration = async function ( integrationData.scriptError = undefined; } catch (e) { integrationData.scriptCompiled = undefined; - integrationData.scriptError = e instanceof Error ? _.pick(e, 'name', 'message', 'stack') : undefined; + integrationData.scriptError = e instanceof Error ? pick(e, 'name', 'message', 'stack') : undefined; } } diff --git a/apps/meteor/app/integrations/server/lib/validateScriptEngine.ts b/apps/meteor/app/integrations/server/lib/validateScriptEngine.ts new file mode 100644 index 000000000000..c20dc9c59427 --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/validateScriptEngine.ts @@ -0,0 +1,26 @@ +import type { IntegrationScriptEngine } from '@rocket.chat/core-typings'; +import { wrapExceptions } from '@rocket.chat/tools'; + +const FREEZE_INTEGRATION_SCRIPTS_VALUE = String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase(); +const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(FREEZE_INTEGRATION_SCRIPTS_VALUE); + +export const validateScriptEngine = (engine?: IntegrationScriptEngine) => { + if (FREEZE_INTEGRATION_SCRIPTS) { + throw new Error('integration-scripts-disabled'); + } + + const engineCode = engine === 'isolated-vm' ? 'ivm' : 'vm2'; + + if (engineCode === FREEZE_INTEGRATION_SCRIPTS_VALUE) { + if (engineCode === 'ivm') { + throw new Error('integration-scripts-isolated-vm-disabled'); + } + + throw new Error('integration-scripts-vm2-disabled'); + } + + return true; +}; + +export const isScriptEngineFrozen = (engine?: IntegrationScriptEngine) => + wrapExceptions(() => !validateScriptEngine(engine)).catch(() => true); diff --git a/apps/meteor/app/integrations/server/lib/vm2/buildSandbox.ts b/apps/meteor/app/integrations/server/lib/vm2/buildSandbox.ts new file mode 100644 index 000000000000..9ba74404cf26 --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/vm2/buildSandbox.ts @@ -0,0 +1,88 @@ +import * as Models from '@rocket.chat/models'; +import moment from 'moment'; +import _ from 'underscore'; + +import * as s from '../../../../../lib/utils/stringUtils'; +import { deasyncPromise } from '../../../../../server/deasync/deasync'; +import { httpCall } from '../../../../../server/lib/http/call'; + +const forbiddenModelMethods: readonly (keyof typeof Models)[] = ['registerModel', 'getCollectionName']; + +type ModelName = Exclude; + +export type Vm2Sandbox = { + scriptTimeout: (reject: (reason?: any) => void) => ReturnType; + _: typeof _; + s: typeof s; + console: typeof console; + moment: typeof moment; + Promise: typeof Promise; + Store: { + set: IsIncoming extends true ? (key: string, value: any) => any : (key: string, value: any) => void; + get: (key: string) => any; + }; + HTTP: (method: string, url: string, options: Record) => unknown; +} & (IsIncoming extends true ? { Livechat: undefined } : never) & + Record; + +export const buildSandbox = ( + store: Record, + isIncoming?: IsIncoming, +): { + store: Record; + sandbox: Vm2Sandbox; +} => { + const httpAsync = async (method: string, url: string, options: Record) => { + try { + return { + result: await httpCall(method, url, options), + }; + } catch (error) { + return { error }; + } + }; + + const sandbox = { + scriptTimeout(reject: (reason?: any) => void) { + return setTimeout(() => reject('timed out'), 3000); + }, + _, + s, + console, + moment, + Promise, + // There's a small difference between the sandbox that is sent to incoming and to outgoing scripts + // Technically we could unify this but since we're deprecating vm2 anyway I'm keeping this old behavior here until the feature is removed completely + ...(isIncoming + ? { + Livechat: undefined, + Store: { + set: (key: string, val: any): any => { + store[key] = val; + return val; + }, + get: (key: string) => store[key], + }, + } + : { + Store: { + set: (key: string, val: any): void => { + store[key] = val; + }, + get: (key: string) => store[key], + }, + }), + HTTP: (method: string, url: string, options: Record) => { + // TODO: deprecate, track and alert + return deasyncPromise(httpAsync(method, url, options)); + }, + } as Vm2Sandbox; + + (Object.keys(Models) as ModelName[]) + .filter((k) => !forbiddenModelMethods.includes(k)) + .forEach((k) => { + sandbox[k] = Models[k]; + }); + + return { store, sandbox }; +}; diff --git a/apps/meteor/app/integrations/server/lib/vm2/vm2.ts b/apps/meteor/app/integrations/server/lib/vm2/vm2.ts new file mode 100644 index 000000000000..5f7519d69346 --- /dev/null +++ b/apps/meteor/app/integrations/server/lib/vm2/vm2.ts @@ -0,0 +1,111 @@ +import type { IIntegration } from '@rocket.chat/core-typings'; +import { VM, VMScript } from 'vm2'; + +import { IntegrationScriptEngine } from '../ScriptEngine'; +import type { IScriptClass } from '../definition'; +import { buildSandbox, type Vm2Sandbox } from './buildSandbox'; + +const DISABLE_INTEGRATION_SCRIPTS = ['yes', 'true', 'vm2'].includes(String(process.env.DISABLE_INTEGRATION_SCRIPTS).toLowerCase()); + +export class VM2ScriptEngine extends IntegrationScriptEngine { + protected isDisabled(): boolean { + return DISABLE_INTEGRATION_SCRIPTS; + } + + protected buildSandbox(store: Record = {}): { store: Record; sandbox: Vm2Sandbox } { + return buildSandbox(store, this.incoming); + } + + protected async runScriptMethod({ + integrationId, + script, + method, + params, + }: { + integrationId: IIntegration['_id']; + script: IScriptClass; + method: keyof IScriptClass; + params: Record; + }): Promise { + const { sandbox } = this.buildSandbox(this.compiledScripts[integrationId].store); + + const vm = new VM({ + timeout: 3000, + sandbox: { + ...sandbox, + script, + method, + params, + ...(this.incoming && 'request' in params ? { request: params.request } : {}), + }, + }); + + return new Promise((resolve, reject) => { + process.nextTick(async () => { + try { + const scriptResult = await vm.run(` + new Promise((resolve, reject) => { + scriptTimeout(reject); + try { + resolve(script[method](params)) + } catch(e) { + reject(e); + } + }).catch((error) => { throw new Error(error); }); + `); + + resolve(scriptResult); + } catch (e) { + reject(e); + } + }); + }); + } + + protected async getIntegrationScript(integration: IIntegration): Promise> { + if (this.disabled) { + throw new Error('integration-scripts-disabled'); + } + + const compiledScript = this.compiledScripts[integration._id]; + if (compiledScript && +compiledScript._updatedAt === +integration._updatedAt) { + return compiledScript.script; + } + + const script = integration.scriptCompiled; + const { store, sandbox } = this.buildSandbox(); + + try { + this.logger.info({ msg: 'Will evaluate script of Trigger', integration: integration.name }); + this.logger.debug(script); + + const vmScript = new VMScript(`${script}; Script;`, 'script.js'); + const vm = new VM({ + sandbox, + }); + + const ScriptClass = vm.run(vmScript); + + if (ScriptClass) { + this.compiledScripts[integration._id] = { + script: new ScriptClass(), + store, + _updatedAt: integration._updatedAt, + }; + + return this.compiledScripts[integration._id].script; + } + } catch (err) { + this.logger.error({ + msg: 'Error evaluating Script in Trigger', + integration: integration.name, + script, + err, + }); + throw new Error('error-evaluating-script'); + } + + this.logger.error({ msg: 'Class "Script" not in Trigger', integration: integration.name }); + throw new Error('class-script-not-found'); + } +} diff --git a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts index bf84957ba8ea..45548a17a565 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/addIncomingIntegration.ts @@ -8,11 +8,10 @@ import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import { hasPermissionAsync, hasAllPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; +import { validateScriptEngine, isScriptEngineFrozen } from '../../lib/validateScriptEngine'; const validChannelChars = ['@', '#']; -const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); - declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { @@ -32,6 +31,7 @@ export const addIncomingIntegration = async (userId: string, integration: INewIn alias: Match.Maybe(String), emoji: Match.Maybe(String), scriptEnabled: Boolean, + scriptEngine: Match.Maybe(String), overrideDestinationChannelEnabled: Match.Maybe(Boolean), script: Match.Maybe(String), avatar: Match.Maybe(String), @@ -76,8 +76,8 @@ export const addIncomingIntegration = async (userId: string, integration: INewIn }); } - if (FREEZE_INTEGRATION_SCRIPTS && integration.script?.trim()) { - throw new Meteor.Error('integration-scripts-disabled'); + if (integration.script?.trim()) { + validateScriptEngine(integration.scriptEngine ?? 'isolated-vm'); } const user = await Users.findOne({ username: integration.username }); @@ -90,6 +90,7 @@ export const addIncomingIntegration = async (userId: string, integration: INewIn const integrationData: IIncomingIntegration = { ...integration, + scriptEngine: integration.scriptEngine ?? 'isolated-vm', type: 'webhook-incoming', channel: channels, overrideDestinationChannelEnabled: integration.overrideDestinationChannelEnabled ?? false, @@ -99,7 +100,13 @@ export const addIncomingIntegration = async (userId: string, integration: INewIn _createdBy: await Users.findOne({ _id: userId }, { projection: { username: 1 } }), }; - if (integration.scriptEnabled === true && integration.script && integration.script.trim() !== '') { + // Only compile the script if it is enabled and using a sandbox that is not frozen + if ( + !isScriptEngineFrozen(integrationData.scriptEngine) && + integration.scriptEnabled === true && + integration.script && + integration.script.trim() !== '' + ) { try { let babelOptions = Babel.getDefaultOptions({ runtime: false }); babelOptions = _.extend(babelOptions, { compact: true, minified: true, comments: false }); diff --git a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts index b865c72e0cca..5358e3233ce7 100644 --- a/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/incoming/updateIncomingIntegration.ts @@ -1,16 +1,16 @@ import type { IIntegration, INewIncomingIntegration, IUpdateIncomingIntegration } from '@rocket.chat/core-typings'; import { Integrations, Roles, Subscriptions, Users, Rooms } from '@rocket.chat/models'; +import { wrapExceptions } from '@rocket.chat/tools'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Babel } from 'meteor/babel-compiler'; import { Meteor } from 'meteor/meteor'; import _ from 'underscore'; import { hasAllPermissionAsync, hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; +import { isScriptEngineFrozen, validateScriptEngine } from '../../lib/validateScriptEngine'; const validChannelChars = ['@', '#']; -const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); - declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { @@ -66,11 +66,20 @@ Meteor.methods({ }); } - if (FREEZE_INTEGRATION_SCRIPTS) { - if (currentIntegration.script?.trim() !== integration.script?.trim()) { - throw new Meteor.Error('integration-scripts-disabled'); - } - } else { + const oldScriptEngine = currentIntegration.scriptEngine ?? 'vm2'; + const scriptEngine = integration.scriptEngine ?? oldScriptEngine; + if ( + integration.script?.trim() && + (scriptEngine !== oldScriptEngine || integration.script?.trim() !== currentIntegration.script?.trim()) + ) { + wrapExceptions(() => validateScriptEngine(scriptEngine)).catch((e) => { + throw new Meteor.Error(e.message); + }); + } + + const isFrozen = isScriptEngineFrozen(scriptEngine); + + if (!isFrozen) { let scriptCompiled: string | undefined; let scriptError: Pick | undefined; @@ -165,11 +174,12 @@ Meteor.methods({ emoji: integration.emoji, alias: integration.alias, channel: channels, - ...(FREEZE_INTEGRATION_SCRIPTS + ...(isFrozen ? {} : { script: integration.script, scriptEnabled: integration.scriptEnabled, + scriptEngine, }), ...(typeof integration.overrideDestinationChannelEnabled !== 'undefined' && { overrideDestinationChannelEnabled: integration.overrideDestinationChannelEnabled, diff --git a/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts b/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts index 9e5d29261b36..59879f99d475 100644 --- a/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/outgoing/addOutgoingIntegration.ts @@ -6,6 +6,7 @@ import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; import { validateOutgoingIntegration } from '../../lib/validateOutgoingIntegration'; +import { validateScriptEngine } from '../../lib/validateScriptEngine'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -14,8 +15,6 @@ declare module '@rocket.chat/ui-contexts' { } } -const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); - export const addOutgoingIntegration = async (userId: string, integration: INewOutgoingIntegration): Promise => { check( integration, @@ -29,6 +28,7 @@ export const addOutgoingIntegration = async (userId: string, integration: INewOu emoji: Match.Maybe(String), scriptEnabled: Boolean, script: Match.Maybe(String), + scriptEngine: Match.Maybe(String), urls: Match.Maybe([String]), event: Match.Maybe(String), triggerWords: Match.Maybe([String]), @@ -52,8 +52,8 @@ export const addOutgoingIntegration = async (userId: string, integration: INewOu throw new Meteor.Error('not_authorized'); } - if (FREEZE_INTEGRATION_SCRIPTS && integration.script?.trim()) { - throw new Meteor.Error('integration-scripts-disabled'); + if (integration.script?.trim()) { + validateScriptEngine(integration.scriptEngine ?? 'isolated-vm'); } const integrationData = await validateOutgoingIntegration(integration, userId); diff --git a/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts index 166badee823d..9e62561ebf9a 100644 --- a/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts @@ -1,10 +1,12 @@ import type { IIntegration, INewOutgoingIntegration, IUpdateOutgoingIntegration } from '@rocket.chat/core-typings'; import { Integrations, Users } from '@rocket.chat/models'; +import { wrapExceptions } from '@rocket.chat/tools'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; import { validateOutgoingIntegration } from '../../lib/validateOutgoingIntegration'; +import { isScriptEngineFrozen, validateScriptEngine } from '../../lib/validateScriptEngine'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -16,8 +18,6 @@ declare module '@rocket.chat/ui-contexts' { } } -const FREEZE_INTEGRATION_SCRIPTS = ['yes', 'true'].includes(String(process.env.FREEZE_INTEGRATION_SCRIPTS).toLowerCase()); - Meteor.methods({ async updateOutgoingIntegration(integrationId, _integration) { if (!this.userId) { @@ -53,10 +53,19 @@ Meteor.methods({ throw new Meteor.Error('invalid_integration', '[methods] updateOutgoingIntegration -> integration not found'); } - if (FREEZE_INTEGRATION_SCRIPTS && integration.script?.trim() !== currentIntegration.script?.trim()) { - throw new Meteor.Error('integration-scripts-disabled'); + const oldScriptEngine = currentIntegration.scriptEngine ?? 'vm2'; + const scriptEngine = integration.scriptEngine ?? oldScriptEngine; + if ( + integration.script?.trim() && + (scriptEngine !== oldScriptEngine || integration.script?.trim() !== currentIntegration.script?.trim()) + ) { + wrapExceptions(() => validateScriptEngine(scriptEngine)).catch((e) => { + throw new Meteor.Error(e.message); + }); } + const isFrozen = isScriptEngineFrozen(scriptEngine); + await Integrations.updateOne( { _id: integrationId }, { @@ -74,11 +83,12 @@ Meteor.methods({ userId: integration.userId, urls: integration.urls, token: integration.token, - ...(FREEZE_INTEGRATION_SCRIPTS + ...(isFrozen ? {} : { script: integration.script, scriptEnabled: integration.scriptEnabled, + scriptEngine, ...(integration.scriptCompiled ? { scriptCompiled: integration.scriptCompiled } : { scriptError: integration.scriptError }), }), triggerWords: integration.triggerWords, @@ -90,7 +100,7 @@ Meteor.methods({ _updatedAt: new Date(), _updatedBy: await Users.findOne({ _id: this.userId }, { projection: { username: 1 } }), }, - ...(FREEZE_INTEGRATION_SCRIPTS + ...(isFrozen ? {} : { $unset: { diff --git a/apps/meteor/client/views/admin/integrations/IncomingWebhookForm.js b/apps/meteor/client/views/admin/integrations/IncomingWebhookForm.js index 94bbd156b86c..ae4d4fa411b5 100644 --- a/apps/meteor/client/views/admin/integrations/IncomingWebhookForm.js +++ b/apps/meteor/client/views/admin/integrations/IncomingWebhookForm.js @@ -1,4 +1,4 @@ -import { Field, TextInput, Box, ToggleSwitch, Icon, TextAreaInput, FieldGroup, Margins } from '@rocket.chat/fuselage'; +import { Field, TextInput, Box, ToggleSwitch, Icon, TextAreaInput, FieldGroup, Margins, Select } from '@rocket.chat/fuselage'; import { useAbsoluteUrl, useTranslation } from '@rocket.chat/ui-contexts'; import React, { useMemo, useCallback } from 'react'; @@ -11,7 +11,8 @@ export default function IncomingWebhookForm({ formValues, formHandlers, extraDat const absoluteUrl = useAbsoluteUrl(); - const { enabled, channel, username, name, alias, avatar, emoji, scriptEnabled, script, overrideDestinationChannelEnabled } = formValues; + const { enabled, channel, username, name, alias, avatar, emoji, scriptEnabled, script, scriptEngine, overrideDestinationChannelEnabled } = + formValues; const { handleEnabled, @@ -24,6 +25,7 @@ export default function IncomingWebhookForm({ formValues, formHandlers, extraDat handleScriptEnabled, handleOverrideDestinationChannelEnabled, handleScript, + handleScriptEngine, } = formHandlers; const url = absoluteUrl(`hooks/${extraData._id}/${extraData.token}`); @@ -42,6 +44,14 @@ export default function IncomingWebhookForm({ formValues, formHandlers, extraDat url, }); + const scriptEngineOptions = useMemo( + () => [ + ['vm2', t('Script_Engine_vm2')], + ['isolated-vm', t('Script_Engine_isolated_vm')], + ], + [t], + ); + const hilightedExampleJson = useHighlightedCode('json', JSON.stringify(exampleData, null, 2)); return ( @@ -172,6 +182,18 @@ export default function IncomingWebhookForm({ formValues, formHandlers, extraDat ), [t, scriptEnabled, handleScriptEnabled], )} + {useMemo( + () => ( + + {t('Script_Engine')} + + + + {t('Script_Engine_Description')} + + ), + [scriptEngine, scriptEngineOptions, handleScriptEngine, t], + )} {useMemo( () => ( diff --git a/apps/meteor/client/views/admin/integrations/edit/EditIncomingWebhook.js b/apps/meteor/client/views/admin/integrations/edit/EditIncomingWebhook.js index cbe3c3e5377d..e785f63ca29d 100644 --- a/apps/meteor/client/views/admin/integrations/edit/EditIncomingWebhook.js +++ b/apps/meteor/client/views/admin/integrations/edit/EditIncomingWebhook.js @@ -17,6 +17,7 @@ const getInitialValue = (data) => { avatar: data.avatar ?? '', emoji: data.emoji ?? '', scriptEnabled: data.scriptEnabled, + scriptEngine: data.scriptEngine ?? 'vm2', overrideDestinationChannelEnabled: data.overrideDestinationChannelEnabled, script: data.script, }; diff --git a/apps/meteor/client/views/admin/integrations/edit/EditOutgoingWebhook.js b/apps/meteor/client/views/admin/integrations/edit/EditOutgoingWebhook.js index 1734f32968c9..383b9209519d 100644 --- a/apps/meteor/client/views/admin/integrations/edit/EditOutgoingWebhook.js +++ b/apps/meteor/client/views/admin/integrations/edit/EditOutgoingWebhook.js @@ -24,6 +24,7 @@ const getInitialValue = (data) => { avatar: data.avatar ?? '', emoji: data.emoji ?? '', scriptEnabled: data.scriptEnabled ?? false, + scriptEngine: data.scriptEngine ?? 'vm2', script: data.script ?? '', retryFailedCalls: data.retryFailedCalls ?? true, retryCount: data.retryCount ?? 5, diff --git a/apps/meteor/client/views/admin/integrations/new/NewIncomingWebhook.js b/apps/meteor/client/views/admin/integrations/new/NewIncomingWebhook.js index 019dc6d0d730..7b4e0880e57f 100644 --- a/apps/meteor/client/views/admin/integrations/new/NewIncomingWebhook.js +++ b/apps/meteor/client/views/admin/integrations/new/NewIncomingWebhook.js @@ -15,6 +15,7 @@ const initialState = { avatar: '', emoji: '', scriptEnabled: false, + scriptEngine: 'isolated-vm', overrideDestinationChannelEnabled: false, script: '', }; diff --git a/apps/meteor/client/views/admin/integrations/new/NewOutgoingWebhook.js b/apps/meteor/client/views/admin/integrations/new/NewOutgoingWebhook.js index 818082f5f5de..153dc4c6eb7f 100644 --- a/apps/meteor/client/views/admin/integrations/new/NewOutgoingWebhook.js +++ b/apps/meteor/client/views/admin/integrations/new/NewOutgoingWebhook.js @@ -23,6 +23,7 @@ const defaultData = { avatar: '', emoji: '', scriptEnabled: false, + scriptEngine: 'isolated-vm', script: '', retryFailedCalls: true, retryCount: 6, diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 0b9e59ae3db0..61a2dcdd30d3 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -346,6 +346,7 @@ "imap": "^0.8.19", "ip-range-check": "^0.2.0", "is-svg": "^4.3.2", + "isolated-vm": "4.4.2", "jquery": "^3.6.0", "jschardet": "^3.0.0", "jsdom": "^16.7.0", diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index a0f6d0e0c6a8..13a0e561739b 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -2610,6 +2610,8 @@ "Integration_Incoming_WebHook": "Incoming WebHook Integration", "Integration_New": "New Integration", "integration-scripts-disabled": "Integration Scripts are Disabled", + "integration-scripts-isolated-vm-disabled": "The \"Secure Sandbox\" may not be used on new or modified scripts.", + "integration-scripts-vm2-disabled": "The \"Compatible Sandbox\" may not be used on new or modified scripts.", "Integration_Outgoing_WebHook": "Outgoing WebHook Integration", "Integration_Outgoing_WebHook_History": "Outgoing WebHook Integration History", "Integration_Outgoing_WebHook_History_Data_Passed_To_Trigger": "Data Passed to Integration", @@ -4515,6 +4517,10 @@ "Screen_Share": "Screen Share", "Script": "Script", "Script_Enabled": "Script Enabled", + "Script_Engine": "Script Sandbox", + "Script_Engine_Description": "Older scripts may require the compatible sandbox to run properly, but all new scripts should try to use the secure sandbox instead.", + "Script_Engine_vm2": "Compatible Sandbox (Deprecated)", + "Script_Engine_isolated_vm": "Secure Sandbox", "Search": "Search", "Searchable": "Searchable", "Search_Apps": "Search apps", diff --git a/packages/core-typings/src/IIntegration.ts b/packages/core-typings/src/IIntegration.ts index 6b99424264b2..cffff75767f4 100644 --- a/packages/core-typings/src/IIntegration.ts +++ b/packages/core-typings/src/IIntegration.ts @@ -1,6 +1,8 @@ import type { IRocketChatRecord } from './IRocketChatRecord'; import type { IUser } from './IUser'; +export type IntegrationScriptEngine = 'vm2' | 'isolated-vm'; + export interface IIncomingIntegration extends IRocketChatRecord { type: 'webhook-incoming'; _createdBy: Pick | null; @@ -22,6 +24,8 @@ export interface IIncomingIntegration extends IRocketChatRecord { alias?: string; avatar?: string; emoji?: string; + + scriptEngine?: IntegrationScriptEngine; } export type OutgoingIntegrationEvent = @@ -65,6 +69,8 @@ export interface IOutgoingIntegration extends IRocketChatRecord { alias?: string; avatar?: string; emoji?: string; + + scriptEngine?: IntegrationScriptEngine; } export type IIntegration = IIncomingIntegration | IOutgoingIntegration; diff --git a/packages/core-typings/src/IIntegrationHistory.ts b/packages/core-typings/src/IIntegrationHistory.ts index 6297cd7d74a0..6594d611fb49 100644 --- a/packages/core-typings/src/IIntegrationHistory.ts +++ b/packages/core-typings/src/IIntegrationHistory.ts @@ -1,3 +1,4 @@ +import type { IMessage } from './IMessage'; import type { IRocketChatRecord } from './IRocketChatRecord'; export interface IIntegrationHistory extends IRocketChatRecord { @@ -17,10 +18,10 @@ export interface IIntegrationHistory extends IRocketChatRecord { finished: boolean; triggerWord?: string; - prepareSentMessage?: string; - processSentMessage?: string; + prepareSentMessage?: { channel: string; message: Partial }[]; + processSentMessage?: { channel: string; message: Partial }[]; url?: string; - httpCallData?: string; + httpCallData?: Record; httpError?: any; httpResult?: string; error?: any; diff --git a/packages/rest-typings/src/v1/integrations/IntegrationsCreateProps.ts b/packages/rest-typings/src/v1/integrations/IntegrationsCreateProps.ts index e9ef650656cd..249a12096729 100644 --- a/packages/rest-typings/src/v1/integrations/IntegrationsCreateProps.ts +++ b/packages/rest-typings/src/v1/integrations/IntegrationsCreateProps.ts @@ -1,4 +1,4 @@ -import type { OutgoingIntegrationEvent } from '@rocket.chat/core-typings'; +import type { OutgoingIntegrationEvent, IntegrationScriptEngine } from '@rocket.chat/core-typings'; import Ajv from 'ajv'; const ajv = new Ajv(); @@ -16,6 +16,7 @@ export type IntegrationsCreateProps = alias?: string; avatar?: string; emoji?: string; + scriptEngine?: IntegrationScriptEngine; } | { type: 'webhook-outgoing'; @@ -44,6 +45,7 @@ export type IntegrationsCreateProps = alias?: string; avatar?: string; emoji?: string; + scriptEngine?: IntegrationScriptEngine; }; const integrationsCreateSchema = { @@ -96,6 +98,10 @@ const integrationsCreateSchema = { type: 'string', nullable: true, }, + scriptEngine: { + type: 'string', + nullable: true, + }, }, required: ['type', 'username', 'channel', 'scriptEnabled', 'name', 'enabled'], additionalProperties: false, @@ -196,6 +202,10 @@ const integrationsCreateSchema = { type: 'string', nullable: true, }, + scriptEngine: { + type: 'string', + nullable: true, + }, }, required: ['type', 'username', 'channel', 'event', 'scriptEnabled', 'name', 'enabled'], additionalProperties: false, diff --git a/packages/tools/src/index.ts b/packages/tools/src/index.ts index 261823100d0a..b8bc90d9cb54 100644 --- a/packages/tools/src/index.ts +++ b/packages/tools/src/index.ts @@ -1,3 +1,4 @@ export * from './pick'; export * from './timezone'; export * from './stream'; +export * from './wrapExceptions'; diff --git a/packages/tools/src/wrapExceptions.ts b/packages/tools/src/wrapExceptions.ts new file mode 100644 index 000000000000..bd830a92bfeb --- /dev/null +++ b/packages/tools/src/wrapExceptions.ts @@ -0,0 +1,46 @@ +const isPromise = (value: unknown): value is Promise => !!value && value instanceof Promise; + +export function wrapExceptions( + getter: () => T, +): { + catch: (errorWrapper: (error: any) => T) => T; + suppress: (errorWrapper?: (error: any) => void) => T | undefined; +}; +export function wrapExceptions( + getter: () => Promise, +): { + catch: (errorWrapper: (error: any) => T | Awaited) => Promise; + suppress: (errorWrapper?: (error: any) => void) => Promise; +}; +export function wrapExceptions(getter: () => T) { + const doCatch = (errorWrapper: (error: any) => T | Awaited): T => { + try { + const value = getter(); + if (isPromise(value)) { + return value.catch(errorWrapper) as T; + } + + return value; + } catch (error) { + return errorWrapper(error); + } + }; + + const doSuppress = (errorWrapper?: (error: any) => void) => { + try { + const value = getter(); + if (isPromise(value)) { + return value.catch((error) => errorWrapper?.(error)); + } + + return value; + } catch (error) { + errorWrapper?.(error); + } + }; + + return { + catch: doCatch, + suppress: doSuppress, + }; +} diff --git a/yarn.lock b/yarn.lock index 68f3e35dfe0b..c1a7df2ea184 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8786,6 +8786,7 @@ __metadata: imap: ^0.8.19 ip-range-check: ^0.2.0 is-svg: ^4.3.2 + isolated-vm: 4.4.2 jest: ~29.6.1 jquery: ^3.6.0 jschardet: ^3.0.0 @@ -25314,6 +25315,15 @@ __metadata: languageName: node linkType: hard +"isolated-vm@npm:4.4.2": + version: 4.4.2 + resolution: "isolated-vm@npm:4.4.2" + dependencies: + node-gyp: latest + checksum: 86d12d96f90ceef74a3fc096439c71b0c115235ae3053d600eb8f7c678443d9ca3c8a2805dcd7f97463d11eb7d2e667868946b90e377a3e6d50fdd4085506fbc + languageName: node + linkType: hard + "isomorphic-unfetch@npm:^3.1.0": version: 3.1.0 resolution: "isomorphic-unfetch@npm:3.1.0" From a9af6b182af45ce4dd0f3eb26a51dfe12a803a6b Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Tue, 26 Sep 2023 23:47:12 +0000 Subject: [PATCH 199/275] Release 6.3.8 [no ci] --- .changeset/bump-patch-1695309507614.md | 5 ---- apps/meteor/.docker/Dockerfile.rhel | 2 +- apps/meteor/CHANGELOG.md | 25 +++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 10 ++++++++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 10 ++++++++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 10 ++++++++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 12 +++++++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 11 ++++++++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 10 ++++++++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 10 ++++++++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 9 +++++++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 7 ++++++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 7 ++++++ ee/packages/ddp-client/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 11 ++++++++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 6 +++++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 8 ++++++ ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 8 ++++++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 2 ++ packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 7 ++++++ packages/cron/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 8 ++++++ packages/fuselage-ui-kit/package.json | 6 ++--- packages/gazzodown/CHANGELOG.md | 8 ++++++ packages/gazzodown/package.json | 8 +++--- packages/instance-status/CHANGELOG.md | 6 +++++ packages/instance-status/package.json | 2 +- packages/model-typings/CHANGELOG.md | 6 +++++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 6 +++++ packages/models/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 6 +++++ packages/rest-typings/package.json | 2 +- packages/ui-client/CHANGELOG.md | 6 +++++ packages/ui-client/package.json | 4 +-- packages/ui-contexts/CHANGELOG.md | 8 ++++++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 6 +++++ packages/ui-video-conf/package.json | 4 +-- packages/uikit-playground/CHANGELOG.md | 7 ++++++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 6 +++++ packages/web-ui-registration/package.json | 4 +-- 60 files changed, 275 insertions(+), 44 deletions(-) delete mode 100644 .changeset/bump-patch-1695309507614.md diff --git a/.changeset/bump-patch-1695309507614.md b/.changeset/bump-patch-1695309507614.md deleted file mode 100644 index e1eaa7980afb..000000000000 --- a/.changeset/bump-patch-1695309507614.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Bump @rocket.chat/meteor version. diff --git a/apps/meteor/.docker/Dockerfile.rhel b/apps/meteor/.docker/Dockerfile.rhel index d3e487d58732..6a03bde90b43 100644 --- a/apps/meteor/.docker/Dockerfile.rhel +++ b/apps/meteor/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 6.3.7 +ENV RC_VERSION 6.3.8 MAINTAINER buildmaster@rocket.chat diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index 96d6fff6050b..76b1bde2a41d 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,30 @@ # @rocket.chat/meteor +## 6.3.8 + +### Patch Changes + +- ff8e9d9f54: Bump @rocket.chat/meteor version. +- Bump @rocket.chat/meteor version. + - @rocket.chat/core-typings@6.3.8 + - @rocket.chat/rest-typings@6.3.8 + - @rocket.chat/api-client@0.1.8 + - @rocket.chat/omnichannel-services@0.0.14 + - @rocket.chat/pdf-worker@0.0.14 + - @rocket.chat/presence@0.0.14 + - @rocket.chat/core-services@0.1.8 + - @rocket.chat/cron@0.0.10 + - @rocket.chat/gazzodown@1.0.8 + - @rocket.chat/model-typings@0.0.14 + - @rocket.chat/ui-contexts@1.0.8 + - @rocket.chat/fuselage-ui-kit@1.0.8 + - @rocket.chat/models@0.0.14 + - @rocket.chat/ui-theming@0.0.1 + - @rocket.chat/ui-client@1.0.8 + - @rocket.chat/ui-video-conf@1.0.8 + - @rocket.chat/web-ui-registration@1.0.8 + - @rocket.chat/instance-status@0.0.14 + ## 6.3.7 ### Patch Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index b935af1f7ffb..e80339378932 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.3.7" + "version": "6.3.8" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index 23b4cd06356b..0423888acedd 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,15 @@ # rocketchat-services +## 1.1.8 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/rest-typings@6.3.8 +- @rocket.chat/core-services@0.1.8 +- @rocket.chat/model-typings@0.0.14 +- @rocket.chat/models@0.0.14 + ## 1.1.7 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 0c5852eb93ec..871a1d587582 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.7", + "version": "1.1.8", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index b74c2f132ff0..70f863f88d53 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.3.7", + "version": "6.3.8", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index 9c51b05fd23f..12ad487ad694 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/account-service +## 0.2.8 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/rest-typings@6.3.8 +- @rocket.chat/core-services@0.1.8 +- @rocket.chat/model-typings@0.0.14 +- @rocket.chat/models@0.0.14 + ## 0.2.7 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index b4ac82ad1e7a..2fef755e2478 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.2.7", + "version": "0.2.8", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index 7a8af00bc19f..5c155a6ca6e0 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/authorization-service +## 0.2.8 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/rest-typings@6.3.8 +- @rocket.chat/core-services@0.1.8 +- @rocket.chat/model-typings@0.0.14 +- @rocket.chat/models@0.0.14 + ## 0.2.7 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index 62aa5e90fb0e..16d39c27f036 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.2.7", + "version": "0.2.8", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index 9aaca27d880c..042ada78382a 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,17 @@ # @rocket.chat/ddp-streamer +## 0.1.8 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/rest-typings@6.3.8 +- @rocket.chat/core-services@0.1.8 +- @rocket.chat/model-typings@0.0.14 +- @rocket.chat/ui-contexts@1.0.8 +- @rocket.chat/models@0.0.14 +- @rocket.chat/instance-status@0.0.14 + ## 0.1.7 ### Patch Changes diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 30536fcb016a..6891da00a587 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.1.7", + "version": "0.1.8", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index b80c4c4326cf..73f000698a12 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-transcript +## 0.2.8 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/omnichannel-services@0.0.14 +- @rocket.chat/pdf-worker@0.0.14 +- @rocket.chat/core-services@0.1.8 +- @rocket.chat/model-typings@0.0.14 +- @rocket.chat/models@0.0.14 + ## 0.2.7 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index 3d4a7b94660e..7dd97a67b58c 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.2.7", + "version": "0.2.8", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index dda3e011bcd3..e2b8e63de419 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/presence-service +## 0.2.8 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/presence@0.0.14 +- @rocket.chat/core-services@0.1.8 +- @rocket.chat/model-typings@0.0.14 +- @rocket.chat/models@0.0.14 + ## 0.2.7 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index a62c0ca13e30..b21031143b1b 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.2.7", + "version": "0.2.8", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index 9815146e9473..1939b1a7988f 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/queue-worker +## 0.2.8 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/omnichannel-services@0.0.14 +- @rocket.chat/core-services@0.1.8 +- @rocket.chat/model-typings@0.0.14 +- @rocket.chat/models@0.0.14 + ## 0.2.7 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index d387cbacf672..e7546d39cb46 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.2.7", + "version": "0.2.8", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index fb085d7f33f6..b665f10ec623 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/stream-hub-service +## 0.2.8 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/core-services@0.1.8 +- @rocket.chat/model-typings@0.0.14 +- @rocket.chat/models@0.0.14 + ## 0.2.7 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index 8c63d9139f58..3f19f777afb5 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.2.7", + "version": "0.2.8", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index b2319217ca04..69b7e51ea9de 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/api-client +## 0.1.8 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/rest-typings@6.3.8 + ## 0.1.7 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index f495aad8c2cc..ef05cebbbe4f 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/api-client", - "version": "0.1.7", + "version": "0.1.8", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index b2688046c3b4..4e249823d797 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/ddp-client +## 0.1.8 + +### Patch Changes + +- @rocket.chat/rest-typings@6.3.8 +- @rocket.chat/api-client@0.1.8 + ## 0.1.7 ### Patch Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index 2a3d6781604d..277e608d887a 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ddp-client", - "version": "0.1.7", + "version": "0.1.8", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index 571b5a37d8c8..6aa6b5a67fdc 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/omnichannel-services +## 0.0.14 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/rest-typings@6.3.8 +- @rocket.chat/pdf-worker@0.0.14 +- @rocket.chat/core-services@0.1.8 +- @rocket.chat/model-typings@0.0.14 +- @rocket.chat/models@0.0.14 + ## 0.0.13 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 6e8febc74c5c..ef00d4926635 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.0.13", + "version": "0.0.14", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index 455f7a1c812a..84a8fadb9608 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/pdf-worker +## 0.0.14 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 + ## 0.0.13 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index bead0f932479..c7d9fe142cb1 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.13", + "version": "0.0.14", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index 1f016c3444f3..7bf2a5bbf53f 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/presence +## 0.0.14 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/core-services@0.1.8 +- @rocket.chat/models@0.0.14 + ## 0.0.13 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 2673492d3478..6efe337474af 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.0.13", + "version": "0.0.14", "private": true, "devDependencies": { "@babel/core": "~7.22.5", diff --git a/package.json b/package.json index 5694c9fbb272..a69bb18bcbbd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.3.7", + "version": "6.3.8", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index fd41b1590561..daee90175bda 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/core-services +## 0.1.8 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/rest-typings@6.3.8 +- @rocket.chat/models@0.0.14 + ## 0.1.7 ### Patch Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 9cd516f40482..f703c096ff2a 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.1.7", + "version": "0.1.8", "private": true, "devDependencies": { "@babel/core": "^7.21.4", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index 61d75230a51a..2135cfebf1de 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,7 @@ # @rocket.chat/core-typings +## 6.3.8 + ## 6.3.7 ## 6.3.6 diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index e7e14a015f5d..d492a4295ffd 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-typings", - "version": "6.3.7", + "version": "6.3.8", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.43.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index cd1e4fa30fdb..4c949b2e3f7c 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/cron +## 0.0.10 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/models@0.0.14 + ## 0.0.9 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index 4d47f033c2e9..df0e02ec7a6d 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.9", + "version": "0.0.10", "private": true, "devDependencies": { "@types/jest": "^27.4.1", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index 7166ffa4156c..9beb002b043d 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 1.0.8 + +### Patch Changes + +- @rocket.chat/gazzodown@1.0.8 +- @rocket.chat/ui-contexts@1.0.8 +- @rocket.chat/ui-video-conf@1.0.8 + ## 1.0.7 ### Patch Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 0f1e51236701..ea3e15a898a0 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "1.0.7", + "version": "1.0.8", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -47,9 +47,9 @@ "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "1.0.7", + "@rocket.chat/ui-contexts": "1.0.8", "@rocket.chat/ui-kit": "*", - "@rocket.chat/ui-video-conf": "1.0.7", + "@rocket.chat/ui-video-conf": "1.0.8", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index 8cf02c341289..d9223c930b7c 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/gazzodown +## 1.0.8 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/ui-contexts@1.0.8 +- @rocket.chat/ui-client@1.0.8 + ## 1.0.7 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index 52920f1ab0eb..0cef11a5692c 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "1.0.7", + "version": "1.0.8", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.3.7", + "@rocket.chat/core-typings": "6.3.8", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "1.0.7", - "@rocket.chat/ui-contexts": "1.0.7", + "@rocket.chat/ui-client": "1.0.8", + "@rocket.chat/ui-contexts": "1.0.8", "katex": "*", "react": "*" }, diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index da85d7db80a9..1ed75e1d0855 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/instance-status +## 0.0.14 + +### Patch Changes + +- @rocket.chat/models@0.0.14 + ## 0.0.13 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 25fb1c9d2d66..044e686e79b6 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.13", + "version": "0.0.14", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index 93da1df73b53..45fd6189ef74 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/model-typings +## 0.0.14 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 + ## 0.0.13 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index 7ff5137d3cf8..2d26550ec544 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.0.13", + "version": "0.0.14", "private": true, "devDependencies": { "@types/jest": "~29.5.2", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index bb0b5fcbeae4..beea5dac65f9 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/models +## 0.0.14 + +### Patch Changes + +- @rocket.chat/model-typings@0.0.14 + ## 0.0.13 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index afbeb9a4a064..ac23e21a2acc 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.13", + "version": "0.0.14", "private": true, "devDependencies": { "@types/jest": "~29.5.2", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index e4b1f8404baa..e3f9bfb571e4 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/rest-typings +## 6.3.8 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 + ## 6.3.7 ### Patch Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index ace18183d75a..4c607a162dec 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/rest-typings", - "version": "6.3.7", + "version": "6.3.8", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.2", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index 13f7f1e15c47..93cec6a524dc 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-client +## 1.0.8 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.8 + ## 1.0.7 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 005b5f907fcf..90d1bf6180a6 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "1.0.7", + "version": "1.0.8", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -53,7 +53,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "1.0.7", + "@rocket.chat/ui-contexts": "1.0.8", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index 7ad26d9922f9..b15f2041de0f 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/ui-contexts +## 1.0.8 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.8 +- @rocket.chat/rest-typings@6.3.8 +- @rocket.chat/ddp-client@0.1.8 + ## 1.0.7 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 7593c5cfbed7..65abcec16936 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "1.0.7", + "version": "1.0.8", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index 065b35d06a5b..df341db4e80a 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-video-conf +## 1.0.8 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.8 + ## 1.0.7 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index ef91ecfbd614..e672b0466019 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "1.0.7", + "version": "1.0.8", "private": true, "devDependencies": { "@babel/core": "~7.22.5", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "1.0.7", + "@rocket.chat/ui-contexts": "1.0.8", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index c5affc035808..49d485f76ef1 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/uikit-playground +## 0.1.8 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.8 +- @rocket.chat/fuselage-ui-kit@1.0.8 + ## 0.1.7 ### Patch Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index a54583fefcb1..7abf00087e73 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.1.7", + "version": "0.1.8", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index 09391c50e1fe..18fb786166ad 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/web-ui-registration +## 1.0.8 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.8 + ## 1.0.7 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index d14a406bb1e1..306fbfd384bb 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "1.0.7", + "version": "1.0.8", "private": true, "devDependencies": { "@rocket.chat/layout": "next", @@ -17,7 +17,7 @@ }, "peerDependencies": { "@rocket.chat/layout": "*", - "@rocket.chat/ui-contexts": "1.0.7", + "@rocket.chat/ui-contexts": "1.0.8", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", From 40c527719799a737e45dfb5b934f476a95d31d7a Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Wed, 27 Sep 2023 04:42:43 +0000 Subject: [PATCH 200/275] Release 6.4.0-rc.5 [no ci] --- .changeset/bump-patch-1695789755733.md | 5 +++ .changeset/pre.json | 3 ++ apps/meteor/.docker/Dockerfile.rhel | 2 +- apps/meteor/CHANGELOG.md | 31 +++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 11 +++++++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 11 +++++++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 11 +++++++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 13 ++++++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 13 ++++++++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 11 +++++++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 11 +++++++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 10 ++++++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 8 +++++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 8 +++++ ee/packages/ddp-client/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 13 ++++++++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 7 +++++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 9 ++++++ ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 9 ++++++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 6 ++++ packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 8 +++++ packages/cron/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 8 +++++ packages/fuselage-ui-kit/package.json | 6 ++-- packages/gazzodown/CHANGELOG.md | 9 ++++++ packages/gazzodown/package.json | 8 ++--- packages/instance-status/CHANGELOG.md | 6 ++++ packages/instance-status/package.json | 2 +- packages/livechat/CHANGELOG.md | 6 ++++ packages/livechat/package.json | 2 +- packages/model-typings/CHANGELOG.md | 7 +++++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 6 ++++ packages/models/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 11 +++++++ packages/rest-typings/package.json | 2 +- packages/tools/CHANGELOG.md | 7 +++++ packages/tools/package.json | 2 +- packages/ui-client/CHANGELOG.md | 6 ++++ packages/ui-client/package.json | 4 +-- packages/ui-contexts/CHANGELOG.md | 9 ++++++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 6 ++++ packages/ui-video-conf/package.json | 4 +-- packages/uikit-playground/CHANGELOG.md | 7 +++++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 6 ++++ packages/web-ui-registration/package.json | 4 +-- 65 files changed, 333 insertions(+), 41 deletions(-) create mode 100644 .changeset/bump-patch-1695789755733.md create mode 100644 packages/tools/CHANGELOG.md diff --git a/.changeset/bump-patch-1695789755733.md b/.changeset/bump-patch-1695789755733.md new file mode 100644 index 000000000000..e1eaa7980afb --- /dev/null +++ b/.changeset/bump-patch-1695789755733.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Bump @rocket.chat/meteor version. diff --git a/.changeset/pre.json b/.changeset/pre.json index 3bc535a4b50f..aa5cf5401ea3 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -60,9 +60,11 @@ "bump-patch-1694827499043", "bump-patch-1695163548038", "bump-patch-1695165575069", + "bump-patch-1695789755733", "chilled-flies-fold", "chilled-phones-give", "cool-students-tan", + "cuddly-donkeys-remember", "cuddly-houses-tie", "cuddly-ties-bake", "curly-shoes-burn", @@ -145,6 +147,7 @@ "swift-walls-protect", "tall-pumpkins-cross", "tame-pens-occur", + "thirty-pumpkins-fix", "three-ants-give", "three-birds-tickle", "tidy-bears-camp", diff --git a/apps/meteor/.docker/Dockerfile.rhel b/apps/meteor/.docker/Dockerfile.rhel index 3aae5c53f720..96a1740fa587 100644 --- a/apps/meteor/.docker/Dockerfile.rhel +++ b/apps/meteor/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 6.4.0-rc.4 +ENV RC_VERSION 6.4.0-rc.5 MAINTAINER buildmaster@rocket.chat diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index f8d6cbade00c..da842431ab0b 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,36 @@ # @rocket.chat/meteor +## 6.4.0-rc.5 + +### Minor Changes + +- 1041d4d361: Added option to select between two script engine options for the integrations + +### Patch Changes + +- Bump @rocket.chat/meteor version. +- ec60dbe8f5: Fixed custom translations not being displayed +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/rest-typings@6.4.0-rc.5 + - @rocket.chat/tools@0.1.0-rc.0 + - @rocket.chat/api-client@0.1.9-rc.5 + - @rocket.chat/omnichannel-services@0.0.15-rc.5 + - @rocket.chat/pdf-worker@0.0.15-rc.5 + - @rocket.chat/presence@0.0.15-rc.5 + - @rocket.chat/core-services@0.2.0-rc.5 + - @rocket.chat/cron@0.0.11-rc.5 + - @rocket.chat/gazzodown@2.0.0-rc.5 + - @rocket.chat/model-typings@0.1.0-rc.5 + - @rocket.chat/ui-contexts@2.0.0-rc.5 + - @rocket.chat/fuselage-ui-kit@2.0.0-rc.5 + - @rocket.chat/models@0.0.15-rc.5 + - @rocket.chat/ui-theming@0.1.0-rc.0 + - @rocket.chat/ui-client@2.0.0-rc.5 + - @rocket.chat/ui-video-conf@2.0.0-rc.5 + - @rocket.chat/web-ui-registration@2.0.0-rc.5 + - @rocket.chat/instance-status@0.0.15-rc.5 + ## 6.4.0-rc.4 ### Patch Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index e0d33295af2c..e97b3accfbf5 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.4.0-rc.4" + "version": "6.4.0-rc.5" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index cb58d45affa3..d39b61dabe55 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,16 @@ # rocketchat-services +## 1.1.9-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/rest-typings@6.4.0-rc.5 + - @rocket.chat/core-services@0.2.0-rc.5 + - @rocket.chat/model-typings@0.1.0-rc.5 + - @rocket.chat/models@0.0.15-rc.5 + ## 1.1.8-rc.4 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index b34d00f70948..b73a8cd72c1c 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.9-rc.4", + "version": "1.1.9-rc.5", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 61a2dcdd30d3..e25b5470a8fe 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.4.0-rc.4", + "version": "6.4.0-rc.5", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index 2b8f68d82542..171c077b0725 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/account-service +## 0.2.9-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/rest-typings@6.4.0-rc.5 + - @rocket.chat/core-services@0.2.0-rc.5 + - @rocket.chat/model-typings@0.1.0-rc.5 + - @rocket.chat/models@0.0.15-rc.5 + ## 0.2.8-rc.4 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index a263cb2bc4f3..d3189c7a9b02 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.2.9-rc.4", + "version": "0.2.9-rc.5", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index c88f11bdaca0..d43a26282daf 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/authorization-service +## 0.2.9-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/rest-typings@6.4.0-rc.5 + - @rocket.chat/core-services@0.2.0-rc.5 + - @rocket.chat/model-typings@0.1.0-rc.5 + - @rocket.chat/models@0.0.15-rc.5 + ## 0.2.8-rc.4 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index fcf0ea5eb42e..62b410a5f34d 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.2.9-rc.4", + "version": "0.2.9-rc.5", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index 1054c42ff2de..2ab86d83bfd2 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/ddp-streamer +## 0.1.9-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/rest-typings@6.4.0-rc.5 + - @rocket.chat/core-services@0.2.0-rc.5 + - @rocket.chat/model-typings@0.1.0-rc.5 + - @rocket.chat/ui-contexts@2.0.0-rc.5 + - @rocket.chat/models@0.0.15-rc.5 + - @rocket.chat/instance-status@0.0.15-rc.5 + ## 0.1.8-rc.4 ### Patch Changes diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 6dbc1b3ddb09..4efe8e8f8877 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.1.9-rc.4", + "version": "0.1.9-rc.5", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index eea1e8489b1b..0af76d7b0699 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/omnichannel-transcript +## 0.2.9-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/tools@0.1.0-rc.0 + - @rocket.chat/omnichannel-services@0.0.15-rc.5 + - @rocket.chat/pdf-worker@0.0.15-rc.5 + - @rocket.chat/core-services@0.2.0-rc.5 + - @rocket.chat/model-typings@0.1.0-rc.5 + - @rocket.chat/models@0.0.15-rc.5 + ## 0.2.8-rc.4 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index bfaf2945da46..2d7a55674c11 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.2.9-rc.4", + "version": "0.2.9-rc.5", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index 7c2478a73718..d736864b7d1a 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/presence-service +## 0.2.9-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/presence@0.0.15-rc.5 + - @rocket.chat/core-services@0.2.0-rc.5 + - @rocket.chat/model-typings@0.1.0-rc.5 + - @rocket.chat/models@0.0.15-rc.5 + ## 0.2.8-rc.4 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index f07963d763e8..68264047f48a 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.2.9-rc.4", + "version": "0.2.9-rc.5", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index adb2e6c38e2e..d6d3edd8cc7b 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/queue-worker +## 0.2.9-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/omnichannel-services@0.0.15-rc.5 + - @rocket.chat/core-services@0.2.0-rc.5 + - @rocket.chat/model-typings@0.1.0-rc.5 + - @rocket.chat/models@0.0.15-rc.5 + ## 0.2.8-rc.4 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index 14427794e5c8..77583a193243 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.2.9-rc.4", + "version": "0.2.9-rc.5", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index eb569a157edc..5d9608031426 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,15 @@ # @rocket.chat/stream-hub-service +## 0.2.9-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/core-services@0.2.0-rc.5 + - @rocket.chat/model-typings@0.1.0-rc.5 + - @rocket.chat/models@0.0.15-rc.5 + ## 0.2.8-rc.4 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index 5e8e37a83833..9c1192e45621 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.2.9-rc.4", + "version": "0.2.9-rc.5", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index 2a939bc1af9c..545977e119b2 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/api-client +## 0.1.9-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/rest-typings@6.4.0-rc.5 + ## 0.1.9-rc.4 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index f83c7b978039..52291ace5933 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/api-client", - "version": "0.1.9-rc.4", + "version": "0.1.9-rc.5", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index a192b94c535d..1a121f4eea53 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/ddp-client +## 0.2.0-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/rest-typings@6.4.0-rc.5 + - @rocket.chat/api-client@0.1.9-rc.5 + ## 0.2.0-rc.4 ### Patch Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index 0c64d9117894..dba3242f275f 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ddp-client", - "version": "0.2.0-rc.4", + "version": "0.2.0-rc.5", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index 5d4f0468c000..c8d411fa1f19 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/omnichannel-services +## 0.0.15-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/rest-typings@6.4.0-rc.5 + - @rocket.chat/tools@0.1.0-rc.0 + - @rocket.chat/pdf-worker@0.0.15-rc.5 + - @rocket.chat/core-services@0.2.0-rc.5 + - @rocket.chat/model-typings@0.1.0-rc.5 + - @rocket.chat/models@0.0.15-rc.5 + ## 0.0.14-rc.4 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 6060a3557c83..3772bd4622d0 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.0.15-rc.4", + "version": "0.0.15-rc.5", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index 13dc1a43e0f5..31663913bc22 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/pdf-worker +## 0.0.15-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + ## 0.0.14-rc.4 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index 69b85c28bf23..742bddc7e5bf 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.15-rc.4", + "version": "0.0.15-rc.5", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index befd96b837ee..dc58f5248666 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/presence +## 0.0.15-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/core-services@0.2.0-rc.5 + - @rocket.chat/models@0.0.15-rc.5 + ## 0.0.14-rc.4 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 4b85e8f0155c..b91d01f8b794 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.0.15-rc.4", + "version": "0.0.15-rc.5", "private": true, "devDependencies": { "@babel/core": "~7.22.9", diff --git a/package.json b/package.json index 838aac9c3697..43a110e20cfb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.4.0-rc.4", + "version": "6.4.0-rc.5", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index a8135a8979e1..1be0b4cc682d 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/core-services +## 0.2.0-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/rest-typings@6.4.0-rc.5 + - @rocket.chat/models@0.0.15-rc.5 + ## 0.2.0-rc.4 ### Patch Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 1003bb9dd191..b642d676538a 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.2.0-rc.4", + "version": "0.2.0-rc.5", "private": true, "devDependencies": { "@babel/core": "~7.22.9", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index 5d085a00c86a..574468eea9e9 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/core-typings +## 6.4.0-rc.5 + +### Minor Changes + +- 1041d4d361: Added option to select between two script engine options for the integrations + ## 6.4.0-rc.4 ## 6.4.0-rc.3 diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 2aec7e6405de..1e0313eb0129 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-typings", - "version": "6.4.0-rc.4", + "version": "6.4.0-rc.5", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index d2234538faa2..8a8e71514de7 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/cron +## 0.0.11-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/models@0.0.15-rc.5 + ## 0.0.10-rc.4 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index faf2311923eb..9246eaf47856 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.11-rc.4", + "version": "0.0.11-rc.5", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index f564cdfa4d70..354093b38e4b 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,13 @@ # Change Log +## 2.0.0-rc.5 + +### Patch Changes + +- @rocket.chat/gazzodown@2.0.0-rc.5 +- @rocket.chat/ui-contexts@2.0.0-rc.5 +- @rocket.chat/ui-video-conf@2.0.0-rc.5 + ## 2.0.0-rc.4 ### Patch Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index e199b888401a..99b23b87018c 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "2.0.0-rc.4", + "version": "2.0.0-rc.5", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -46,9 +46,9 @@ "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.4", + "@rocket.chat/ui-contexts": "2.0.0-rc.5", "@rocket.chat/ui-kit": "*", - "@rocket.chat/ui-video-conf": "2.0.0-rc.4", + "@rocket.chat/ui-video-conf": "2.0.0-rc.5", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index 1e0df55f53d8..8885c9f90b59 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/gazzodown +## 2.0.0-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/ui-contexts@2.0.0-rc.5 + - @rocket.chat/ui-client@2.0.0-rc.5 + ## 2.0.0-rc.4 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index c500807716f5..f35efad6f64d 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "2.0.0-rc.4", + "version": "2.0.0-rc.5", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.4.0-rc.4", + "@rocket.chat/core-typings": "6.4.0-rc.5", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "2.0.0-rc.4", - "@rocket.chat/ui-contexts": "2.0.0-rc.4", + "@rocket.chat/ui-client": "2.0.0-rc.5", + "@rocket.chat/ui-contexts": "2.0.0-rc.5", "katex": "*", "react": "*" }, diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index 3571dc6806ce..ae70025393d1 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/instance-status +## 0.0.15-rc.5 + +### Patch Changes + +- @rocket.chat/models@0.0.15-rc.5 + ## 0.0.14-rc.4 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 79945c5d3af6..26fb4d05c2c3 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.15-rc.4", + "version": "0.0.15-rc.5", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/livechat/CHANGELOG.md b/packages/livechat/CHANGELOG.md index 922a2d7f442b..ef8b45c7d311 100644 --- a/packages/livechat/CHANGELOG.md +++ b/packages/livechat/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/livechat Change Log +## 1.14.0-rc.5 + +### Patch Changes + +- @rocket.chat/gazzodown@2.0.0-rc.5 + ## 1.14.0-rc.4 ### Patch Changes diff --git a/packages/livechat/package.json b/packages/livechat/package.json index e46439181586..dabbe9f3f20e 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/livechat", - "version": "1.14.0-rc.4", + "version": "1.14.0-rc.5", "files": [ "/build" ], diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index 18b05d5113f7..569331a94a00 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/model-typings +## 0.1.0-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + ## 0.1.0-rc.4 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index d84dcd3b3742..a0bab9e30a20 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.1.0-rc.4", + "version": "0.1.0-rc.5", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index 31d2440aaa7f..225f96789456 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/models +## 0.0.15-rc.5 + +### Patch Changes + +- @rocket.chat/model-typings@0.1.0-rc.5 + ## 0.0.14-rc.4 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index 5cdcd6b017fb..317655b331e0 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.15-rc.4", + "version": "0.0.15-rc.5", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index cc3691254dda..c2c6b28183d1 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/rest-typings +## 6.4.0-rc.5 + +### Minor Changes + +- 1041d4d361: Added option to select between two script engine options for the integrations + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + ## 6.4.0-rc.4 ### Patch Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index a773001954ed..9defeb0f48de 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/rest-typings", - "version": "6.4.0-rc.4", + "version": "6.4.0-rc.5", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.3", diff --git a/packages/tools/CHANGELOG.md b/packages/tools/CHANGELOG.md new file mode 100644 index 000000000000..676c9927ae53 --- /dev/null +++ b/packages/tools/CHANGELOG.md @@ -0,0 +1,7 @@ +# @rocket.chat/tools + +## 0.1.0-rc.0 + +### Minor Changes + +- 1041d4d361: Added option to select between two script engine options for the integrations diff --git a/packages/tools/package.json b/packages/tools/package.json index d9ab70550ce4..8208ac96b2f4 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/tools", - "version": "0.0.1", + "version": "0.1.0-rc.0", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index 2b4b897f7130..8aa82c379c2e 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-client +## 2.0.0-rc.5 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.5 + ## 2.0.0-rc.4 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 98d926d14d66..4184a0b4c499 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "2.0.0-rc.4", + "version": "2.0.0-rc.5", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -61,7 +61,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.4", + "@rocket.chat/ui-contexts": "2.0.0-rc.5", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index 7269cd9482b3..533e06007361 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/ui-contexts +## 2.0.0-rc.5 + +### Patch Changes + +- Updated dependencies [1041d4d361] + - @rocket.chat/core-typings@6.4.0-rc.5 + - @rocket.chat/rest-typings@6.4.0-rc.5 + - @rocket.chat/ddp-client@0.2.0-rc.5 + ## 2.0.0-rc.4 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 78591fa51c5f..3d7c50a7769c 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "2.0.0-rc.4", + "version": "2.0.0-rc.5", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index 58285085a920..c5c4475dd5e8 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-video-conf +## 2.0.0-rc.5 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.5 + ## 2.0.0-rc.4 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index 6ad0bb49b558..09d910b70413 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "2.0.0-rc.4", + "version": "2.0.0-rc.5", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.4", + "@rocket.chat/ui-contexts": "2.0.0-rc.5", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index 2561ce2a6e1f..aee3d52e5249 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,12 @@ # @rocket.chat/uikit-playground +## 0.2.0-rc.5 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.5 +- @rocket.chat/fuselage-ui-kit@2.0.0-rc.5 + ## 0.2.0-rc.4 ### Patch Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index bb21f8990e75..a97fee768fe1 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.2.0-rc.4", + "version": "0.2.0-rc.5", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index fb4c96e42de1..96575b1b03dc 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/web-ui-registration +## 2.0.0-rc.5 + +### Patch Changes + +- @rocket.chat/ui-contexts@2.0.0-rc.5 + ## 2.0.0-rc.4 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index 60669e1c9e19..0e0a4d130fac 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "2.0.0-rc.4", + "version": "2.0.0-rc.5", "private": true, "homepage": "https://rocket.chat", "main": "./dist/index.js", @@ -49,7 +49,7 @@ }, "peerDependencies": { "@rocket.chat/layout": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.4", + "@rocket.chat/ui-contexts": "2.0.0-rc.5", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", From 7061b67a3dd041c78a7f9f78dca89838800de93f Mon Sep 17 00:00:00 2001 From: Tiago Evangelista Pinto Date: Wed, 27 Sep 2023 02:28:31 -0300 Subject: [PATCH 201/275] chore: Changing some key translations - Setup Wizard (#30462) Co-authored-by: Guilherme Gazzo <5263975+ggazzo@users.noreply.github.com> --- .../rocketchat-i18n/i18n/en.i18n.json | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index e3bf5ef3194c..849f00c11428 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -5855,7 +5855,7 @@ "onboarding.component.form.action.confirm": "Confirm", "onboarding.component.form.termsAndConditions": "I agree with <1>Terms and Conditions and <3>Privacy Policy", "onboarding.component.emailCodeFallback": "Didn’t receive email? <1>Resend or <3>Change email", - "onboarding.page.form.title": "Let's <1>Launch Your Workspace", + "onboarding.page.form.title": "Let's launch your workspace", "onboarding.page.awaitingConfirmation.title": "Awaiting confirmation", "onboarding.page.awaitingConfirmation.subtitle": "We have sent you an email to {{emailAddress}} with a confirmation link. Please verify that the security code below matches the one in the email.", "onboarding.page.emailConfirmed.title": "Email Confirmed!", @@ -5882,10 +5882,8 @@ "onboarding.page.requestTrial.subtitle": "Try our best Enterprise Edition plan for 30 days for free", "onboarding.page.magicLinkEmail.title": "We emailed you a login link", "onboarding.page.magicLinkEmail.subtitle": "Click the link in the email we just sent you to sign in to your workspace. <1>The link will expire in 30 minutes.", - "onboarding.page.organizationInfoPage.title": "A few more details...", - "onboarding.page.organizationInfoPage.subtitle": "These will help us to personalize your workspace.", "onboarding.form.adminInfoForm.title": "Admin Info", - "onboarding.form.adminInfoForm.subtitle": "We need this to create an admin profile inside your workspace", + "onboarding.form.adminInfoForm.subtitle": "We need this information to create an admin profile for your workspace.", "onboarding.form.adminInfoForm.fields.fullName.label": "Full name", "onboarding.form.adminInfoForm.fields.fullName.placeholder": "First and last name", "onboarding.form.adminInfoForm.fields.username.label": "Username", @@ -5896,7 +5894,7 @@ "onboarding.form.adminInfoForm.fields.password.placeholder": "Create password", "onboarding.form.adminInfoForm.fields.keepPosted.label": "Keep me posted about Rocket.Chat updates", "onboarding.form.organizationInfoForm.title": "Organization Info", - "onboarding.form.organizationInfoForm.subtitle": "Please, bear with us. This info will help us personalize your workspace", + "onboarding.form.organizationInfoForm.subtitle": "We need to know who you are.", "onboarding.form.organizationInfoForm.fields.organizationName.label": "Organization name", "onboarding.form.organizationInfoForm.fields.organizationName.placeholder": "Organization name", "onboarding.form.organizationInfoForm.fields.organizationType.label": "Organization type", @@ -5907,17 +5905,16 @@ "onboarding.form.organizationInfoForm.fields.organizationSize.placeholder": "Select", "onboarding.form.organizationInfoForm.fields.country.label": "Country", "onboarding.form.organizationInfoForm.fields.country.placeholder": "Select", - "onboarding.form.registeredServerForm.title": "Register Your Server", + "onboarding.form.registeredServerForm.title": "Register your workspace", "onboarding.form.registeredServerForm.included.push": "Mobile push notifications", "onboarding.form.registeredServerForm.included.externalProviders": "Integration with external providers (WhatsApp, Facebook, Telegram, Twitter)", "onboarding.form.registeredServerForm.included.apps": "Access to marketplace apps", - "onboarding.form.registeredServerForm.fields.accountEmail.inputLabel": "Cloud account email", - "onboarding.form.registeredServerForm.fields.accountEmail.tooltipLabel": "To register your server, we need to connect it to your cloud account. If you already have one - we will link it automatically. Otherwise, a new account will be created", - "onboarding.form.registeredServerForm.fields.accountEmail.inputPlaceholder": "Please enter your Email", + "onboarding.form.registeredServerForm.fields.accountEmail.inputLabel": "Admin email", + "onboarding.form.registeredServerForm.fields.accountEmail.inputPlaceholder": "Insert your email to continue", "onboarding.form.registeredServerForm.keepInformed": "Keep me informed about news and events", "onboarding.form.registeredServerForm.registerLater": "Register later", "onboarding.form.registeredServerForm.notConnectedToInternet": "The server is not connected to the internet, so you’ll have to do an offline registration for this workspace.", - "onboarding.form.registeredServerForm.agreeToReceiveUpdates": "By registering I agree to receive relevant product and security updates", + "onboarding.form.registeredServerForm.registrationEngagement": "Registration allows automatic license updates, notifications of critical vulnerabilities and access to Rocket.Chat Cloud services. No sensitive workspace data is shared; statistics sent to Rocket.Chat is made visible to you within the administration area.", "onboarding.form.standaloneServerForm.title": "Standalone Server Confirmation", "onboarding.form.standaloneServerForm.servicesUnavailable": "Some of the services will be unavailable or will require manual setup", "onboarding.form.standaloneServerForm.publishOwnApp": "In order to send push notitications you need to compile and publish your own app to Google Play and App Store", @@ -6057,4 +6054,4 @@ "Filter_by_room": "Filter by room type", "Filter_by_visibility": "Filter by visibility", "Theme_Appearence": "Theme Appearence" -} \ No newline at end of file +} From ec0e6a92289770c5a71337d2250658163fd630c1 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 20 Sep 2023 00:00:50 -0300 Subject: [PATCH 202/275] ci: patch mongo type definitions (#30449) --- .yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch | 13 +++++++++++++ apps/meteor/tsconfig.typecheck.json | 7 ++++++- package.json | 3 ++- 3 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 .yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch diff --git a/.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch b/.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch new file mode 100644 index 000000000000..501881370244 --- /dev/null +++ b/.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch @@ -0,0 +1,13 @@ +diff --git a/mongodb.d.ts b/mongodb.d.ts +index dd080b553309594c28093365ea101adec5c0a20c..20a616de8c97ec68629c01a848ea8df4fe122bf2 100644 +--- a/mongodb.d.ts ++++ b/mongodb.d.ts +@@ -5539,7 +5539,7 @@ export declare interface MonitorOptions extends Omit = Depth['length'] extends 8 ? [] : Type extends string | number | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | { ++export declare type NestedPaths = Depth['length'] extends 1 ? [] : Type extends string | number | boolean | Date | RegExp | Buffer | Uint8Array | ((...args: any[]) => any) | { + _bsontype: string; + } ? [] : Type extends ReadonlyArray ? [] | [number, ...NestedPaths] : Type extends Map ? [string] : Type extends object ? { + [Key in Extract]: Type[Key] extends Type ? [Key] : Type extends Type[Key] ? [Key] : Type[Key] extends ReadonlyArray ? Type extends ArrayType ? [Key] : ArrayType extends Type ? [Key] : [ diff --git a/apps/meteor/tsconfig.typecheck.json b/apps/meteor/tsconfig.typecheck.json index e5a34906c8ce..33699e98affb 100644 --- a/apps/meteor/tsconfig.typecheck.json +++ b/apps/meteor/tsconfig.typecheck.json @@ -2,7 +2,12 @@ "extends": "./tsconfig.json", "compilerOptions": { "skipLibCheck": true, - "noEmit": true + "noEmit": true, + "incremental": true, + "allowImportingTsExtensions": true, + "paths": { + "mongodb": ["node_modules/mongodb"] + } }, "exclude": [".meteor", "./packages", "./imports/client", "./ee/server/services", "public/", "private"] } diff --git a/package.json b/package.json index 43a110e20cfb..457b40ac77a2 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "minimist": "1.2.6", "adm-zip": "0.5.9", "preact@10.15.1": "patch:preact@npm:10.15.1#.yarn/patches/preact-npm-10.15.1-bd458de913.patch", - "@storybook/react-docgen-typescript-plugin@1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0": "patch:@storybook/react-docgen-typescript-plugin@npm%3A1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0#./.yarn/patches/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40.patch" + "@storybook/react-docgen-typescript-plugin@1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0": "patch:@storybook/react-docgen-typescript-plugin@npm%3A1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0#./.yarn/patches/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40.patch", + "mongodb@4.17.1": "patch:mongodb@npm:4.17.1#.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch" } } From 5969db0f8b44bd3772c5f06f64bd23bb94ac5c49 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Wed, 20 Sep 2023 10:51:28 -0300 Subject: [PATCH 203/275] chore: bump mongo deps (#30450) --- apps/meteor/ee/server/services/Dockerfile | 2 + apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 3 +- ee/apps/account-service/Dockerfile | 1 + ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/Dockerfile | 1 + ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/Dockerfile | 1 + ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/Dockerfile | 1 + ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/Dockerfile | 1 + ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/Dockerfile | 1 + ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/Dockerfile | 1 + ee/apps/stream-hub-service/package.json | 2 +- ee/packages/omnichannel-services/package.json | 2 +- ee/packages/presence/package.json | 2 +- package.json | 2 +- packages/agenda/package.json | 2 +- packages/core-services/package.json | 2 +- packages/core-typings/package.json | 2 +- packages/cron/package.json | 2 +- packages/instance-status/package.json | 2 +- packages/model-typings/package.json | 2 +- packages/rest-typings/package.json | 2 +- packages/ui-contexts/package.json | 2 +- yarn.lock | 273 ++++-------------- 29 files changed, 86 insertions(+), 237 deletions(-) diff --git a/apps/meteor/ee/server/services/Dockerfile b/apps/meteor/ee/server/services/Dockerfile index 6b55a5c35aca..e1a1074fcb60 100644 --- a/apps/meteor/ee/server/services/Dockerfile +++ b/apps/meteor/ee/server/services/Dockerfile @@ -10,6 +10,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./packages/core-services packages/core-services COPY ./packages/core-typings packages/core-typings @@ -56,6 +57,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./apps/meteor/ee/server/services/package.json ./apps/meteor/ee/server/services/package.json ENV NODE_ENV=production \ diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index b73a8cd72c1c..8fd8bb9550b8 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -41,7 +41,7 @@ "jaeger-client": "^3.19.0", "mem": "^8.1.1", "moleculer": "^0.14.29", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.6.1", "pino": "^8.15.0", "sodium-native": "^3.3.0", diff --git a/apps/meteor/package.json b/apps/meteor/package.json index e25b5470a8fe..d9b777a06d4e 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -371,8 +371,7 @@ "moment": "^2.29.4", "moment-timezone": "^0.5.43", "mongo-message-queue": "^1.0.0", - "mongodb": "^4.12.1", - "mongodb-memory-server": "^7.6.3", + "mongodb": "^4.17.1", "nats": "^2.6.1", "node-abort-controller": "^3.1.1", "node-dogstatsd": "^0.0.7", diff --git a/ee/apps/account-service/Dockerfile b/ee/apps/account-service/Dockerfile index e59c9f672f8b..d7ccb734071b 100644 --- a/ee/apps/account-service/Dockerfile +++ b/ee/apps/account-service/Dockerfile @@ -29,6 +29,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./ee/apps/${SERVICE}/package.json ee/apps/${SERVICE}/package.json ENV NODE_ENV=production \ diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index d3189c7a9b02..4e8442d6253d 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -31,7 +31,7 @@ "gc-stats": "^1.4.0", "mem": "^8.1.1", "moleculer": "^0.14.29", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.4.0", "pino": "^8.15.0", "polka": "^0.5.2", diff --git a/ee/apps/authorization-service/Dockerfile b/ee/apps/authorization-service/Dockerfile index e59c9f672f8b..d7ccb734071b 100644 --- a/ee/apps/authorization-service/Dockerfile +++ b/ee/apps/authorization-service/Dockerfile @@ -29,6 +29,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./ee/apps/${SERVICE}/package.json ee/apps/${SERVICE}/package.json ENV NODE_ENV=production \ diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index 62b410a5f34d..64a88f67f728 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -30,7 +30,7 @@ "gc-stats": "^1.4.0", "mem": "^8.1.1", "moleculer": "^0.14.29", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.4.0", "pino": "^8.15.0", "polka": "^0.5.2" diff --git a/ee/apps/ddp-streamer/Dockerfile b/ee/apps/ddp-streamer/Dockerfile index 83f1eb282c87..f7a918cb0747 100644 --- a/ee/apps/ddp-streamer/Dockerfile +++ b/ee/apps/ddp-streamer/Dockerfile @@ -38,6 +38,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./ee/apps/${SERVICE}/package.json ee/apps/${SERVICE}/package.json ENV NODE_ENV=production \ diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index 4efe8e8f8877..be3f02473070 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -35,7 +35,7 @@ "jaeger-client": "^3.19.0", "mem": "^8.1.1", "moleculer": "^0.14.29", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.4.0", "pino": "^8.15.0", "polka": "^0.5.2", diff --git a/ee/apps/omnichannel-transcript/Dockerfile b/ee/apps/omnichannel-transcript/Dockerfile index cc27cd7de9b5..95fb836e9f27 100644 --- a/ee/apps/omnichannel-transcript/Dockerfile +++ b/ee/apps/omnichannel-transcript/Dockerfile @@ -41,6 +41,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./ee/apps/${SERVICE}/package.json ee/apps/${SERVICE}/package.json ENV NODE_ENV=production \ diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index 2d7a55674c11..d244bbad1564 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -36,7 +36,7 @@ "moleculer": "^0.14.29", "moment-timezone": "^0.5.43", "mongo-message-queue": "^1.0.0", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.4.0", "pino": "^8.15.0", "polka": "^0.5.2" diff --git a/ee/apps/presence-service/Dockerfile b/ee/apps/presence-service/Dockerfile index 5db19b7c0900..f85c45246f29 100644 --- a/ee/apps/presence-service/Dockerfile +++ b/ee/apps/presence-service/Dockerfile @@ -35,6 +35,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./ee/apps/${SERVICE}/package.json ee/apps/${SERVICE}/package.json ENV NODE_ENV=production \ diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index 68264047f48a..5cb2e6d80c08 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -30,7 +30,7 @@ "gc-stats": "^1.4.0", "mem": "^8.1.1", "moleculer": "^0.14.29", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.4.0", "pino": "^8.15.0", "polka": "^0.5.2" diff --git a/ee/apps/queue-worker/Dockerfile b/ee/apps/queue-worker/Dockerfile index cc27cd7de9b5..95fb836e9f27 100644 --- a/ee/apps/queue-worker/Dockerfile +++ b/ee/apps/queue-worker/Dockerfile @@ -41,6 +41,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./ee/apps/${SERVICE}/package.json ee/apps/${SERVICE}/package.json ENV NODE_ENV=production \ diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index 77583a193243..dbfe462ce9ba 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -34,7 +34,7 @@ "moleculer": "^0.14.29", "moment-timezone": "^0.5.43", "mongo-message-queue": "^1.0.0", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.4.0", "pino": "^8.15.0", "polka": "^0.5.2" diff --git a/ee/apps/stream-hub-service/Dockerfile b/ee/apps/stream-hub-service/Dockerfile index 2bc54c250389..c06115c887f5 100644 --- a/ee/apps/stream-hub-service/Dockerfile +++ b/ee/apps/stream-hub-service/Dockerfile @@ -32,6 +32,7 @@ COPY ./yarn.lock . COPY ./.yarnrc.yml . COPY ./.yarn/plugins .yarn/plugins COPY ./.yarn/releases .yarn/releases +COPY ./.yarn/patches .yarn/patches COPY ./ee/apps/${SERVICE}/package.json ee/apps/${SERVICE}/package.json ENV NODE_ENV=production \ diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index 9c1192e45621..196dc22de85d 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -30,7 +30,7 @@ "gc-stats": "^1.4.0", "mem": "^8.1.1", "moleculer": "^0.14.29", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "nats": "^2.4.0", "pino": "^8.15.0", "polka": "^0.5.2" diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 3772bd4622d0..3159649db4e6 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -29,7 +29,7 @@ "mem": "^8.1.1", "moment-timezone": "^0.5.43", "mongo-message-queue": "^1.0.0", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "pino": "^8.15.0" }, "scripts": { diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index b91d01f8b794..050c8dcf5d95 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -32,6 +32,6 @@ "@rocket.chat/core-services": "workspace:^", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/models": "workspace:^", - "mongodb": "^4.12.1" + "mongodb": "^4.17.1" } } diff --git a/package.json b/package.json index 457b40ac77a2..6222c682c78d 100644 --- a/package.json +++ b/package.json @@ -64,6 +64,6 @@ "adm-zip": "0.5.9", "preact@10.15.1": "patch:preact@npm:10.15.1#.yarn/patches/preact-npm-10.15.1-bd458de913.patch", "@storybook/react-docgen-typescript-plugin@1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0": "patch:@storybook/react-docgen-typescript-plugin@npm%3A1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0#./.yarn/patches/@storybook-react-docgen-typescript-plugin-npm-1.0.2-canary.6.9d540b91e815f8fc2f8829189deb00553559ff63.0-b31cc57c40.patch", - "mongodb@4.17.1": "patch:mongodb@npm:4.17.1#.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch" + "mongodb@^4.17.1": "patch:mongodb@npm:4.17.1#.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch" } } diff --git a/packages/agenda/package.json b/packages/agenda/package.json index dfdeb009c090..f533e05dba28 100644 --- a/packages/agenda/package.json +++ b/packages/agenda/package.json @@ -9,7 +9,7 @@ "debug": "~4.1.1", "human-interval": "^2.0.1", "moment-timezone": "~0.5.43", - "mongodb": "^4.12.1" + "mongodb": "^4.17.1" }, "devDependencies": { "@types/debug": "^4.1.8", diff --git a/packages/core-services/package.json b/packages/core-services/package.json index b642d676538a..4f449f90e889 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -13,7 +13,7 @@ "babel-jest": "^29.5.0", "eslint": "~8.45.0", "jest": "~29.6.1", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "prettier": "~2.8.8", "typescript": "~5.2.2" }, diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 1e0313eb0129..ef1b9e9b5a39 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -4,7 +4,7 @@ "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "prettier": "~2.8.8", "typescript": "~5.2.2" }, diff --git a/packages/cron/package.json b/packages/cron/package.json index 9246eaf47856..ec0de88823bb 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -26,6 +26,6 @@ "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/models": "workspace:^", "@rocket.chat/random": "workspace:^", - "mongodb": "^4.12.1" + "mongodb": "^4.17.1" } } diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 26fb4d05c2c3..7dc7720aef9a 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -5,7 +5,7 @@ "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "prettier": "~2.8.8", "typescript": "~5.2.2" }, diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index a0bab9e30a20..8d005aab734e 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -7,7 +7,7 @@ "@types/node-rsa": "^1.1.1", "eslint": "~8.45.0", "jest": "~29.6.1", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "ts-jest": "~29.0.5", "typescript": "~5.2.2" }, diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 9defeb0f48de..55cb9e3f9d4c 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -7,7 +7,7 @@ "eslint": "~8.45.0", "jest": "~29.6.1", "jest-environment-jsdom": "~29.6.1", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "ts-jest": "~29.0.5", "typescript": "~5.2.2" }, diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 3d7c50a7769c..9008527e7dab 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -14,7 +14,7 @@ "eslint": "~8.45.0", "eslint-plugin-react-hooks": "^4.6.0", "jest": "~29.6.1", - "mongodb": "^4.12.1", + "mongodb": "^4.17.1", "react": "~17.0.2", "ts-jest": "~29.0.5", "typescript": "~5.2.2", diff --git a/yarn.lock b/yarn.lock index e8baf1bbeb55..284adfa27307 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4349,6 +4349,15 @@ __metadata: languageName: node linkType: hard +"@mongodb-js/saslprep@npm:^1.1.0": + version: 1.1.0 + resolution: "@mongodb-js/saslprep@npm:1.1.0" + dependencies: + sparse-bitfield: ^3.0.3 + checksum: 1479a43e216734672f8eb1a2a55165b6896841bd00fb5bd645390a24374ef6c29f0f6d19a43618a19b8f1912fcbd2b2cc2210a62361103d1f28dce6852cf31d4 + languageName: node + linkType: hard + "@mrmlnc/readdir-enhanced@npm:^2.2.1": version: 2.2.1 resolution: "@mrmlnc/readdir-enhanced@npm:2.2.1" @@ -7693,7 +7702,7 @@ __metadata: gc-stats: ^1.4.0 mem: ^8.1.1 moleculer: ^0.14.29 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.4.0 pino: ^8.15.0 polka: ^0.5.2 @@ -7728,7 +7737,7 @@ __metadata: human-interval: ^2.0.1 jest: ~29.6.1 moment-timezone: ~0.5.43 - mongodb: ^4.12.1 + mongodb: ^4.17.1 ts-jest: ~29.0.5 typescript: ~5.2.2 languageName: unknown @@ -7815,7 +7824,7 @@ __metadata: gc-stats: ^1.4.0 mem: ^8.1.1 moleculer: ^0.14.29 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.4.0 pino: ^8.15.0 polka: ^0.5.2 @@ -7876,7 +7885,7 @@ __metadata: eslint: ~8.45.0 fibers: ^5.0.3 jest: ~29.6.1 - mongodb: ^4.12.1 + mongodb: ^4.17.1 prettier: ~2.8.8 typescript: ~5.2.2 languageName: unknown @@ -7892,7 +7901,7 @@ __metadata: "@rocket.chat/message-parser": next "@rocket.chat/ui-kit": next eslint: ~8.45.0 - mongodb: ^4.12.1 + mongodb: ^4.17.1 prettier: ~2.8.8 typescript: ~5.2.2 languageName: unknown @@ -7909,7 +7918,7 @@ __metadata: "@types/jest": ~29.5.3 eslint: ~8.45.0 jest: ~29.6.1 - mongodb: ^4.12.1 + mongodb: ^4.17.1 ts-jest: ~29.0.5 typescript: ~5.2.2 languageName: unknown @@ -8014,7 +8023,7 @@ __metadata: jaeger-client: ^3.19.0 mem: ^8.1.1 moleculer: ^0.14.29 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.4.0 pino: ^8.15.0 pino-pretty: ^7.6.1 @@ -8350,7 +8359,7 @@ __metadata: "@rocket.chat/eslint-config": "workspace:^" "@rocket.chat/models": "workspace:^" eslint: ~8.45.0 - mongodb: ^4.12.1 + mongodb: ^4.17.1 prettier: ~2.8.8 typescript: ~5.2.2 languageName: unknown @@ -8814,8 +8823,7 @@ __metadata: moment: ^2.29.4 moment-timezone: ^0.5.43 mongo-message-queue: ^1.0.0 - mongodb: ^4.12.1 - mongodb-memory-server: ^7.6.3 + mongodb: ^4.17.1 nats: ^2.6.1 node-abort-controller: ^3.1.1 node-dogstatsd: ^0.0.7 @@ -8933,7 +8941,7 @@ __metadata: "@types/node-rsa": ^1.1.1 eslint: ~8.45.0 jest: ~29.6.1 - mongodb: ^4.12.1 + mongodb: ^4.17.1 ts-jest: ~29.0.5 typescript: ~5.2.2 languageName: unknown @@ -8987,7 +8995,7 @@ __metadata: mem: ^8.1.1 moment-timezone: ^0.5.43 mongo-message-queue: ^1.0.0 - mongodb: ^4.12.1 + mongodb: ^4.17.1 pino: ^8.15.0 ts-jest: ~29.0.5 typescript: ~5.2.2 @@ -9024,7 +9032,7 @@ __metadata: moleculer: ^0.14.29 moment-timezone: ^0.5.43 mongo-message-queue: ^1.0.0 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.4.0 pino: ^8.15.0 polka: ^0.5.2 @@ -9119,7 +9127,7 @@ __metadata: gc-stats: ^1.4.0 mem: ^8.1.1 moleculer: ^0.14.29 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.4.0 pino: ^8.15.0 polka: ^0.5.2 @@ -9145,7 +9153,7 @@ __metadata: babel-jest: ^29.0.3 eslint: ~8.45.0 jest: ~29.6.1 - mongodb: ^4.12.1 + mongodb: ^4.17.1 typescript: ~5.2.2 languageName: unknown linkType: soft @@ -9186,7 +9194,7 @@ __metadata: moleculer: ^0.14.29 moment-timezone: ^0.5.43 mongo-message-queue: ^1.0.0 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.4.0 pino: ^8.15.0 polka: ^0.5.2 @@ -9247,7 +9255,7 @@ __metadata: eslint: ~8.45.0 jest: ~29.6.1 jest-environment-jsdom: ~29.6.1 - mongodb: ^4.12.1 + mongodb: ^4.17.1 ts-jest: ~29.0.5 typescript: ~5.2.2 languageName: unknown @@ -9324,7 +9332,7 @@ __metadata: gc-stats: ^1.4.0 mem: ^8.1.1 moleculer: ^0.14.29 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.4.0 pino: ^8.15.0 polka: ^0.5.2 @@ -9492,7 +9500,7 @@ __metadata: eslint: ~8.45.0 eslint-plugin-react-hooks: ^4.6.0 jest: ~29.6.1 - mongodb: ^4.12.1 + mongodb: ^4.17.1 react: ~17.0.2 ts-jest: ~29.0.5 typescript: ~5.2.2 @@ -11893,15 +11901,6 @@ __metadata: languageName: node linkType: hard -"@types/bson@npm:*": - version: 4.2.0 - resolution: "@types/bson@npm:4.2.0" - dependencies: - bson: "*" - checksum: 55abf60c57b7f05655c210b386392636a299a7df18b89cec2cde0aa87374d97dd4ac9632226b0f6fe135d16ad4296ae5ddc782f6e9132d38c53dd26a6df8e704 - languageName: node - linkType: hard - "@types/busboy@npm:^1.5.0": version: 1.5.0 resolution: "@types/busboy@npm:1.5.0" @@ -12580,16 +12579,6 @@ __metadata: languageName: node linkType: hard -"@types/mongodb@npm:^3.6.20": - version: 3.6.20 - resolution: "@types/mongodb@npm:3.6.20" - dependencies: - "@types/bson": "*" - "@types/node": "*" - checksum: e5397ada2ed728997f7c3f5424e8c28f682a635488be967c9c18a5de27b1641cf28bb42bc12026ac6d475c457a880e27097e13c8120350ba13219f4ccc030656 - languageName: node - linkType: hard - "@types/ms@npm:*": version: 0.7.31 resolution: "@types/ms@npm:0.7.31" @@ -13109,13 +13098,6 @@ __metadata: languageName: node linkType: hard -"@types/tmp@npm:^0.2.2": - version: 0.2.3 - resolution: "@types/tmp@npm:0.2.3" - checksum: 0ca45e99b3b3c6959d5c4f4555f73c8007db540cfb0fbbb9373217f9ab85e67eef75193f51a1d6564b0ee6c6f5ffa259d1034d7f7530a5b7ce80acb94cfc4daa - languageName: node - linkType: hard - "@types/tough-cookie@npm:*": version: 4.0.1 resolution: "@types/tough-cookie@npm:4.0.1" @@ -14895,15 +14877,6 @@ __metadata: languageName: node linkType: hard -"async-mutex@npm:^0.3.2": - version: 0.3.2 - resolution: "async-mutex@npm:0.3.2" - dependencies: - tslib: ^2.3.1 - checksum: 620b771dfdea1cad0a6b712915c31a1e3ca880a8cf1eae92b4590f435995e0260929c6ebaae0b9126b1456790ea498064b5bb9a506948cda760f48d3d0dcc4c8 - languageName: node - linkType: hard - "async-retry@npm:^1.3.3": version: 1.3.3 resolution: "async-retry@npm:1.3.3" @@ -15630,16 +15603,6 @@ __metadata: languageName: node linkType: hard -"bl@npm:^2.2.1": - version: 2.2.1 - resolution: "bl@npm:2.2.1" - dependencies: - readable-stream: ^2.3.5 - safe-buffer: ^5.1.1 - checksum: 4f5d9b258919646a8d02f1731379e53b6f6309e34596ae02afbc3aeb183910bd2d0b70681f889b7c620ca48f65dc1cd0992ee1266c90d6d7c3be60688d141233 - languageName: node - linkType: hard - "bl@npm:^4.0.3": version: 4.1.0 resolution: "bl@npm:4.1.0" @@ -16044,19 +16007,12 @@ __metadata: languageName: node linkType: hard -"bson@npm:*, bson@npm:^4.6.4, bson@npm:^4.7.0": - version: 4.7.0 - resolution: "bson@npm:4.7.0" +"bson@npm:^4.6.4, bson@npm:^4.7.2": + version: 4.7.2 + resolution: "bson@npm:4.7.2" dependencies: buffer: ^5.6.0 - checksum: 83e7b64afdad5a505073a7e6206e7b345f59e7888fbcb1948fba72b6101a1baf58b7499314f8e24b650567665f7973eda048aabbb1ddcfbadfba7d6c6b0f5e83 - languageName: node - linkType: hard - -"bson@npm:^1.1.4": - version: 1.1.6 - resolution: "bson@npm:1.1.6" - checksum: 75762c9b7e0b3156cb0f38c7eb9ffcade53f0b04ac87dece9cba38f6dc570d9af91251de6a8988b294063cfaa21894c60ac9e85c34176accb3674acb092d66a7 + checksum: f357d12c5679c8eb029a62e410ad40fb862b7b91f0fc12a3399fb3668e14aecaa63205ffeeee48735a01d393171743607dcd527eb8c058b6f2bd294079ee4125 languageName: node linkType: hard @@ -16491,7 +16447,7 @@ __metadata: languageName: node linkType: hard -"camelcase@npm:^6.0.0, camelcase@npm:^6.1.0, camelcase@npm:^6.2.0, camelcase@npm:^6.3.0": +"camelcase@npm:^6.0.0, camelcase@npm:^6.2.0, camelcase@npm:^6.3.0": version: 6.3.0 resolution: "camelcase@npm:6.3.0" checksum: 8c96818a9076434998511251dcb2761a94817ea17dbdc37f47ac080bd088fc62c7369429a19e2178b993497132c8cbcf5cc1f44ba963e76782ba469c0474938d @@ -18639,7 +18595,7 @@ __metadata: languageName: node linkType: hard -"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.2.0, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4, debug@npm:~4.3.1": +"debug@npm:4, debug@npm:^4.0.0, debug@npm:^4.0.1, debug@npm:^4.1.0, debug@npm:^4.1.1, debug@npm:^4.3.1, debug@npm:^4.3.2, debug@npm:^4.3.4, debug@npm:~4.3.1": version: 4.3.4 resolution: "debug@npm:4.3.4" dependencies: @@ -19004,13 +18960,6 @@ __metadata: languageName: node linkType: hard -"denque@npm:^1.4.1": - version: 1.5.1 - resolution: "denque@npm:1.5.1" - checksum: 4375ad19d5cea99f90effa82a8cecdaa10f4eb261fbcd7e47cd753ff2737f037aac8f7f4e031cc77f3966314c491c86a0d3b20c128aeee57f791b4662c45108e - languageName: node - linkType: hard - "depd@npm:2.0.0, depd@npm:~2.0.0": version: 2.0.0 resolution: "depd@npm:2.0.0" @@ -21529,7 +21478,7 @@ __metadata: languageName: node linkType: hard -"find-cache-dir@npm:^3.2.0, find-cache-dir@npm:^3.3.1, find-cache-dir@npm:^3.3.2": +"find-cache-dir@npm:^3.2.0, find-cache-dir@npm:^3.3.1": version: 3.3.2 resolution: "find-cache-dir@npm:3.3.2" dependencies: @@ -22261,13 +22210,6 @@ __metadata: languageName: node linkType: hard -"get-port@npm:^5.1.1": - version: 5.1.1 - resolution: "get-port@npm:5.1.1" - checksum: 0162663ffe5c09e748cd79d97b74cd70e5a5c84b760a475ce5767b357fb2a57cb821cee412d646aa8a156ed39b78aab88974eddaa9e5ee926173c036c0713787 - languageName: node - linkType: hard - "get-proxy@npm:^2.0.0": version: 2.1.0 resolution: "get-proxy@npm:2.1.0" @@ -27575,15 +27517,6 @@ __metadata: languageName: node linkType: hard -"md5-file@npm:^5.0.0": - version: 5.0.0 - resolution: "md5-file@npm:5.0.0" - bin: - md5-file: cli.js - checksum: c606a00ff58adf5428e8e2f36d86e5d3c7029f9688126faca302cd83b5e92cac183a62e1d1f05fae7c2614e80f993326fd0a8d6a3a913c41ec7ea0eefc25aa76 - languageName: node - linkType: hard - "md5.js@npm:^1.3.4": version: 1.3.5 resolution: "md5.js@npm:1.3.5" @@ -28613,7 +28546,7 @@ __metadata: languageName: node linkType: hard -"mongodb-connection-string-url@npm:^2.5.4": +"mongodb-connection-string-url@npm:^2.6.0": version: 2.6.0 resolution: "mongodb-connection-string-url@npm:2.6.0" dependencies: @@ -28623,87 +28556,39 @@ __metadata: languageName: node linkType: hard -"mongodb-memory-server-core@npm:7.6.3": - version: 7.6.3 - resolution: "mongodb-memory-server-core@npm:7.6.3" +"mongodb@npm:4.17.1, mongodb@npm:^4.3.1": + version: 4.17.1 + resolution: "mongodb@npm:4.17.1" dependencies: - "@types/mongodb": ^3.6.20 - "@types/tmp": ^0.2.2 - async-mutex: ^0.3.2 - camelcase: ^6.1.0 - debug: ^4.2.0 - find-cache-dir: ^3.3.2 - get-port: ^5.1.1 - https-proxy-agent: ^5.0.0 - md5-file: ^5.0.0 - mkdirp: ^1.0.4 - mongodb: ^3.7.3 - new-find-package-json: ^1.1.0 - semver: ^7.3.5 - tar-stream: ^2.1.4 - tmp: ^0.2.1 - tslib: ^2.3.0 - uuid: ^8.3.1 - yauzl: ^2.10.0 - checksum: 2c111f7a90f72b6810e9083da40b8bbf905d1388eb8453f71225ff805a865985efef2c40a88d082baf9ece737b4d9bd3c9fd517d1fcc656aae53e9f62e44ee14 - languageName: node - linkType: hard - -"mongodb-memory-server@npm:^7.6.3": - version: 7.6.3 - resolution: "mongodb-memory-server@npm:7.6.3" - dependencies: - mongodb-memory-server-core: 7.6.3 - tslib: ^2.3.0 - checksum: 8161ad3be8e31012f64ac4a1ac555b10071416ee6de6a50ee1a05d76018eaadacadb34364c29bba73e0877236f2f01163cd0e2dc0432427fbbe69a1fb4eaecbc - languageName: node - linkType: hard - -"mongodb@npm:^3.7.3": - version: 3.7.3 - resolution: "mongodb@npm:3.7.3" - dependencies: - bl: ^2.2.1 - bson: ^1.1.4 - denque: ^1.4.1 - optional-require: ^1.1.8 - safe-buffer: ^5.1.2 - saslprep: ^1.0.0 + "@aws-sdk/credential-providers": ^3.186.0 + "@mongodb-js/saslprep": ^1.1.0 + bson: ^4.7.2 + mongodb-connection-string-url: ^2.6.0 + socks: ^2.7.1 dependenciesMeta: - saslprep: - optional: true - peerDependenciesMeta: - aws4: - optional: true - bson-ext: - optional: true - kerberos: - optional: true - mongodb-client-encryption: - optional: true - mongodb-extjson: + "@aws-sdk/credential-providers": optional: true - snappy: + "@mongodb-js/saslprep": optional: true - checksum: ef7690fe6ee7d1752f121b14e59b3fabfddc60ff0536babce6c945703ad0010de9e6fa7de4c91b99275c256876a72a06899ce27893aba0838c2b542088bd1044 + checksum: e7f280570d0f23d60c308b2a484ed55762ec8e523946c0de1a0b3b398f24efcf1916a745e5407f32cd1c105b2f19d8ac75474c92f73cdf651affe3430a963f54 languageName: node linkType: hard -"mongodb@npm:^4.12.1, mongodb@npm:^4.3.1": - version: 4.12.1 - resolution: "mongodb@npm:4.12.1" +"mongodb@patch:mongodb@npm:4.17.1#.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch::locator=rocket.chat%40workspace%3A.": + version: 4.17.1 + resolution: "mongodb@patch:mongodb@npm%3A4.17.1#.yarn/patches/mongodb-npm-4.17.1-a2fe811ff1.patch::version=4.17.1&hash=f5fa42&locator=rocket.chat%40workspace%3A." dependencies: "@aws-sdk/credential-providers": ^3.186.0 - bson: ^4.7.0 - mongodb-connection-string-url: ^2.5.4 - saslprep: ^1.0.3 + "@mongodb-js/saslprep": ^1.1.0 + bson: ^4.7.2 + mongodb-connection-string-url: ^2.6.0 socks: ^2.7.1 dependenciesMeta: "@aws-sdk/credential-providers": optional: true - saslprep: + "@mongodb-js/saslprep": optional: true - checksum: 84590484b2c93bce849ec1e334b064e983444ed73942061c91e09556348c80db9d4a40544b927cd795bdfbfc51d1b713a7df5ced4ecf13cd00fab5e3c3e32ada + checksum: 7aa00b4000e8f01b18386b6d11033a3216de97ea892a7f10a9c0d0da40a51d91b1c9cbb0e51ff5691487e0fc926d06b5aebb944747153e6fbdaca08cf71d601c languageName: node linkType: hard @@ -29006,16 +28891,6 @@ __metadata: languageName: node linkType: hard -"new-find-package-json@npm:^1.1.0": - version: 1.1.0 - resolution: "new-find-package-json@npm:1.1.0" - dependencies: - debug: ^4.3.2 - tslib: ^2.3.0 - checksum: 818e5a837f87c62fb9bc4893247fd9b7b2ff1bbf25b174af9e9ec22d60d44ce355e60f80ed0657652370cca06e59539c7df292354250820403fa33cd210e76ed - languageName: node - linkType: hard - "nice-try@npm:^1.0.4": version: 1.0.5 resolution: "nice-try@npm:1.0.5" @@ -29914,15 +29789,6 @@ __metadata: languageName: node linkType: hard -"optional-require@npm:^1.1.8": - version: 1.1.8 - resolution: "optional-require@npm:1.1.8" - dependencies: - require-at: ^1.0.6 - checksum: 437db76f713052925185ae80837b593877f75101154e8937f50d33b0b07bd500c214efc9016748642109b6e3e1197eb0513a2963eb06bcf3890f88a2724b1c87 - languageName: node - linkType: hard - "optional@npm:^0.1.3": version: 0.1.4 resolution: "optional@npm:0.1.4" @@ -33937,13 +33803,6 @@ __metadata: languageName: node linkType: hard -"require-at@npm:^1.0.6": - version: 1.0.6 - resolution: "require-at@npm:1.0.6" - checksum: 7753a6ebad99855ef015d5533a787c65e883c94c23371368eebf6f1c7e2a078811013b204823152cbab206a00e825e8e5ca09416fd835a489fa30bf064fbe6d9 - languageName: node - linkType: hard - "require-directory@npm:^2.1.1": version: 2.1.1 resolution: "require-directory@npm:2.1.1" @@ -34266,7 +34125,7 @@ __metadata: jaeger-client: ^3.19.0 mem: ^8.1.1 moleculer: ^0.14.29 - mongodb: ^4.12.1 + mongodb: ^4.17.1 nats: ^2.6.1 npm-run-all: ^4.1.5 pino: ^8.15.0 @@ -34438,15 +34297,6 @@ __metadata: languageName: node linkType: hard -"saslprep@npm:^1.0.0, saslprep@npm:^1.0.3": - version: 1.0.3 - resolution: "saslprep@npm:1.0.3" - dependencies: - sparse-bitfield: ^3.0.3 - checksum: 4fdc0b70fb5e523f977de405e12cca111f1f10dd68a0cfae0ca52c1a7919a94d1556598ba2d35f447655c3b32879846c77f9274c90806f6673248ae3cea6ee43 - languageName: node - linkType: hard - "sass-loader@npm:~10.4.1": version: 10.4.1 resolution: "sass-loader@npm:10.4.1" @@ -37112,15 +36962,6 @@ __metadata: languageName: node linkType: hard -"tmp@npm:^0.2.1": - version: 0.2.1 - resolution: "tmp@npm:0.2.1" - dependencies: - rimraf: ^3.0.0 - checksum: 8b1214654182575124498c87ca986ac53dc76ff36e8f0e0b67139a8d221eaecfdec108c0e6ec54d76f49f1f72ab9325500b246f562b926f85bcdfca8bf35df9e - languageName: node - linkType: hard - "tmpl@npm:1.0.5": version: 1.0.5 resolution: "tmpl@npm:1.0.5" @@ -38678,7 +38519,7 @@ __metadata: languageName: node linkType: hard -"uuid@npm:^8.0.0, uuid@npm:^8.3.1, uuid@npm:^8.3.2": +"uuid@npm:^8.0.0, uuid@npm:^8.3.2": version: 8.3.2 resolution: "uuid@npm:8.3.2" bin: @@ -40173,7 +40014,7 @@ __metadata: languageName: node linkType: hard -"yauzl@npm:^2.10.0, yauzl@npm:^2.4.2": +"yauzl@npm:^2.4.2": version: 2.10.0 resolution: "yauzl@npm:2.10.0" dependencies: From 8d7a37056260a6cc080b8851396dbc49dbf1258b Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 19 Sep 2023 23:10:45 -0300 Subject: [PATCH 204/275] chore: cache incremental ts check (#30447) --- .github/workflows/ci-code-check.yml | 11 +++++++++++ apps/meteor/.gitignore | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-code-check.yml b/.github/workflows/ci-code-check.yml index 5a556a1a8e29..57cdac047423 100644 --- a/.github/workflows/ci-code-check.yml +++ b/.github/workflows/ci-code-check.yml @@ -44,6 +44,17 @@ jobs: - uses: dtinth/setup-github-actions-caching-for-turbo@v1 + - name: Cache TypeCheck + uses: actions/cache@v3 + if: matrix.check == 'ts' + with: + path: ./apps/meteor/tsconfig.typecheck.tsbuildinfo + key: typecheck-cache-${{ runner.OS }}-${{ hashFiles('yarn.lock') }}-${{ github.event.issue.number }} + restore-keys: | + typecheck-cache-${{ runner.OS }}-${{ hashFiles('yarn.lock') }} + typecheck-cache-${{ runner.OS }} + typecheck-cache + - name: TS TypeCheck if: matrix.check == 'ts' run: yarn turbo run typecheck diff --git a/apps/meteor/.gitignore b/apps/meteor/.gitignore index 287cb313c174..a9fd54ab8711 100644 --- a/apps/meteor/.gitignore +++ b/apps/meteor/.gitignore @@ -87,4 +87,5 @@ out.txt dist *-session.json matrix-federation-config/* -.eslintcache \ No newline at end of file +.eslintcache +tsconfig.typecheck.tsbuildinfo From 27c75f15f3cb1f49e8228a75de2332d71cc8fd3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrique=20Guimar=C3=A3es=20Ribeiro?= Date: Wed, 27 Sep 2023 10:30:14 -0300 Subject: [PATCH 205/275] feat: New records page analytics tab (#30373) --- .changeset/fluffy-monkeys-sing.md | 5 +++ apps/meteor/client/views/admin/routes.tsx | 6 +-- .../meteor/client/views/admin/sidebarItems.ts | 4 +- .../views/admin/viewLogs/AnalyticsReports.tsx | 38 +++++++++++++++++++ .../views/admin/viewLogs/ViewLogsPage.tsx | 18 +++++++-- .../viewLogs/hooks/useAnalyticsObject.ts | 8 ++++ .../rocketchat-i18n/i18n/en.i18n.json | 4 ++ 7 files changed, 75 insertions(+), 8 deletions(-) create mode 100644 .changeset/fluffy-monkeys-sing.md create mode 100644 apps/meteor/client/views/admin/viewLogs/AnalyticsReports.tsx create mode 100644 apps/meteor/client/views/admin/viewLogs/hooks/useAnalyticsObject.ts diff --git a/.changeset/fluffy-monkeys-sing.md b/.changeset/fluffy-monkeys-sing.md new file mode 100644 index 000000000000..db93491b0ecd --- /dev/null +++ b/.changeset/fluffy-monkeys-sing.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Changed the name of the administration Logs page to "Records", implemented a tab layout in this page and added a new tab called "Analytic reports" that shows the most recent result of the statistics endpoint. diff --git a/apps/meteor/client/views/admin/routes.tsx b/apps/meteor/client/views/admin/routes.tsx index fa418b986cc1..a25bea5affaa 100644 --- a/apps/meteor/client/views/admin/routes.tsx +++ b/apps/meteor/client/views/admin/routes.tsx @@ -70,8 +70,8 @@ declare module '@rocket.chat/ui-contexts' { pattern: '/admin/registration/:page?'; }; 'admin-view-logs': { - pathname: '/admin/logs'; - pattern: '/admin/logs'; + pathname: '/admin/records'; + pattern: '/admin/records'; }; 'federation-dashboard': { pathname: '/admin/federation'; @@ -193,7 +193,7 @@ registerAdminRoute('/registration/:page?', { component: lazy(() => import('./cloud/CloudRoute')), }); -registerAdminRoute('/logs', { +registerAdminRoute('/records', { name: 'admin-view-logs', component: lazy(() => import('./viewLogs/ViewLogsRoute')), }); diff --git a/apps/meteor/client/views/admin/sidebarItems.ts b/apps/meteor/client/views/admin/sidebarItems.ts index c397e28e6db1..50a3284b5ed1 100644 --- a/apps/meteor/client/views/admin/sidebarItems.ts +++ b/apps/meteor/client/views/admin/sidebarItems.ts @@ -112,8 +112,8 @@ export const { permissionGranted: (): boolean => hasPermission('run-import'), }, { - href: '/admin/logs', - i18nLabel: 'Logs', + href: '/admin/records', + i18nLabel: 'Records', icon: 'post', permissionGranted: (): boolean => hasPermission('view-logs'), }, diff --git a/apps/meteor/client/views/admin/viewLogs/AnalyticsReports.tsx b/apps/meteor/client/views/admin/viewLogs/AnalyticsReports.tsx new file mode 100644 index 000000000000..7771298ceb73 --- /dev/null +++ b/apps/meteor/client/views/admin/viewLogs/AnalyticsReports.tsx @@ -0,0 +1,38 @@ +import { Box, Icon, Skeleton } from '@rocket.chat/fuselage'; +import { useTranslation } from '@rocket.chat/ui-contexts'; +import React from 'react'; + +import { useAnalyticsObject } from './hooks/useAnalyticsObject'; + +const AnalyticsReports = () => { + const t = useTranslation(); + + const { data, isLoading, isSuccess, isError } = useAnalyticsObject(); + + return ( + <> + + + + + + {t('How_and_why_we_collect_usage_data')} + + {t('Analytics_page_briefing')} + + + {isSuccess &&
{JSON.stringify(data, null, '\t')}
} + {isError && t('Something_went_wrong_try_again_later')} + {isLoading && ( + <> + + + + + )} +
+ + ); +}; + +export default AnalyticsReports; diff --git a/apps/meteor/client/views/admin/viewLogs/ViewLogsPage.tsx b/apps/meteor/client/views/admin/viewLogs/ViewLogsPage.tsx index a75c22da19b0..4463fec8f5bf 100644 --- a/apps/meteor/client/views/admin/viewLogs/ViewLogsPage.tsx +++ b/apps/meteor/client/views/admin/viewLogs/ViewLogsPage.tsx @@ -1,18 +1,30 @@ +import { Tabs } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; -import React from 'react'; +import React, { useState } from 'react'; import Page from '../../../components/Page'; +import AnalyticsReports from './AnalyticsReports'; import ServerLogs from './ServerLogs'; const ViewLogsPage = (): ReactElement => { const t = useTranslation(); + const [tab, setTab] = useState('Logs'); + return ( - + - + + setTab('Logs')} selected={tab === 'Logs'}> + {t('Logs')} + + setTab('Analytics')} selected={tab === 'Analytics'}> + {t('Analytic_reports')} + + + {tab === 'Logs' ? : } ); diff --git a/apps/meteor/client/views/admin/viewLogs/hooks/useAnalyticsObject.ts b/apps/meteor/client/views/admin/viewLogs/hooks/useAnalyticsObject.ts new file mode 100644 index 000000000000..8aad0e605964 --- /dev/null +++ b/apps/meteor/client/views/admin/viewLogs/hooks/useAnalyticsObject.ts @@ -0,0 +1,8 @@ +import { useEndpoint } from '@rocket.chat/ui-contexts'; +import { useQuery } from '@tanstack/react-query'; + +export const useAnalyticsObject = () => { + const getAnalytics = useEndpoint('GET', '/v1/statistics'); + + return useQuery(['analytics'], () => getAnalytics({}), { staleTime: 10 * 60 * 1000 }); +}; diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 849f00c11428..0df90c85bd8e 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -415,6 +415,7 @@ "Also_send_to_channel": "Also send to channel", "Always_open_in_new_window": "Always Open in New Window", "Always_show_thread_replies_in_main_channel": "Always show thread replies in main channel", + "Analytic_reports": "Analytic reports", "Analytics": "Analytics", "Analytics_Description": "See how users interact with your workspace.", "Analytics_features_enabled": "Features Enabled", @@ -423,6 +424,7 @@ "Analytics_features_users_Description": "Tracks custom events related to actions related to users (password reset times, profile picture change, etc).", "Analytics_Google": "Google Analytics", "Analytics_Google_id": "Tracking ID", + "Analytics_page_briefing": "Rocket.Chat collects anonymous usage data to identify how many instances are deployed and to improve the product for all users. We take your privacy seriously, so the usage data is encrypted and stored securely.", "Analyze_practical_usage": "Analyze practical usage statistics about users, messages and channels", "and": "and", "And_more": "And {{length}} more", @@ -2471,6 +2473,7 @@ "Hospitality_Businness": "Hospitality Business", "hours": "hours", "Hours": "Hours", + "How_and_why_we_collect_usage_data": "How and why we collect usage data", "How_friendly_was_the_chat_agent": "How friendly was the chat agent?", "How_knowledgeable_was_the_chat_agent": "How knowledgeable was the chat agent?", "How_long_to_wait_after_agent_goes_offline": "How Long to Wait After Agent Goes Offline", @@ -4165,6 +4168,7 @@ "Receive_Login_Detection_Emails_Description": "Receive an email each time a new login is detected on your account.", "Recent_Import_History": "Recent Import History", "Record": "Record", + "Records": "Records", "recording": "recording", "Redirect_URI": "Redirect URI", "Redirect_URL_does_not_match": "Redirect URL does not match", From e2f60199ab9ff28c901de635e2228f82e92f9999 Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Wed, 27 Sep 2023 16:50:24 +0000 Subject: [PATCH 206/275] Release 6.4.0 [no ci] --- .changeset/blue-ladybugs-raise.md | 5 - .changeset/breezy-bugs-jam.md | 5 - .changeset/bright-carpets-fly.md | 7 - .changeset/bright-snakes-vanish.md | 9 - .changeset/brown-clouds-add.md | 5 - .changeset/bump-patch-1694741499930.md | 5 - .changeset/bump-patch-1694827499043.md | 5 - .changeset/bump-patch-1695163548038.md | 5 - .changeset/bump-patch-1695165575069.md | 5 - .changeset/bump-patch-1695789755733.md | 5 - .changeset/chilled-flies-fold.md | 5 - .changeset/chilled-phones-give.md | 7 - .changeset/cool-students-tan.md | 5 - .changeset/cuddly-donkeys-remember.md | 5 - .changeset/cuddly-houses-tie.md | 5 - .changeset/cuddly-ties-bake.md | 6 - .changeset/curly-shoes-burn.md | 5 - .changeset/custom-emoji-fs.md | 5 - .changeset/dropdown.md | 5 - .changeset/eighty-kids-jog.md | 6 - .changeset/eleven-icons-tan.md | 8 - .changeset/empty-ants-enjoy.md | 5 - .changeset/fair-cats-destroy.md | 6 - .changeset/fast-pumpkins-smoke.md | 5 - .changeset/fast-yaks-collect.md | 5 - .changeset/fifty-cars-divide.md | 5 - .changeset/fluffy-beds-buy.md | 5 - .changeset/fluffy-lions-rage.md | 5 - .changeset/forty-hotels-pretend.md | 5 - .changeset/four-parents-cheer.md | 5 - .changeset/friendly-glasses-mate.md | 5 - .changeset/fuzzy-glasses-divide.md | 5 - .changeset/fuzzy-schools-brake.md | 5 - .changeset/gold-horses-pretend.md | 5 - .changeset/gold-moose-press.md | 5 - .changeset/good-elephants-live.md | 5 - .changeset/green-adults-peel.md | 5 - .changeset/grumpy-candles-rule.md | 5 - .changeset/heavy-baboons-laugh.md | 5 - .changeset/heavy-cougars-marry.md | 5 - .changeset/heavy-zebras-wonder.md | 5 - .changeset/hip-hounds-ring.md | 5 - .changeset/hip-mugs-promise.md | 5 - .changeset/honest-glasses-roll.md | 5 - .changeset/honest-mirrors-sit.md | 5 - .changeset/honest-numbers-compete.md | 5 - .changeset/importer-progress-bar.md | 6 - .changeset/kind-students-worry.md | 5 - .changeset/lazy-ghosts-design.md | 5 - .changeset/loud-sheep-try.md | 6 - .changeset/lovely-snails-drop.md | 6 - .changeset/lucky-balloons-divide.md | 5 - .changeset/lucky-hounds-sing.md | 5 - .changeset/many-icons-provide.md | 5 - .changeset/mighty-walls-smash.md | 5 - .changeset/moody-comics-cheat.md | 5 - .changeset/moody-pans-act.md | 5 - .changeset/nine-bottles-press.md | 5 - .changeset/nine-carrots-listen.md | 5 - .changeset/odd-elephants-promise.md | 5 - .changeset/old-federation-card.md | 5 - .changeset/perfect-adults-travel.md | 6 - .changeset/pink-zoos-join.md | 5 - .changeset/pre.json | 172 ----------------- .changeset/pretty-bees-give.md | 6 - .changeset/quick-emus-march.md | 7 - .changeset/quiet-phones-sell.md | 5 - .changeset/rare-sheep-yawn.md | 5 - .changeset/real-pets-visit.md | 6 - .changeset/red-windows-admire.md | 5 - .changeset/red-zebras-clap.md | 5 - .changeset/rotten-turtles-agree.md | 5 - .changeset/serious-garlics-clean.md | 7 - .changeset/serious-geckos-drive.md | 8 - .changeset/serious-shrimps-try.md | 5 - .changeset/seven-jobs-tickle.md | 6 - .changeset/shaggy-beans-poke.md | 5 - .changeset/shiny-garlics-carry.md | 5 - .changeset/shiny-tools-worry.md | 5 - .changeset/short-cobras-tell.md | 5 - .changeset/silly-actors-laugh.md | 5 - .changeset/silver-mugs-unite.md | 5 - .changeset/six-buckets-eat.md | 5 - .changeset/slimy-cheetahs-heal.md | 5 - .changeset/slimy-wasps-double.md | 7 - .changeset/slow-lizards-breathe.md | 5 - .changeset/small-rice-repair.md | 5 - .changeset/smooth-planes-cough.md | 7 - .changeset/soft-yaks-matter.md | 5 - .changeset/sour-cows-refuse.md | 5 - .changeset/sour-parrots-nail.md | 5 - .changeset/stale-roses-knock.md | 5 - .changeset/strong-laws-pump.md | 8 - .changeset/swift-birds-build.md | 5 - .changeset/swift-walls-protect.md | 5 - .changeset/tall-pumpkins-cross.md | 5 - .changeset/tame-pens-occur.md | 6 - .changeset/thirty-pumpkins-fix.md | 8 - .changeset/three-ants-give.md | 8 - .changeset/three-birds-tickle.md | 5 - .changeset/tidy-bears-camp.md | 5 - .changeset/tiny-turkeys-burn.md | 5 - .changeset/tough-candles-heal.md | 7 - .changeset/tricky-years-swim.md | 6 - .changeset/unlucky-turtles-search.md | 5 - .changeset/user-mention.md | 5 - .changeset/violet-frogs-cheer.md | 5 - .changeset/warm-hornets-ring.md | 6 - .changeset/wet-frogs-kiss.md | 5 - .changeset/wet-walls-lie.md | 5 - .changeset/wild-spiders-smell.md | 5 - .changeset/wise-onions-trade.md | 11 -- .changeset/wise-walls-tan.md | 6 - .changeset/wise-ways-fetch.md | 5 - .changeset/witty-feet-warn.md | 5 - .changeset/yellow-buttons-agree.md | 6 - .changeset/yellow-schools-tell.md | 5 - .changeset/young-trains-glow.md | 5 - apps/meteor/.docker/Dockerfile.rhel | 2 +- apps/meteor/CHANGELOG.md | 180 ++++++++++++++++++ apps/meteor/app/utils/rocketchat.info | 2 +- apps/meteor/ee/server/services/CHANGELOG.md | 29 +++ apps/meteor/ee/server/services/package.json | 2 +- apps/meteor/package.json | 2 +- ee/apps/account-service/CHANGELOG.md | 29 +++ ee/apps/account-service/package.json | 2 +- ee/apps/authorization-service/CHANGELOG.md | 29 +++ ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/CHANGELOG.md | 33 ++++ ee/apps/ddp-streamer/package.json | 2 +- ee/apps/omnichannel-transcript/CHANGELOG.md | 27 +++ ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/CHANGELOG.md | 26 +++ ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/CHANGELOG.md | 25 +++ ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/CHANGELOG.md | 24 +++ ee/apps/stream-hub-service/package.json | 2 +- ee/packages/api-client/CHANGELOG.md | 20 ++ ee/packages/api-client/package.json | 2 +- ee/packages/ddp-client/CHANGELOG.md | 21 ++ ee/packages/ddp-client/package.json | 2 +- ee/packages/omnichannel-services/CHANGELOG.md | 31 +++ ee/packages/omnichannel-services/package.json | 2 +- ee/packages/pdf-worker/CHANGELOG.md | 14 ++ ee/packages/pdf-worker/package.json | 2 +- ee/packages/presence/CHANGELOG.md | 19 ++ ee/packages/presence/package.json | 2 +- ee/packages/ui-theming/CHANGELOG.md | 6 + ee/packages/ui-theming/package.json | 2 +- package.json | 2 +- packages/core-services/CHANGELOG.md | 26 +++ packages/core-services/package.json | 2 +- packages/core-typings/CHANGELOG.md | 16 ++ packages/core-typings/package.json | 2 +- packages/cron/CHANGELOG.md | 20 ++ packages/cron/package.json | 2 +- packages/eslint-config/CHANGELOG.md | 6 + packages/eslint-config/package.json | 2 +- packages/fuselage-ui-kit/CHANGELOG.md | 19 ++ packages/fuselage-ui-kit/package.json | 8 +- packages/gazzodown/CHANGELOG.md | 19 ++ packages/gazzodown/package.json | 8 +- packages/i18n/CHANGELOG.md | 6 + packages/i18n/package.json | 2 +- packages/instance-status/CHANGELOG.md | 6 + packages/instance-status/package.json | 2 +- packages/livechat/CHANGELOG.md | 14 ++ packages/livechat/package.json | 2 +- packages/mock-providers/CHANGELOG.md | 8 + packages/mock-providers/package.json | 2 +- packages/model-typings/CHANGELOG.md | 27 +++ packages/model-typings/package.json | 2 +- packages/models/CHANGELOG.md | 13 ++ packages/models/package.json | 2 +- packages/release-action/CHANGELOG.md | 11 ++ packages/release-action/package.json | 2 +- packages/rest-typings/CHANGELOG.md | 27 +++ packages/rest-typings/package.json | 2 +- packages/tools/CHANGELOG.md | 6 + packages/tools/package.json | 2 +- packages/ui-client/CHANGELOG.md | 14 ++ packages/ui-client/package.json | 4 +- packages/ui-contexts/CHANGELOG.md | 28 +++ packages/ui-contexts/package.json | 2 +- packages/ui-video-conf/CHANGELOG.md | 8 + packages/ui-video-conf/package.json | 4 +- packages/uikit-playground/CHANGELOG.md | 19 ++ packages/uikit-playground/package.json | 2 +- packages/web-ui-registration/CHANGELOG.md | 9 + packages/web-ui-registration/package.json | 4 +- yarn.lock | 16 +- 192 files changed, 870 insertions(+), 866 deletions(-) delete mode 100644 .changeset/blue-ladybugs-raise.md delete mode 100644 .changeset/breezy-bugs-jam.md delete mode 100644 .changeset/bright-carpets-fly.md delete mode 100644 .changeset/bright-snakes-vanish.md delete mode 100644 .changeset/brown-clouds-add.md delete mode 100644 .changeset/bump-patch-1694741499930.md delete mode 100644 .changeset/bump-patch-1694827499043.md delete mode 100644 .changeset/bump-patch-1695163548038.md delete mode 100644 .changeset/bump-patch-1695165575069.md delete mode 100644 .changeset/bump-patch-1695789755733.md delete mode 100644 .changeset/chilled-flies-fold.md delete mode 100644 .changeset/chilled-phones-give.md delete mode 100644 .changeset/cool-students-tan.md delete mode 100644 .changeset/cuddly-donkeys-remember.md delete mode 100644 .changeset/cuddly-houses-tie.md delete mode 100644 .changeset/cuddly-ties-bake.md delete mode 100644 .changeset/curly-shoes-burn.md delete mode 100644 .changeset/custom-emoji-fs.md delete mode 100644 .changeset/dropdown.md delete mode 100644 .changeset/eighty-kids-jog.md delete mode 100644 .changeset/eleven-icons-tan.md delete mode 100644 .changeset/empty-ants-enjoy.md delete mode 100644 .changeset/fair-cats-destroy.md delete mode 100644 .changeset/fast-pumpkins-smoke.md delete mode 100644 .changeset/fast-yaks-collect.md delete mode 100644 .changeset/fifty-cars-divide.md delete mode 100644 .changeset/fluffy-beds-buy.md delete mode 100644 .changeset/fluffy-lions-rage.md delete mode 100644 .changeset/forty-hotels-pretend.md delete mode 100644 .changeset/four-parents-cheer.md delete mode 100644 .changeset/friendly-glasses-mate.md delete mode 100644 .changeset/fuzzy-glasses-divide.md delete mode 100644 .changeset/fuzzy-schools-brake.md delete mode 100644 .changeset/gold-horses-pretend.md delete mode 100644 .changeset/gold-moose-press.md delete mode 100644 .changeset/good-elephants-live.md delete mode 100644 .changeset/green-adults-peel.md delete mode 100644 .changeset/grumpy-candles-rule.md delete mode 100644 .changeset/heavy-baboons-laugh.md delete mode 100644 .changeset/heavy-cougars-marry.md delete mode 100644 .changeset/heavy-zebras-wonder.md delete mode 100644 .changeset/hip-hounds-ring.md delete mode 100644 .changeset/hip-mugs-promise.md delete mode 100644 .changeset/honest-glasses-roll.md delete mode 100644 .changeset/honest-mirrors-sit.md delete mode 100644 .changeset/honest-numbers-compete.md delete mode 100644 .changeset/importer-progress-bar.md delete mode 100644 .changeset/kind-students-worry.md delete mode 100644 .changeset/lazy-ghosts-design.md delete mode 100644 .changeset/loud-sheep-try.md delete mode 100644 .changeset/lovely-snails-drop.md delete mode 100644 .changeset/lucky-balloons-divide.md delete mode 100644 .changeset/lucky-hounds-sing.md delete mode 100644 .changeset/many-icons-provide.md delete mode 100644 .changeset/mighty-walls-smash.md delete mode 100644 .changeset/moody-comics-cheat.md delete mode 100644 .changeset/moody-pans-act.md delete mode 100644 .changeset/nine-bottles-press.md delete mode 100644 .changeset/nine-carrots-listen.md delete mode 100644 .changeset/odd-elephants-promise.md delete mode 100644 .changeset/old-federation-card.md delete mode 100644 .changeset/perfect-adults-travel.md delete mode 100644 .changeset/pink-zoos-join.md delete mode 100644 .changeset/pre.json delete mode 100644 .changeset/pretty-bees-give.md delete mode 100644 .changeset/quick-emus-march.md delete mode 100644 .changeset/quiet-phones-sell.md delete mode 100644 .changeset/rare-sheep-yawn.md delete mode 100644 .changeset/real-pets-visit.md delete mode 100644 .changeset/red-windows-admire.md delete mode 100644 .changeset/red-zebras-clap.md delete mode 100644 .changeset/rotten-turtles-agree.md delete mode 100644 .changeset/serious-garlics-clean.md delete mode 100644 .changeset/serious-geckos-drive.md delete mode 100644 .changeset/serious-shrimps-try.md delete mode 100644 .changeset/seven-jobs-tickle.md delete mode 100644 .changeset/shaggy-beans-poke.md delete mode 100644 .changeset/shiny-garlics-carry.md delete mode 100644 .changeset/shiny-tools-worry.md delete mode 100644 .changeset/short-cobras-tell.md delete mode 100644 .changeset/silly-actors-laugh.md delete mode 100644 .changeset/silver-mugs-unite.md delete mode 100644 .changeset/six-buckets-eat.md delete mode 100644 .changeset/slimy-cheetahs-heal.md delete mode 100644 .changeset/slimy-wasps-double.md delete mode 100644 .changeset/slow-lizards-breathe.md delete mode 100644 .changeset/small-rice-repair.md delete mode 100644 .changeset/smooth-planes-cough.md delete mode 100644 .changeset/soft-yaks-matter.md delete mode 100644 .changeset/sour-cows-refuse.md delete mode 100644 .changeset/sour-parrots-nail.md delete mode 100644 .changeset/stale-roses-knock.md delete mode 100644 .changeset/strong-laws-pump.md delete mode 100644 .changeset/swift-birds-build.md delete mode 100644 .changeset/swift-walls-protect.md delete mode 100644 .changeset/tall-pumpkins-cross.md delete mode 100644 .changeset/tame-pens-occur.md delete mode 100644 .changeset/thirty-pumpkins-fix.md delete mode 100644 .changeset/three-ants-give.md delete mode 100644 .changeset/three-birds-tickle.md delete mode 100644 .changeset/tidy-bears-camp.md delete mode 100644 .changeset/tiny-turkeys-burn.md delete mode 100644 .changeset/tough-candles-heal.md delete mode 100644 .changeset/tricky-years-swim.md delete mode 100644 .changeset/unlucky-turtles-search.md delete mode 100644 .changeset/user-mention.md delete mode 100644 .changeset/violet-frogs-cheer.md delete mode 100644 .changeset/warm-hornets-ring.md delete mode 100644 .changeset/wet-frogs-kiss.md delete mode 100644 .changeset/wet-walls-lie.md delete mode 100644 .changeset/wild-spiders-smell.md delete mode 100644 .changeset/wise-onions-trade.md delete mode 100644 .changeset/wise-walls-tan.md delete mode 100644 .changeset/wise-ways-fetch.md delete mode 100644 .changeset/witty-feet-warn.md delete mode 100644 .changeset/yellow-buttons-agree.md delete mode 100644 .changeset/yellow-schools-tell.md delete mode 100644 .changeset/young-trains-glow.md diff --git a/.changeset/blue-ladybugs-raise.md b/.changeset/blue-ladybugs-raise.md deleted file mode 100644 index 44d7a06b4111..000000000000 --- a/.changeset/blue-ladybugs-raise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Translation files are requested multiple times diff --git a/.changeset/breezy-bugs-jam.md b/.changeset/breezy-bugs-jam.md deleted file mode 100644 index 7e7cc7b8283b..000000000000 --- a/.changeset/breezy-bugs-jam.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fix: Managers allowed to make deactivated agent's available diff --git a/.changeset/bright-carpets-fly.md b/.changeset/bright-carpets-fly.md deleted file mode 100644 index 6a8ac2608569..000000000000 --- a/.changeset/bright-carpets-fly.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@rocket.chat/core-typings': minor -'@rocket.chat/rest-typings': minor -'@rocket.chat/meteor': minor ---- - -new: ring mobile users on direct conference calls diff --git a/.changeset/bright-snakes-vanish.md b/.changeset/bright-snakes-vanish.md deleted file mode 100644 index f198bfe93ae9..000000000000 --- a/.changeset/bright-snakes-vanish.md +++ /dev/null @@ -1,9 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixed an issue causing `queue time` to be calculated from current time when a room was closed without being served. -Now: -- For served rooms: queue time = servedBy time - queuedAt -- For not served, but open rooms = now - queuedAt -- For not served and closed rooms = closedAt - queuedAt diff --git a/.changeset/brown-clouds-add.md b/.changeset/brown-clouds-add.md deleted file mode 100644 index 6b69289177b5..000000000000 --- a/.changeset/brown-clouds-add.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fix: Performance issue on `Messages.countByType` aggregation caused by unindexed property on messages collection diff --git a/.changeset/bump-patch-1694741499930.md b/.changeset/bump-patch-1694741499930.md deleted file mode 100644 index e1eaa7980afb..000000000000 --- a/.changeset/bump-patch-1694741499930.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Bump @rocket.chat/meteor version. diff --git a/.changeset/bump-patch-1694827499043.md b/.changeset/bump-patch-1694827499043.md deleted file mode 100644 index e1eaa7980afb..000000000000 --- a/.changeset/bump-patch-1694827499043.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Bump @rocket.chat/meteor version. diff --git a/.changeset/bump-patch-1695163548038.md b/.changeset/bump-patch-1695163548038.md deleted file mode 100644 index e1eaa7980afb..000000000000 --- a/.changeset/bump-patch-1695163548038.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Bump @rocket.chat/meteor version. diff --git a/.changeset/bump-patch-1695165575069.md b/.changeset/bump-patch-1695165575069.md deleted file mode 100644 index e1eaa7980afb..000000000000 --- a/.changeset/bump-patch-1695165575069.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Bump @rocket.chat/meteor version. diff --git a/.changeset/bump-patch-1695789755733.md b/.changeset/bump-patch-1695789755733.md deleted file mode 100644 index e1eaa7980afb..000000000000 --- a/.changeset/bump-patch-1695789755733.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Bump @rocket.chat/meteor version. diff --git a/.changeset/chilled-flies-fold.md b/.changeset/chilled-flies-fold.md deleted file mode 100644 index 17a0f9eb6dc5..000000000000 --- a/.changeset/chilled-flies-fold.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -feat: add sections to room header and user infos menus with menuV2 diff --git a/.changeset/chilled-phones-give.md b/.changeset/chilled-phones-give.md deleted file mode 100644 index cb0887db0883..000000000000 --- a/.changeset/chilled-phones-give.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@rocket.chat/meteor": patch -"@rocket.chat/core-typings": patch -"@rocket.chat/rest-typings": patch ---- - -Fixed `overrideDestinationChannelEnabled` treated as a required param in `integrations.create` and `integration.update` endpoints diff --git a/.changeset/cool-students-tan.md b/.changeset/cool-students-tan.md deleted file mode 100644 index 07760541628a..000000000000 --- a/.changeset/cool-students-tan.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -feat(apps): `ActionManagerBusyState` component for apps `ui.interaction` diff --git a/.changeset/cuddly-donkeys-remember.md b/.changeset/cuddly-donkeys-remember.md deleted file mode 100644 index 237aafe7f95b..000000000000 --- a/.changeset/cuddly-donkeys-remember.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixed custom translations not being displayed diff --git a/.changeset/cuddly-houses-tie.md b/.changeset/cuddly-houses-tie.md deleted file mode 100644 index 76d86a690388..000000000000 --- a/.changeset/cuddly-houses-tie.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Hide Reset TOTP option if 2FA is disabled diff --git a/.changeset/cuddly-ties-bake.md b/.changeset/cuddly-ties-bake.md deleted file mode 100644 index d912d2969d75..000000000000 --- a/.changeset/cuddly-ties-bake.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@rocket.chat/fuselage-ui-kit": minor -"@rocket.chat/uikit-playground": minor ---- - -feat: Add missing variants to UIKit button diff --git a/.changeset/curly-shoes-burn.md b/.changeset/curly-shoes-burn.md deleted file mode 100644 index 67d453ab7245..000000000000 --- a/.changeset/curly-shoes-burn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Added ability to freeze or completely disable integration scripts through envvars diff --git a/.changeset/custom-emoji-fs.md b/.changeset/custom-emoji-fs.md deleted file mode 100644 index a9a797f35bc8..000000000000 --- a/.changeset/custom-emoji-fs.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fix: custom emoji upload with FileSystem method diff --git a/.changeset/dropdown.md b/.changeset/dropdown.md deleted file mode 100644 index 935c12aebe85..000000000000 --- a/.changeset/dropdown.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -New filters to the Rooms Table at `Workspace > Rooms` diff --git a/.changeset/eighty-kids-jog.md b/.changeset/eighty-kids-jog.md deleted file mode 100644 index 6410813d80a6..000000000000 --- a/.changeset/eighty-kids-jog.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@rocket.chat/livechat': minor -'@rocket.chat/meteor': minor ---- - -Added new Omnichannel's trigger condition "After starting a chat". diff --git a/.changeset/eleven-icons-tan.md b/.changeset/eleven-icons-tan.md deleted file mode 100644 index c51124c05dd2..000000000000 --- a/.changeset/eleven-icons-tan.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@rocket.chat/meteor": minor -"@rocket.chat/core-typings": minor -"@rocket.chat/model-typings": minor -"@rocket.chat/rest-typings": minor ---- - -Introduce the ability to report an user diff --git a/.changeset/empty-ants-enjoy.md b/.changeset/empty-ants-enjoy.md deleted file mode 100644 index 4a55f82d0abf..000000000000 --- a/.changeset/empty-ants-enjoy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': minor ---- - -fix: Wrong toast message while creating a new custom sound with an existing name diff --git a/.changeset/fair-cats-destroy.md b/.changeset/fair-cats-destroy.md deleted file mode 100644 index 7dfb74955a94..000000000000 --- a/.changeset/fair-cats-destroy.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@rocket.chat/meteor": patch -"@rocket.chat/model-typings": patch ---- - -When setting a room as read-only, do not allow previously unmuted users to send messages. diff --git a/.changeset/fast-pumpkins-smoke.md b/.changeset/fast-pumpkins-smoke.md deleted file mode 100644 index 2374776bf3b5..000000000000 --- a/.changeset/fast-pumpkins-smoke.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -fix: finnish translation diff --git a/.changeset/fast-yaks-collect.md b/.changeset/fast-yaks-collect.md deleted file mode 100644 index 60dd92030163..000000000000 --- a/.changeset/fast-yaks-collect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -fixed an issue where 2fa was not working after an OAuth redirect diff --git a/.changeset/fifty-cars-divide.md b/.changeset/fifty-cars-divide.md deleted file mode 100644 index 6c09cf6869c8..000000000000 --- a/.changeset/fifty-cars-divide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixed issue with custom OAuth services' settings not being be fully removed diff --git a/.changeset/fluffy-beds-buy.md b/.changeset/fluffy-beds-buy.md deleted file mode 100644 index f90513b946c3..000000000000 --- a/.changeset/fluffy-beds-buy.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": minor ---- - -Added support for threaded conversation in Federated rooms. diff --git a/.changeset/fluffy-lions-rage.md b/.changeset/fluffy-lions-rage.md deleted file mode 100644 index 09437a2cb88e..000000000000 --- a/.changeset/fluffy-lions-rage.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/livechat": patch ---- - -chore: (Livechat) Replace all `dangerouslySetInnerHTML` with `gazzodown` diff --git a/.changeset/forty-hotels-pretend.md b/.changeset/forty-hotels-pretend.md deleted file mode 100644 index b23825d5a02a..000000000000 --- a/.changeset/forty-hotels-pretend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fix: Prevent `RoomProvider.useEffect` from subscribing to room-data stream multiple times diff --git a/.changeset/four-parents-cheer.md b/.changeset/four-parents-cheer.md deleted file mode 100644 index 2fbb8e2b279f..000000000000 --- a/.changeset/four-parents-cheer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -load sounds right before playing them diff --git a/.changeset/friendly-glasses-mate.md b/.changeset/friendly-glasses-mate.md deleted file mode 100644 index 6a7a7b4f8546..000000000000 --- a/.changeset/friendly-glasses-mate.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': minor ---- - -fix: Time format of Retention Policy diff --git a/.changeset/fuzzy-glasses-divide.md b/.changeset/fuzzy-glasses-divide.md deleted file mode 100644 index cf77bbde5507..000000000000 --- a/.changeset/fuzzy-glasses-divide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': minor ---- - -Added a new Roles bridge to RC Apps-Engine for reading and retrieving role details. diff --git a/.changeset/fuzzy-schools-brake.md b/.changeset/fuzzy-schools-brake.md deleted file mode 100644 index c6af54a2ef57..000000000000 --- a/.changeset/fuzzy-schools-brake.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fix users being created without the `roles` field diff --git a/.changeset/gold-horses-pretend.md b/.changeset/gold-horses-pretend.md deleted file mode 100644 index a8908b68a23e..000000000000 --- a/.changeset/gold-horses-pretend.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixed CAS login after popup closes diff --git a/.changeset/gold-moose-press.md b/.changeset/gold-moose-press.md deleted file mode 100644 index 605fb7c649ea..000000000000 --- a/.changeset/gold-moose-press.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fix moment timestamps language change diff --git a/.changeset/good-elephants-live.md b/.changeset/good-elephants-live.md deleted file mode 100644 index 8cb3e9d87fc4..000000000000 --- a/.changeset/good-elephants-live.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fixed message fetching method in LivechatBridge for Apps diff --git a/.changeset/green-adults-peel.md b/.changeset/green-adults-peel.md deleted file mode 100644 index b07f5ea3e6bf..000000000000 --- a/.changeset/green-adults-peel.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fix pruning messages in a room results in an incorrect message counter diff --git a/.changeset/grumpy-candles-rule.md b/.changeset/grumpy-candles-rule.md deleted file mode 100644 index 28673ce91a73..000000000000 --- a/.changeset/grumpy-candles-rule.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -fix: rejected conference calls continue to ring diff --git a/.changeset/heavy-baboons-laugh.md b/.changeset/heavy-baboons-laugh.md deleted file mode 100644 index 5c32965dcf62..000000000000 --- a/.changeset/heavy-baboons-laugh.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -User information crashing for some locales diff --git a/.changeset/heavy-cougars-marry.md b/.changeset/heavy-cougars-marry.md deleted file mode 100644 index 893f53352114..000000000000 --- a/.changeset/heavy-cougars-marry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fix performance issue on Engagement Dashboard aggregation diff --git a/.changeset/heavy-zebras-wonder.md b/.changeset/heavy-zebras-wonder.md deleted file mode 100644 index a1904a81c514..000000000000 --- a/.changeset/heavy-zebras-wonder.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Show correct date for last day time diff --git a/.changeset/hip-hounds-ring.md b/.changeset/hip-hounds-ring.md deleted file mode 100644 index 79dfba6dd031..000000000000 --- a/.changeset/hip-hounds-ring.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Added ability to disable private app installation via envvar (DISABLE_PRIVATE_APP_INSTALLATION) diff --git a/.changeset/hip-mugs-promise.md b/.changeset/hip-mugs-promise.md deleted file mode 100644 index 7100fec026e3..000000000000 --- a/.changeset/hip-mugs-promise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -improve: System messages for omni-visitor abandonment feature diff --git a/.changeset/honest-glasses-roll.md b/.changeset/honest-glasses-roll.md deleted file mode 100644 index 679f46fb8420..000000000000 --- a/.changeset/honest-glasses-roll.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -chore: Add danger variant to apps action button menus diff --git a/.changeset/honest-mirrors-sit.md b/.changeset/honest-mirrors-sit.md deleted file mode 100644 index 4e4298cb8110..000000000000 --- a/.changeset/honest-mirrors-sit.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Disabled call to tags enterprise endpoint when on community license diff --git a/.changeset/honest-numbers-compete.md b/.changeset/honest-numbers-compete.md deleted file mode 100644 index 1fd017e7fc16..000000000000 --- a/.changeset/honest-numbers-compete.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixes SAML full name updates not being mirrored to DM rooms. diff --git a/.changeset/importer-progress-bar.md b/.changeset/importer-progress-bar.md deleted file mode 100644 index 49c04289ddcb..000000000000 --- a/.changeset/importer-progress-bar.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixed Importer Progress Bar progress indicator - diff --git a/.changeset/kind-students-worry.md b/.changeset/kind-students-worry.md deleted file mode 100644 index 554c1c1204ea..000000000000 --- a/.changeset/kind-students-worry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Make user default role setting public diff --git a/.changeset/lazy-ghosts-design.md b/.changeset/lazy-ghosts-design.md deleted file mode 100644 index 080e9986cebb..000000000000 --- a/.changeset/lazy-ghosts-design.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fixed misleading of 'total' in team members list inside Channel diff --git a/.changeset/loud-sheep-try.md b/.changeset/loud-sheep-try.md deleted file mode 100644 index f82d0d069554..000000000000 --- a/.changeset/loud-sheep-try.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@rocket.chat/fuselage-ui-kit": minor -"@rocket.chat/uikit-playground": minor ---- - -feat: Adding new UIKit components: Callout, Checkbox, Radio Button, Time Picker, Toast Bar, Toggle Switch, Tab Navigation diff --git a/.changeset/lovely-snails-drop.md b/.changeset/lovely-snails-drop.md deleted file mode 100644 index 4e28c6a43c20..000000000000 --- a/.changeset/lovely-snails-drop.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@rocket.chat/meteor": patch -"@rocket.chat/model-typings": patch ---- - -Fix spotlight search does not find rooms with special or non-latin characters diff --git a/.changeset/lucky-balloons-divide.md b/.changeset/lucky-balloons-divide.md deleted file mode 100644 index beb4cbfe3b57..000000000000 --- a/.changeset/lucky-balloons-divide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fix engagement dashboard not showing data diff --git a/.changeset/lucky-hounds-sing.md b/.changeset/lucky-hounds-sing.md deleted file mode 100644 index 20b09afaf545..000000000000 --- a/.changeset/lucky-hounds-sing.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -fixed wrong user status displayed during mentioning a user in a channel diff --git a/.changeset/many-icons-provide.md b/.changeset/many-icons-provide.md deleted file mode 100644 index bf82407980ad..000000000000 --- a/.changeset/many-icons-provide.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Don't allow to report self messages diff --git a/.changeset/mighty-walls-smash.md b/.changeset/mighty-walls-smash.md deleted file mode 100644 index 54b2846901de..000000000000 --- a/.changeset/mighty-walls-smash.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fixed scrollbar over content in Federated Room List diff --git a/.changeset/moody-comics-cheat.md b/.changeset/moody-comics-cheat.md deleted file mode 100644 index b8b372306d0e..000000000000 --- a/.changeset/moody-comics-cheat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/release-action': minor ---- - -Add back "Engine Versions" to the release notes diff --git a/.changeset/moody-pans-act.md b/.changeset/moody-pans-act.md deleted file mode 100644 index 6c307604eaa9..000000000000 --- a/.changeset/moody-pans-act.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fix seat counter including bots users diff --git a/.changeset/nine-bottles-press.md b/.changeset/nine-bottles-press.md deleted file mode 100644 index f9a57fa676ad..000000000000 --- a/.changeset/nine-bottles-press.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -feat: Add flag to disable teams mention via troubleshoot page diff --git a/.changeset/nine-carrots-listen.md b/.changeset/nine-carrots-listen.md deleted file mode 100644 index bf5dc72e6cc0..000000000000 --- a/.changeset/nine-carrots-listen.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fixed layout changing from embedded view when navigating diff --git a/.changeset/odd-elephants-promise.md b/.changeset/odd-elephants-promise.md deleted file mode 100644 index a12817ed175b..000000000000 --- a/.changeset/odd-elephants-promise.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fix LinkedIn OAuth broken diff --git a/.changeset/old-federation-card.md b/.changeset/old-federation-card.md deleted file mode 100644 index fa9879d84426..000000000000 --- a/.changeset/old-federation-card.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Removed old/deprecated Rocket.Chat Federation card from Info page diff --git a/.changeset/perfect-adults-travel.md b/.changeset/perfect-adults-travel.md deleted file mode 100644 index 61ae4ab6dad5..000000000000 --- a/.changeset/perfect-adults-travel.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@rocket.chat/fuselage-ui-kit": patch -"@rocket.chat/uikit-playground": patch ---- - -feat(fuselage-ui-kit): Introduce `TabsNavigationBlock` diff --git a/.changeset/pink-zoos-join.md b/.changeset/pink-zoos-join.md deleted file mode 100644 index dcc1088de0b5..000000000000 --- a/.changeset/pink-zoos-join.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fix the code that was setting email URL to an invalid value when SMTP was not set diff --git a/.changeset/pre.json b/.changeset/pre.json deleted file mode 100644 index aa5cf5401ea3..000000000000 --- a/.changeset/pre.json +++ /dev/null @@ -1,172 +0,0 @@ -{ - "mode": "pre", - "tag": "rc", - "initialVersions": { - "@rocket.chat/meteor": "6.4.0-develop", - "rocketchat-services": "1.1.4", - "@rocket.chat/account-service": "0.2.4", - "@rocket.chat/authorization-service": "0.2.4", - "@rocket.chat/ddp-streamer": "0.1.4", - "@rocket.chat/omnichannel-transcript": "0.2.4", - "@rocket.chat/presence-service": "0.2.4", - "@rocket.chat/queue-worker": "0.2.4", - "@rocket.chat/stream-hub-service": "0.2.4", - "@rocket.chat/api-client": "0.1.4", - "@rocket.chat/ddp-client": "0.1.4", - "@rocket.chat/omnichannel-services": "0.0.10", - "@rocket.chat/pdf-worker": "0.0.10", - "@rocket.chat/presence": "0.0.10", - "@rocket.chat/ui-theming": "0.0.1", - "@rocket.chat/account-utils": "0.0.1", - "@rocket.chat/agenda": "0.0.2", - "@rocket.chat/base64": "1.0.12", - "@rocket.chat/cas-validate": "0.0.1", - "@rocket.chat/core-services": "0.1.4", - "@rocket.chat/core-typings": "6.3.4", - "@rocket.chat/cron": "0.0.6", - "@rocket.chat/eslint-config": "0.5.2", - "@rocket.chat/favicon": "0.0.1", - "@rocket.chat/fuselage-ui-kit": "1.0.4", - "@rocket.chat/gazzodown": "1.0.4", - "@rocket.chat/i18n": "0.0.1", - "@rocket.chat/instance-status": "0.0.10", - "@rocket.chat/livechat": "1.13.4", - "@rocket.chat/log-format": "0.0.1", - "@rocket.chat/logger": "0.0.1", - "@rocket.chat/mock-providers": "0.0.1", - "@rocket.chat/model-typings": "0.0.10", - "@rocket.chat/models": "0.0.10", - "@rocket.chat/poplib": "0.0.1", - "@rocket.chat/random": "1.2.1", - "@rocket.chat/release-action": "2.1.0", - "@rocket.chat/rest-typings": "6.3.4", - "@rocket.chat/server-fetch": "0.0.1", - "@rocket.chat/sha256": "1.0.9", - "@rocket.chat/tools": "0.0.1", - "@rocket.chat/ui-client": "1.0.4", - "@rocket.chat/ui-composer": "0.0.1", - "@rocket.chat/ui-contexts": "1.0.4", - "@rocket.chat/ui-video-conf": "1.0.4", - "@rocket.chat/uikit-playground": "0.1.4", - "@rocket.chat/web-ui-registration": "1.0.4" - }, - "changesets": [ - "blue-ladybugs-raise", - "breezy-bugs-jam", - "bright-carpets-fly", - "bright-snakes-vanish", - "brown-clouds-add", - "bump-patch-1694741499930", - "bump-patch-1694827499043", - "bump-patch-1695163548038", - "bump-patch-1695165575069", - "bump-patch-1695789755733", - "chilled-flies-fold", - "chilled-phones-give", - "cool-students-tan", - "cuddly-donkeys-remember", - "cuddly-houses-tie", - "cuddly-ties-bake", - "curly-shoes-burn", - "custom-emoji-fs", - "dropdown", - "eighty-kids-jog", - "eleven-icons-tan", - "empty-ants-enjoy", - "fair-cats-destroy", - "fast-pumpkins-smoke", - "fast-yaks-collect", - "fifty-cars-divide", - "fluffy-beds-buy", - "fluffy-lions-rage", - "forty-hotels-pretend", - "four-parents-cheer", - "friendly-glasses-mate", - "fuzzy-glasses-divide", - "fuzzy-schools-brake", - "gold-horses-pretend", - "gold-moose-press", - "good-elephants-live", - "green-adults-peel", - "grumpy-candles-rule", - "heavy-baboons-laugh", - "heavy-cougars-marry", - "heavy-zebras-wonder", - "hip-hounds-ring", - "hip-mugs-promise", - "honest-glasses-roll", - "honest-mirrors-sit", - "honest-numbers-compete", - "importer-progress-bar", - "kind-students-worry", - "lazy-ghosts-design", - "loud-sheep-try", - "lovely-snails-drop", - "lucky-balloons-divide", - "lucky-hounds-sing", - "many-icons-provide", - "mighty-walls-smash", - "moody-comics-cheat", - "moody-pans-act", - "nine-bottles-press", - "nine-carrots-listen", - "odd-elephants-promise", - "old-federation-card", - "perfect-adults-travel", - "pink-zoos-join", - "pretty-bees-give", - "quick-emus-march", - "quiet-phones-sell", - "rare-sheep-yawn", - "real-pets-visit", - "red-windows-admire", - "red-zebras-clap", - "rotten-turtles-agree", - "serious-garlics-clean", - "serious-geckos-drive", - "serious-shrimps-try", - "seven-jobs-tickle", - "shaggy-beans-poke", - "shiny-garlics-carry", - "shiny-tools-worry", - "short-cobras-tell", - "silly-actors-laugh", - "silver-mugs-unite", - "six-buckets-eat", - "slimy-cheetahs-heal", - "slimy-wasps-double", - "slow-lizards-breathe", - "small-rice-repair", - "smooth-planes-cough", - "soft-yaks-matter", - "sour-cows-refuse", - "sour-parrots-nail", - "stale-roses-knock", - "strong-laws-pump", - "swift-birds-build", - "swift-walls-protect", - "tall-pumpkins-cross", - "tame-pens-occur", - "thirty-pumpkins-fix", - "three-ants-give", - "three-birds-tickle", - "tidy-bears-camp", - "tiny-turkeys-burn", - "tough-candles-heal", - "tricky-years-swim", - "unlucky-turtles-search", - "user-mention", - "violet-frogs-cheer", - "warm-hornets-ring", - "wet-frogs-kiss", - "wet-walls-lie", - "wild-spiders-smell", - "wise-onions-trade", - "wise-walls-tan", - "wise-ways-fetch", - "witty-feet-warn", - "yellow-buttons-agree", - "yellow-schools-tell", - "young-trains-glow" - ] -} diff --git a/.changeset/pretty-bees-give.md b/.changeset/pretty-bees-give.md deleted file mode 100644 index 8891420308c5..000000000000 --- a/.changeset/pretty-bees-give.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@rocket.chat/meteor": minor -"@rocket.chat/rest-typings": minor ---- - -Add option to select what URL previews should be generated for each message. diff --git a/.changeset/quick-emus-march.md b/.changeset/quick-emus-march.md deleted file mode 100644 index 7a6d7b444654..000000000000 --- a/.changeset/quick-emus-march.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@rocket.chat/ddp-client': minor -'@rocket.chat/core-services': minor -'@rocket.chat/meteor': minor ---- - -Add new event to notify users directly about new banners diff --git a/.changeset/quiet-phones-sell.md b/.changeset/quiet-phones-sell.md deleted file mode 100644 index a6222cba16c9..000000000000 --- a/.changeset/quiet-phones-sell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -fixed an issue where oauth login was not working with some providers diff --git a/.changeset/rare-sheep-yawn.md b/.changeset/rare-sheep-yawn.md deleted file mode 100644 index 86c2d7283223..000000000000 --- a/.changeset/rare-sheep-yawn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/livechat": patch ---- - -fix: Issue caused by spaces in the `config.url` setting diff --git a/.changeset/real-pets-visit.md b/.changeset/real-pets-visit.md deleted file mode 100644 index d6531285597c..000000000000 --- a/.changeset/real-pets-visit.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@rocket.chat/meteor": patch -"@rocket.chat/core-typings": patch ---- - -Fixed `default` field not being returned from the `setDefault` endpoints when setting to false diff --git a/.changeset/red-windows-admire.md b/.changeset/red-windows-admire.md deleted file mode 100644 index 48a82b5902cb..000000000000 --- a/.changeset/red-windows-admire.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fixed an issue where timeout for http requests in Apps-Engine bridges was too short diff --git a/.changeset/red-zebras-clap.md b/.changeset/red-zebras-clap.md deleted file mode 100644 index cd8f832b1835..000000000000 --- a/.changeset/red-zebras-clap.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fix importer filters not working diff --git a/.changeset/rotten-turtles-agree.md b/.changeset/rotten-turtles-agree.md deleted file mode 100644 index f915aa38f758..000000000000 --- a/.changeset/rotten-turtles-agree.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fix: stop blinking "Room not found" before dm creation diff --git a/.changeset/serious-garlics-clean.md b/.changeset/serious-garlics-clean.md deleted file mode 100644 index ccdc3c94dda4..000000000000 --- a/.changeset/serious-garlics-clean.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@rocket.chat/core-services': minor -'@rocket.chat/rest-typings': minor -'@rocket.chat/meteor': minor ---- - -New AddUser workflow for Federated Rooms diff --git a/.changeset/serious-geckos-drive.md b/.changeset/serious-geckos-drive.md deleted file mode 100644 index 454337399772..000000000000 --- a/.changeset/serious-geckos-drive.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@rocket.chat/core-typings': minor -'@rocket.chat/rest-typings': minor -'@rocket.chat/ui-client': minor -'@rocket.chat/meteor': minor ---- - -Added Reports Metrics Dashboard to Omnichannel diff --git a/.changeset/serious-shrimps-try.md b/.changeset/serious-shrimps-try.md deleted file mode 100644 index 114293aa104e..000000000000 --- a/.changeset/serious-shrimps-try.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fixed an issue with the positioning of the message menu diff --git a/.changeset/seven-jobs-tickle.md b/.changeset/seven-jobs-tickle.md deleted file mode 100644 index 870bafbb7d9d..000000000000 --- a/.changeset/seven-jobs-tickle.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@rocket.chat/meteor": patch -"@rocket.chat/model-typings": patch ---- - -fix: agent role being removed upon user deactivation diff --git a/.changeset/shaggy-beans-poke.md b/.changeset/shaggy-beans-poke.md deleted file mode 100644 index 31a480638952..000000000000 --- a/.changeset/shaggy-beans-poke.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fix `mention-here` and `mention-all` permissions not being honored diff --git a/.changeset/shiny-garlics-carry.md b/.changeset/shiny-garlics-carry.md deleted file mode 100644 index 117063d93f6f..000000000000 --- a/.changeset/shiny-garlics-carry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fix CORS headers not being set for assets diff --git a/.changeset/shiny-tools-worry.md b/.changeset/shiny-tools-worry.md deleted file mode 100644 index f024eca38d04..000000000000 --- a/.changeset/shiny-tools-worry.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": minor ---- - -feat: remove enforce password fallback dependency diff --git a/.changeset/short-cobras-tell.md b/.changeset/short-cobras-tell.md deleted file mode 100644 index 1c28ce7bad11..000000000000 --- a/.changeset/short-cobras-tell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": minor ---- - -Reorganized the message menu diff --git a/.changeset/silly-actors-laugh.md b/.changeset/silly-actors-laugh.md deleted file mode 100644 index aab23e14e5f1..000000000000 --- a/.changeset/silly-actors-laugh.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixed Slackbridge was not handling correctly received events from Slack anymore. Events: (Send, edit, delete, react meassages) diff --git a/.changeset/silver-mugs-unite.md b/.changeset/silver-mugs-unite.md deleted file mode 100644 index be74b1bef215..000000000000 --- a/.changeset/silver-mugs-unite.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fix: show requested filters only on requested apps view diff --git a/.changeset/six-buckets-eat.md b/.changeset/six-buckets-eat.md deleted file mode 100644 index f99bcfb71c30..000000000000 --- a/.changeset/six-buckets-eat.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fix users not able to login after block time perdiod has passed diff --git a/.changeset/slimy-cheetahs-heal.md b/.changeset/slimy-cheetahs-heal.md deleted file mode 100644 index 44233bc87766..000000000000 --- a/.changeset/slimy-cheetahs-heal.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fixed selected departments not being displayed due to pagination diff --git a/.changeset/slimy-wasps-double.md b/.changeset/slimy-wasps-double.md deleted file mode 100644 index b28de342b274..000000000000 --- a/.changeset/slimy-wasps-double.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@rocket.chat/meteor': minor -'@rocket.chat/ui-contexts': minor ---- - -UX improvement for the Moderation Console Context bar for viewing the reported messages. The Report reason is now displayed in the reported messages context bar. -The Moderation Action Modal confirmation description is updated to be more clear and concise. diff --git a/.changeset/slow-lizards-breathe.md b/.changeset/slow-lizards-breathe.md deleted file mode 100644 index fd773b17f5c8..000000000000 --- a/.changeset/slow-lizards-breathe.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fixed Apps-Engine event `IPostUserCreated` execution diff --git a/.changeset/small-rice-repair.md b/.changeset/small-rice-repair.md deleted file mode 100644 index 67fdff5ca758..000000000000 --- a/.changeset/small-rice-repair.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fix validation in app status call that allowed Enterprise apps to be enabled in invalid environments diff --git a/.changeset/smooth-planes-cough.md b/.changeset/smooth-planes-cough.md deleted file mode 100644 index 9ad4239f0342..000000000000 --- a/.changeset/smooth-planes-cough.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -'@rocket.chat/ui-theming': minor -'@rocket.chat/rest-typings': minor -'@rocket.chat/meteor': minor ---- - -feat: high-contrast theme diff --git a/.changeset/soft-yaks-matter.md b/.changeset/soft-yaks-matter.md deleted file mode 100644 index c326eb7dca70..000000000000 --- a/.changeset/soft-yaks-matter.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": minor ---- - -feat: return all broken password policies at once diff --git a/.changeset/sour-cows-refuse.md b/.changeset/sour-cows-refuse.md deleted file mode 100644 index d907c063f568..000000000000 --- a/.changeset/sour-cows-refuse.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixed inviter not informed when inviting member to room via `/invite` slashcommand diff --git a/.changeset/sour-parrots-nail.md b/.changeset/sour-parrots-nail.md deleted file mode 100644 index 1c1eaa3173a8..000000000000 --- a/.changeset/sour-parrots-nail.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixed "teams" icon not being displayed on spotlight sidebar search diff --git a/.changeset/stale-roses-knock.md b/.changeset/stale-roses-knock.md deleted file mode 100644 index 25e93fa8c346..000000000000 --- a/.changeset/stale-roses-knock.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fix: User timezone not being respected on Current Chat's filter diff --git a/.changeset/strong-laws-pump.md b/.changeset/strong-laws-pump.md deleted file mode 100644 index a4afefd65316..000000000000 --- a/.changeset/strong-laws-pump.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@rocket.chat/model-typings': patch -'@rocket.chat/meteor': patch ---- - -Change SAU aggregation to consider only sessions from few days ago instead of the whole past. - -This is particularly important for large workspaces in case the cron job did not run for some time, in that case the amount of sessions would accumulate and the aggregation would take a long time to run. diff --git a/.changeset/swift-birds-build.md b/.changeset/swift-birds-build.md deleted file mode 100644 index 4af3bddd875b..000000000000 --- a/.changeset/swift-birds-build.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fixed unable to create admin user using ADMIN\_\* environment variables diff --git a/.changeset/swift-walls-protect.md b/.changeset/swift-walls-protect.md deleted file mode 100644 index 6e3057775c32..000000000000 --- a/.changeset/swift-walls-protect.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fixed failing user data exports diff --git a/.changeset/tall-pumpkins-cross.md b/.changeset/tall-pumpkins-cross.md deleted file mode 100644 index e6cfd8a309b9..000000000000 --- a/.changeset/tall-pumpkins-cross.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/presence": patch ---- - -Fixed presence broadcast being disabled on server restart diff --git a/.changeset/tame-pens-occur.md b/.changeset/tame-pens-occur.md deleted file mode 100644 index 8cb729531fae..000000000000 --- a/.changeset/tame-pens-occur.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@rocket.chat/meteor": minor -"@rocket.chat/model-typings": minor ---- - -Fixed read receipts not getting deleted after corresponding message is deleted \ No newline at end of file diff --git a/.changeset/thirty-pumpkins-fix.md b/.changeset/thirty-pumpkins-fix.md deleted file mode 100644 index 11b92b064e15..000000000000 --- a/.changeset/thirty-pumpkins-fix.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -'@rocket.chat/core-typings': minor -'@rocket.chat/rest-typings': minor -'@rocket.chat/tools': minor -'@rocket.chat/meteor': minor ---- - -Added option to select between two script engine options for the integrations diff --git a/.changeset/three-ants-give.md b/.changeset/three-ants-give.md deleted file mode 100644 index 4d33fad05f39..000000000000 --- a/.changeset/three-ants-give.md +++ /dev/null @@ -1,8 +0,0 @@ ---- -"@rocket.chat/cron": patch -"@rocket.chat/meteor": patch ---- - -Increase cron job check delay to 1 min from 5s. - -This reduces MongoDB requests introduced on 6.3. diff --git a/.changeset/three-birds-tickle.md b/.changeset/three-birds-tickle.md deleted file mode 100644 index 0ce911d9f6fa..000000000000 --- a/.changeset/three-birds-tickle.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -chore: Increase cache time from 5s to 10s on `getUnits` helpers. This should reduce the number of DB calls made by this method to fetch the unit limitations for a user. diff --git a/.changeset/tidy-bears-camp.md b/.changeset/tidy-bears-camp.md deleted file mode 100644 index 3c2013f79023..000000000000 --- a/.changeset/tidy-bears-camp.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": minor ---- - -Introduced upsells for the engagement dashboard and device management admin sidebar items in CE workspaces. Additionally, restructured the admin sidebar items to enhance organization. diff --git a/.changeset/tiny-turkeys-burn.md b/.changeset/tiny-turkeys-burn.md deleted file mode 100644 index a146bd6a0eae..000000000000 --- a/.changeset/tiny-turkeys-burn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -fixed an issue on oauth login that caused missing emails to be detected as changed data diff --git a/.changeset/tough-candles-heal.md b/.changeset/tough-candles-heal.md deleted file mode 100644 index 59ad9c1fb3a1..000000000000 --- a/.changeset/tough-candles-heal.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@rocket.chat/meteor": patch -"@rocket.chat/core-typings": patch -"@rocket.chat/model-typings": patch ---- - -Fixes a problem where the calculated time for considering the visitor abandonment was the first message from the visitor and not the visitor's reply to the agent. diff --git a/.changeset/tricky-years-swim.md b/.changeset/tricky-years-swim.md deleted file mode 100644 index 2ab1254525b2..000000000000 --- a/.changeset/tricky-years-swim.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@rocket.chat/meteor": patch -"@rocket.chat/rest-typings": patch ---- - -Deprecate `livechat:getOverviewData` and `livechat:getAgentOverviewData` methods and create API endpoints `livechat/analytics/overview` and `livechat/analytics/agent-overview` to fetch analytics data diff --git a/.changeset/unlucky-turtles-search.md b/.changeset/unlucky-turtles-search.md deleted file mode 100644 index fffa51020e30..000000000000 --- a/.changeset/unlucky-turtles-search.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': patch ---- - -Fixed Accounts profile form name change was not working diff --git a/.changeset/user-mention.md b/.changeset/user-mention.md deleted file mode 100644 index a896a7c12ee4..000000000000 --- a/.changeset/user-mention.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixed user mentioning when prepending the username with `>` diff --git a/.changeset/violet-frogs-cheer.md b/.changeset/violet-frogs-cheer.md deleted file mode 100644 index db48243c40ed..000000000000 --- a/.changeset/violet-frogs-cheer.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/fuselage-ui-kit': patch ---- - -Handle invalid context on `VideoConferenceBlock` component diff --git a/.changeset/warm-hornets-ring.md b/.changeset/warm-hornets-ring.md deleted file mode 100644 index f81cf1efbe92..000000000000 --- a/.changeset/warm-hornets-ring.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@rocket.chat/meteor": patch -"@rocket.chat/core-typings": patch ---- - -Use group filter when set to LDAP sync process diff --git a/.changeset/wet-frogs-kiss.md b/.changeset/wet-frogs-kiss.md deleted file mode 100644 index 24395a78f85d..000000000000 --- a/.changeset/wet-frogs-kiss.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fix: Missing padding on Omnichannel contacts Contextualbar loading state diff --git a/.changeset/wet-walls-lie.md b/.changeset/wet-walls-lie.md deleted file mode 100644 index 6b18eb497686..000000000000 --- a/.changeset/wet-walls-lie.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixes a problem that allowed users to send empty spaces as comment to bypass the "comment required" setting diff --git a/.changeset/wild-spiders-smell.md b/.changeset/wild-spiders-smell.md deleted file mode 100644 index 9694d6259d3a..000000000000 --- a/.changeset/wild-spiders-smell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -Fixed an issue where a mailer error was being sent to customers using offline message's form on Omnichannel instead of the translated one diff --git a/.changeset/wise-onions-trade.md b/.changeset/wise-onions-trade.md deleted file mode 100644 index cb5c731fb6fb..000000000000 --- a/.changeset/wise-onions-trade.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"@rocket.chat/meteor": patch -"@rocket.chat/i18n": patch -"@rocket.chat/livechat": patch -"@rocket.chat/mock-providers": patch -"@rocket.chat/ui-client": patch -"@rocket.chat/ui-contexts": patch -"@rocket.chat/web-ui-registration": patch ---- - -Fixed the login page language switcher, now the component has a new look, is reactive and the language selection becomes concrete upon login in. Also changed the default language of the login page to be the browser language. diff --git a/.changeset/wise-walls-tan.md b/.changeset/wise-walls-tan.md deleted file mode 100644 index f558de82ec4c..000000000000 --- a/.changeset/wise-walls-tan.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@rocket.chat/rest-typings': minor -'@rocket.chat/meteor': minor ---- - -fix: missing params on updateOwnBasicInfo endpoint diff --git a/.changeset/wise-ways-fetch.md b/.changeset/wise-ways-fetch.md deleted file mode 100644 index a81063813c35..000000000000 --- a/.changeset/wise-ways-fetch.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fixed the unread messages mark not showing diff --git a/.changeset/witty-feet-warn.md b/.changeset/witty-feet-warn.md deleted file mode 100644 index faaa5d44c134..000000000000 --- a/.changeset/witty-feet-warn.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@rocket.chat/meteor": patch ---- - -fixed the video recorder window not closing after permission is denied. diff --git a/.changeset/yellow-buttons-agree.md b/.changeset/yellow-buttons-agree.md deleted file mode 100644 index a86d172a4544..000000000000 --- a/.changeset/yellow-buttons-agree.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'@rocket.chat/ui-client': minor -'@rocket.chat/meteor': minor ---- - -feat: add ChangePassword field to Account/Security diff --git a/.changeset/yellow-schools-tell.md b/.changeset/yellow-schools-tell.md deleted file mode 100644 index c1040fa0856a..000000000000 --- a/.changeset/yellow-schools-tell.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/eslint-config': minor ---- - -Unpublished changes in ESLint config diff --git a/.changeset/young-trains-glow.md b/.changeset/young-trains-glow.md deleted file mode 100644 index 77f50812143f..000000000000 --- a/.changeset/young-trains-glow.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@rocket.chat/meteor': minor ---- - -Fixed the issue of apps icon uneven alignment in case of missing icons inside message composer toolbar & message toolbar menu. diff --git a/apps/meteor/.docker/Dockerfile.rhel b/apps/meteor/.docker/Dockerfile.rhel index 96a1740fa587..47397d7cb206 100644 --- a/apps/meteor/.docker/Dockerfile.rhel +++ b/apps/meteor/.docker/Dockerfile.rhel @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi8/nodejs-12 -ENV RC_VERSION 6.4.0-rc.5 +ENV RC_VERSION 6.4.0 MAINTAINER buildmaster@rocket.chat diff --git a/apps/meteor/CHANGELOG.md b/apps/meteor/CHANGELOG.md index da842431ab0b..9c2e0b63e240 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,185 @@ # @rocket.chat/meteor +## 6.4.0 + +### Minor Changes + +- 239a34e877: new: ring mobile users on direct conference calls +- 04fe492555: Added new Omnichannel's trigger condition "After starting a chat". +- 4186eecf05: Introduce the ability to report an user +- 92b690d206: fix: Wrong toast message while creating a new custom sound with an existing name +- f83ea5d6e8: Added support for threaded conversation in Federated rooms. +- 682d0bc05a: fix: Time format of Retention Policy +- 1b42dfc6c1: Added a new Roles bridge to RC Apps-Engine for reading and retrieving role details. +- 2db32f0d4a: Add option to select what URL previews should be generated for each message. +- 982ef6f459: Add new event to notify users directly about new banners +- 19aec23cda: New AddUser workflow for Federated Rooms +- ebab8c4dd8: Added Reports Metrics Dashboard to Omnichannel +- 85a936220c: feat: remove enforce password fallback dependency +- 5832be2e1b: Reorganized the message menu +- 074db3b419: UX improvement for the Moderation Console Context bar for viewing the reported messages. The Report reason is now displayed in the reported messages context bar. + The Moderation Action Modal confirmation description is updated to be more clear and concise. +- 357a3a50fa: feat: high-contrast theme +- 7070f00b05: feat: return all broken password policies at once +- ead7c7bef2: Fixed read receipts not getting deleted after corresponding message is deleted +- 1041d4d361: Added option to select between two script engine options for the integrations +- ad08c26b46: Introduced upsells for the engagement dashboard and device management admin sidebar items in CE workspaces. Additionally, restructured the admin sidebar items to enhance organization. +- 93d4912e17: fix: missing params on updateOwnBasicInfo endpoint +- ee3815fce4: feat: add ChangePassword field to Account/Security +- 1000b9b317: Fixed the issue of apps icon uneven alignment in case of missing icons inside message composer toolbar & message toolbar menu. + +### Patch Changes + +- 6d453f71ac: Translation files are requested multiple times +- cada29b6ce: fix: Managers allowed to make deactivated agent's available +- 470c29d7e9: Fixed an issue causing `queue time` to be calculated from current time when a room was closed without being served. + Now: + - For served rooms: queue time = servedBy time - queuedAt + - For not served, but open rooms = now - queuedAt + - For not served and closed rooms = closedAt - queuedAt +- ea8998602b: fix: Performance issue on `Messages.countByType` aggregation caused by unindexed property on messages collection +- f634601d90: Bump @rocket.chat/meteor version. +- f46c1f7b70: Bump @rocket.chat/meteor version. +- 6963cc2d00: Bump @rocket.chat/meteor version. +- 7cc15ac814: Bump @rocket.chat/meteor version. +- 40c5277197: Bump @rocket.chat/meteor version. +- Bump @rocket.chat/meteor version. +- a08006c9f0: feat: add sections to room header and user infos menus with menuV2 +- 203304782f: Fixed `overrideDestinationChannelEnabled` treated as a required param in `integrations.create` and `integration.update` endpoints +- 9edca67b9b: feat(apps): `ActionManagerBusyState` component for apps `ui.interaction` +- ec60dbe8f5: Fixed custom translations not being displayed +- 6fa30ddcd1: Hide Reset TOTP option if 2FA is disabled +- ff7e181464: Added ability to freeze or completely disable integration scripts through envvars +- 4ce8ea89a8: fix: custom emoji upload with FileSystem method +- 87570d0fb7: New filters to the Rooms Table at `Workspace > Rooms` +- 8a59855fcf: When setting a room as read-only, do not allow previously unmuted users to send messages. +- c73f5373b8: fix: finnish translation +- f5a886a144: fixed an issue where 2fa was not working after an OAuth redirect +- 459c8574ed: Fixed issue with custom OAuth services' settings not being be fully removed +- 42644a6e44: fix: Prevent `RoomProvider.useEffect` from subscribing to room-data stream multiple times +- 9bdbc9b086: load sounds right before playing them +- 6154979119: Fix users being created without the `roles` field +- 6bcdd88531: Fixed CAS login after popup closes +- 839789c988: Fix moment timestamps language change +- f0025d4d92: Fixed message fetching method in LivechatBridge for Apps +- 9c957b9d9a: Fix pruning messages in a room results in an incorrect message counter +- 583a3149fe: fix: rejected conference calls continue to ring +- b59fd5d7fb: User information crashing for some locales +- 4349443629: Fix performance issue on Engagement Dashboard aggregation +- 614a9b8fc8: Show correct date for last day time +- 69447e1864: Added ability to disable private app installation via envvar (DISABLE_PRIVATE_APP_INSTALLATION) +- 52a1aa94eb: improve: System messages for omni-visitor abandonment feature +- 7dffec2e2f: chore: Add danger variant to apps action button menus +- f0c8867bb9: Disabled call to tags enterprise endpoint when on community license +- 5e89694bfa: Fixes SAML full name updates not being mirrored to DM rooms. +- d6f0c6afe2: Fixed Importer Progress Bar progress indicator +- 177506ea91: Make user default role setting public +- 3fb2124166: Fixed misleading of 'total' in team members list inside Channel +- 5cee21468e: Fix spotlight search does not find rooms with special or non-latin characters +- cf59c8abe3: Fix engagement dashboard not showing data +- dfb9a075b3: fixed wrong user status displayed during mentioning a user in a channel +- 1fbbb6241a: Don't allow to report self messages +- 53e0c346e2: fixed scrollbar over content in Federated Room List +- 5321e87363: Fix seat counter including bots users +- 7137a193a7: feat: Add flag to disable teams mention via troubleshoot page +- 59e6fe3d2a: fixed layout changing from embedded view when navigating +- 3245a0a318: Fix LinkedIn OAuth broken +- 45a8943ed4: Removed old/deprecated Rocket.Chat Federation card from Info page +- 6eea189ec8: Fix the code that was setting email URL to an invalid value when SMTP was not set +- f5a886a144: fixed an issue where oauth login was not working with some providers +- ba24f3c21f: Fixed `default` field not being returned from the `setDefault` endpoints when setting to false +- a79f61461d: Fixed an issue where timeout for http requests in Apps-Engine bridges was too short +- 51b988b3df: Fix importer filters not working +- 5d857f462c: fix: stop blinking "Room not found" before dm creation +- db26f8a8ee: fixed an issue with the positioning of the message menu +- aaefe865a7: fix: agent role being removed upon user deactivation +- 306a5830c3: Fix `mention-here` and `mention-all` permissions not being honored +- 761cad4382: Fix CORS headers not being set for assets +- 9e5718002a: Fixed Slackbridge was not handling correctly received events from Slack anymore. Events: (Send, edit, delete, react meassages) +- 54ef89c9a7: fix: show requested filters only on requested apps view +- 1589279b79: Fix users not able to login after block time perdiod has passed +- 880ab5689c: Fixed selected departments not being displayed due to pagination +- a81bad24e0: Fixed Apps-Engine event `IPostUserCreated` execution +- 7a4fdf41f8: Fix validation in app status call that allowed Enterprise apps to be enabled in invalid environments +- e28f8d95f0: Fixed inviter not informed when inviting member to room via `/invite` slashcommand +- d47d2021ac: Fixed "teams" icon not being displayed on spotlight sidebar search +- 93d5a5ceb8: fix: User timezone not being respected on Current Chat's filter +- f556518fa1: Change SAU aggregation to consider only sessions from few days ago instead of the whole past. + + This is particularly important for large workspaces in case the cron job did not run for some time, in that case the amount of sessions would accumulate and the aggregation would take a long time to run. + +- b747f3d3bc: Fixed unable to create admin user using ADMIN\_\* environment variables +- 2cf2643399: Fixed failing user data exports +- 61a106fbf2: Increase cron job check delay to 1 min from 5s. + + This reduces MongoDB requests introduced on 6.3. + +- ace35997a6: chore: Increase cache time from 5s to 10s on `getUnits` helpers. This should reduce the number of DB calls made by this method to fetch the unit limitations for a user. +- f5a886a144: fixed an issue on oauth login that caused missing emails to be detected as changed data +- 61128364d6: Fixes a problem where the calculated time for considering the visitor abandonment was the first message from the visitor and not the visitor's reply to the agent. +- 9496f1eb97: Deprecate `livechat:getOverviewData` and `livechat:getAgentOverviewData` methods and create API endpoints `livechat/analytics/overview` and `livechat/analytics/agent-overview` to fetch analytics data +- 01dec055a0: Fixed Accounts profile form name change was not working +- e4837a15ed: Fixed user mentioning when prepending the username with `>` +- d45365436e: Use group filter when set to LDAP sync process +- c536a4a237: fix: Missing padding on Omnichannel contacts Contextualbar loading state +- 87e4a4aa56: Fixes a problem that allowed users to send empty spaces as comment to bypass the "comment required" setting +- 69a5213afc: Fixed an issue where a mailer error was being sent to customers using offline message's form on Omnichannel instead of the translated one +- b8f3d5014f: Fixed the login page language switcher, now the component has a new look, is reactive and the language selection becomes concrete upon login in. Also changed the default language of the login page to be the browser language. +- 22cf158c43: fixed the unread messages mark not showing +- 72a34a02f7: fixed the video recorder window not closing after permission is denied. +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [1246a21648] +- Updated dependencies [4186eecf05] +- Updated dependencies [8a59855fcf] +- Updated dependencies [f9a748526d] +- Updated dependencies [5cee21468e] +- Updated dependencies [dc1d8ce92e] +- Updated dependencies [2db32f0d4a] +- Updated dependencies [982ef6f459] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [aaefe865a7] +- Updated dependencies [074db3b419] +- Updated dependencies [357a3a50fa] +- Updated dependencies [f556518fa1] +- Updated dependencies [d9a150000d] +- Updated dependencies [ead7c7bef2] +- Updated dependencies [1041d4d361] +- Updated dependencies [61a106fbf2] +- Updated dependencies [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [dce4a829fa] +- Updated dependencies [d45365436e] +- Updated dependencies [b8f3d5014f] +- Updated dependencies [93d4912e17] +- Updated dependencies [ee3815fce4] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/rest-typings@6.4.0 + - @rocket.chat/fuselage-ui-kit@2.0.0 + - @rocket.chat/model-typings@0.1.0 + - @rocket.chat/core-services@0.2.0 + - @rocket.chat/ui-client@2.0.0 + - @rocket.chat/ui-contexts@2.0.0 + - @rocket.chat/ui-theming@0.1.0 + - @rocket.chat/presence@0.0.15 + - @rocket.chat/tools@0.1.0 + - @rocket.chat/cron@0.0.11 + - @rocket.chat/i18n@0.0.2 + - @rocket.chat/web-ui-registration@2.0.0 + - @rocket.chat/api-client@0.1.9 + - @rocket.chat/omnichannel-services@0.0.15 + - @rocket.chat/pdf-worker@0.0.15 + - @rocket.chat/gazzodown@2.0.0 + - @rocket.chat/models@0.0.15 + - @rocket.chat/ui-video-conf@2.0.0 + - @rocket.chat/base64@1.0.12 + - @rocket.chat/instance-status@0.0.15 + - @rocket.chat/random@1.2.1 + - @rocket.chat/sha256@1.0.9 + - @rocket.chat/ui-composer@0.0.1 + ## 6.4.0-rc.5 ### Minor Changes diff --git a/apps/meteor/app/utils/rocketchat.info b/apps/meteor/app/utils/rocketchat.info index e97b3accfbf5..05430b212869 100644 --- a/apps/meteor/app/utils/rocketchat.info +++ b/apps/meteor/app/utils/rocketchat.info @@ -1,3 +1,3 @@ { - "version": "6.4.0-rc.5" + "version": "6.4.0" } diff --git a/apps/meteor/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index d39b61dabe55..77b48a0d1f92 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,34 @@ # rocketchat-services +## 1.1.9 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [8a59855fcf] +- Updated dependencies [5cee21468e] +- Updated dependencies [2db32f0d4a] +- Updated dependencies [982ef6f459] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [aaefe865a7] +- Updated dependencies [357a3a50fa] +- Updated dependencies [f556518fa1] +- Updated dependencies [ead7c7bef2] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [93d4912e17] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/rest-typings@6.4.0 + - @rocket.chat/model-typings@0.1.0 + - @rocket.chat/core-services@0.2.0 + - @rocket.chat/models@0.0.15 + ## 1.1.9-rc.5 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 8fd8bb9550b8..cbe15a16f731 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -1,7 +1,7 @@ { "name": "rocketchat-services", "private": true, - "version": "1.1.9-rc.5", + "version": "1.1.9", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { diff --git a/apps/meteor/package.json b/apps/meteor/package.json index d9b777a06d4e..3d5554019852 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/meteor", "description": "The Ultimate Open Source WebChat Platform", - "version": "6.4.0-rc.5", + "version": "6.4.0", "private": true, "author": { "name": "Rocket.Chat", diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index 171c077b0725..81958cf94cc6 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,34 @@ # @rocket.chat/account-service +## 0.2.9 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [8a59855fcf] +- Updated dependencies [5cee21468e] +- Updated dependencies [2db32f0d4a] +- Updated dependencies [982ef6f459] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [aaefe865a7] +- Updated dependencies [357a3a50fa] +- Updated dependencies [f556518fa1] +- Updated dependencies [ead7c7bef2] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [93d4912e17] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/rest-typings@6.4.0 + - @rocket.chat/model-typings@0.1.0 + - @rocket.chat/core-services@0.2.0 + - @rocket.chat/models@0.0.15 + ## 0.2.9-rc.5 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index 4e8442d6253d..9038b8cf2ef0 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/account-service", "private": true, - "version": "0.2.9-rc.5", + "version": "0.2.9", "description": "Rocket.Chat Account service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/authorization-service/CHANGELOG.md b/ee/apps/authorization-service/CHANGELOG.md index d43a26282daf..e1f254d06053 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,34 @@ # @rocket.chat/authorization-service +## 0.2.9 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [8a59855fcf] +- Updated dependencies [5cee21468e] +- Updated dependencies [2db32f0d4a] +- Updated dependencies [982ef6f459] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [aaefe865a7] +- Updated dependencies [357a3a50fa] +- Updated dependencies [f556518fa1] +- Updated dependencies [ead7c7bef2] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [93d4912e17] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/rest-typings@6.4.0 + - @rocket.chat/model-typings@0.1.0 + - @rocket.chat/core-services@0.2.0 + - @rocket.chat/models@0.0.15 + ## 0.2.9-rc.5 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index 64a88f67f728..8aff178aeecd 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/authorization-service", "private": true, - "version": "0.2.9-rc.5", + "version": "0.2.9", "description": "Rocket.Chat Authorization service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/ddp-streamer/CHANGELOG.md b/ee/apps/ddp-streamer/CHANGELOG.md index 2ab86d83bfd2..1bafaf49ea7e 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,38 @@ # @rocket.chat/ddp-streamer +## 0.1.9 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [8a59855fcf] +- Updated dependencies [5cee21468e] +- Updated dependencies [2db32f0d4a] +- Updated dependencies [982ef6f459] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [aaefe865a7] +- Updated dependencies [074db3b419] +- Updated dependencies [357a3a50fa] +- Updated dependencies [f556518fa1] +- Updated dependencies [ead7c7bef2] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [b8f3d5014f] +- Updated dependencies [93d4912e17] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/rest-typings@6.4.0 + - @rocket.chat/model-typings@0.1.0 + - @rocket.chat/core-services@0.2.0 + - @rocket.chat/ui-contexts@2.0.0 + - @rocket.chat/models@0.0.15 + - @rocket.chat/instance-status@0.0.15 + ## 0.1.9-rc.5 ### Patch Changes diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index be3f02473070..aed89a2d1c45 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/ddp-streamer", "private": true, - "version": "0.1.9-rc.5", + "version": "0.1.9", "description": "Rocket.Chat DDP-Streamer service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/omnichannel-transcript/CHANGELOG.md b/ee/apps/omnichannel-transcript/CHANGELOG.md index 0af76d7b0699..cb28d7d7a3ee 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,32 @@ # @rocket.chat/omnichannel-transcript +## 0.2.9 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [8a59855fcf] +- Updated dependencies [5cee21468e] +- Updated dependencies [982ef6f459] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [aaefe865a7] +- Updated dependencies [f556518fa1] +- Updated dependencies [ead7c7bef2] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/model-typings@0.1.0 + - @rocket.chat/core-services@0.2.0 + - @rocket.chat/tools@0.1.0 + - @rocket.chat/omnichannel-services@0.0.15 + - @rocket.chat/pdf-worker@0.0.15 + - @rocket.chat/models@0.0.15 + ## 0.2.9-rc.5 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index d244bbad1564..038055b4fb73 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/omnichannel-transcript", "private": true, - "version": "0.2.9-rc.5", + "version": "0.2.9", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/presence-service/CHANGELOG.md b/ee/apps/presence-service/CHANGELOG.md index d736864b7d1a..f000298cbd18 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,31 @@ # @rocket.chat/presence-service +## 0.2.9 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [8a59855fcf] +- Updated dependencies [5cee21468e] +- Updated dependencies [982ef6f459] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [aaefe865a7] +- Updated dependencies [f556518fa1] +- Updated dependencies [d9a150000d] +- Updated dependencies [ead7c7bef2] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/model-typings@0.1.0 + - @rocket.chat/core-services@0.2.0 + - @rocket.chat/presence@0.0.15 + - @rocket.chat/models@0.0.15 + ## 0.2.9-rc.5 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index 5cb2e6d80c08..87c76b4ff5c8 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/presence-service", "private": true, - "version": "0.2.9-rc.5", + "version": "0.2.9", "description": "Rocket.Chat Presence service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/queue-worker/CHANGELOG.md b/ee/apps/queue-worker/CHANGELOG.md index d6d3edd8cc7b..a0abfb00c5c8 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,30 @@ # @rocket.chat/queue-worker +## 0.2.9 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [8a59855fcf] +- Updated dependencies [5cee21468e] +- Updated dependencies [982ef6f459] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [aaefe865a7] +- Updated dependencies [f556518fa1] +- Updated dependencies [ead7c7bef2] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/model-typings@0.1.0 + - @rocket.chat/core-services@0.2.0 + - @rocket.chat/omnichannel-services@0.0.15 + - @rocket.chat/models@0.0.15 + ## 0.2.9-rc.5 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index dbfe462ce9ba..156af4fdc0e6 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/queue-worker", "private": true, - "version": "0.2.9-rc.5", + "version": "0.2.9", "description": "Rocket.Chat service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/apps/stream-hub-service/CHANGELOG.md b/ee/apps/stream-hub-service/CHANGELOG.md index 5d9608031426..d76068538d9c 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,29 @@ # @rocket.chat/stream-hub-service +## 0.2.9 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [8a59855fcf] +- Updated dependencies [5cee21468e] +- Updated dependencies [982ef6f459] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [aaefe865a7] +- Updated dependencies [f556518fa1] +- Updated dependencies [ead7c7bef2] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/model-typings@0.1.0 + - @rocket.chat/core-services@0.2.0 + - @rocket.chat/models@0.0.15 + ## 0.2.9-rc.5 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index 196dc22de85d..cc29f058e9c9 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/stream-hub-service", "private": true, - "version": "0.2.9-rc.5", + "version": "0.2.9", "description": "Rocket.Chat Stream Hub service", "scripts": { "build": "tsc -p tsconfig.json", diff --git a/ee/packages/api-client/CHANGELOG.md b/ee/packages/api-client/CHANGELOG.md index 545977e119b2..cc600456d258 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,25 @@ # @rocket.chat/api-client +## 0.1.9 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [2db32f0d4a] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [357a3a50fa] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [93d4912e17] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/rest-typings@6.4.0 + ## 0.1.9-rc.5 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index 52291ace5933..4827eddb734a 100644 --- a/ee/packages/api-client/package.json +++ b/ee/packages/api-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/api-client", - "version": "0.1.9-rc.5", + "version": "0.1.9", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/ddp-client/CHANGELOG.md b/ee/packages/ddp-client/CHANGELOG.md index 1a121f4eea53..f623b9a729e6 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,26 @@ # @rocket.chat/ddp-client +## 0.2.0 + +### Minor Changes + +- 982ef6f459: Add new event to notify users directly about new banners + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [2db32f0d4a] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [357a3a50fa] +- Updated dependencies [1041d4d361] +- Updated dependencies [9496f1eb97] +- Updated dependencies [93d4912e17] + - @rocket.chat/rest-typings@6.4.0 + - @rocket.chat/api-client@0.1.9 + ## 0.2.0-rc.5 ### Patch Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index dba3242f275f..5f62047c2429 100644 --- a/ee/packages/ddp-client/package.json +++ b/ee/packages/ddp-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ddp-client", - "version": "0.2.0-rc.5", + "version": "0.2.0", "devDependencies": { "@swc/core": "^1.3.66", "@swc/jest": "^0.2.26", diff --git a/ee/packages/omnichannel-services/CHANGELOG.md b/ee/packages/omnichannel-services/CHANGELOG.md index c8d411fa1f19..6e4556b12ef0 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,36 @@ # @rocket.chat/omnichannel-services +## 0.0.15 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [8a59855fcf] +- Updated dependencies [5cee21468e] +- Updated dependencies [2db32f0d4a] +- Updated dependencies [982ef6f459] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [aaefe865a7] +- Updated dependencies [357a3a50fa] +- Updated dependencies [f556518fa1] +- Updated dependencies [ead7c7bef2] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [93d4912e17] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/rest-typings@6.4.0 + - @rocket.chat/model-typings@0.1.0 + - @rocket.chat/core-services@0.2.0 + - @rocket.chat/tools@0.1.0 + - @rocket.chat/pdf-worker@0.0.15 + - @rocket.chat/models@0.0.15 + ## 0.0.15-rc.5 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 3159649db4e6..e5875c054eef 100644 --- a/ee/packages/omnichannel-services/package.json +++ b/ee/packages/omnichannel-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/omnichannel-services", - "version": "0.0.15-rc.5", + "version": "0.0.15", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/packages/pdf-worker/CHANGELOG.md b/ee/packages/pdf-worker/CHANGELOG.md index 31663913bc22..1da194044df7 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,19 @@ # @rocket.chat/pdf-worker +## 0.0.15 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0 + ## 0.0.15-rc.5 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index 742bddc7e5bf..9081c64fba34 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/pdf-worker", - "version": "0.0.15-rc.5", + "version": "0.0.15", "private": true, "devDependencies": { "@storybook/addon-essentials": "~6.5.16", diff --git a/ee/packages/presence/CHANGELOG.md b/ee/packages/presence/CHANGELOG.md index dc58f5248666..4ee4d1a7df52 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,24 @@ # @rocket.chat/presence +## 0.0.15 + +### Patch Changes + +- d9a150000d: Fixed presence broadcast being disabled on server restart +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [982ef6f459] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/core-services@0.2.0 + - @rocket.chat/models@0.0.15 + ## 0.0.15-rc.5 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 050c8dcf5d95..e6b34b4a1310 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.0.15-rc.5", + "version": "0.0.15", "private": true, "devDependencies": { "@babel/core": "~7.22.9", diff --git a/ee/packages/ui-theming/CHANGELOG.md b/ee/packages/ui-theming/CHANGELOG.md index 746a406ad105..134f170ce82a 100644 --- a/ee/packages/ui-theming/CHANGELOG.md +++ b/ee/packages/ui-theming/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/ui-theming +## 0.1.0 + +### Minor Changes + +- 357a3a50fa: feat: high-contrast theme + ## 0.1.0-rc.0 ### Minor Changes diff --git a/ee/packages/ui-theming/package.json b/ee/packages/ui-theming/package.json index 4e6c5c42aec7..825bddc560c5 100644 --- a/ee/packages/ui-theming/package.json +++ b/ee/packages/ui-theming/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-theming", - "version": "0.1.0-rc.0", + "version": "0.1.0", "private": true, "devDependencies": { "@rocket.chat/css-in-js": "next", diff --git a/package.json b/package.json index 6222c682c78d..649cab2162ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rocket.chat", - "version": "6.4.0-rc.5", + "version": "6.4.0", "description": "Rocket.Chat Monorepo", "main": "index.js", "private": true, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index 1be0b4cc682d..940c05513ec1 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,31 @@ # @rocket.chat/core-services +## 0.2.0 + +### Minor Changes + +- 982ef6f459: Add new event to notify users directly about new banners +- 19aec23cda: New AddUser workflow for Federated Rooms + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [2db32f0d4a] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [357a3a50fa] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [93d4912e17] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/rest-typings@6.4.0 + - @rocket.chat/models@0.0.15 + ## 0.2.0-rc.5 ### Patch Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 4f449f90e889..3d4688051743 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-services", - "version": "0.2.0-rc.5", + "version": "0.2.0", "private": true, "devDependencies": { "@babel/core": "~7.22.9", diff --git a/packages/core-typings/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index 574468eea9e9..f6c174da450f 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,21 @@ # @rocket.chat/core-typings +## 6.4.0 + +### Minor Changes + +- 239a34e877: new: ring mobile users on direct conference calls +- 4186eecf05: Introduce the ability to report an user +- ebab8c4dd8: Added Reports Metrics Dashboard to Omnichannel +- 1041d4d361: Added option to select between two script engine options for the integrations + +### Patch Changes + +- 203304782f: Fixed `overrideDestinationChannelEnabled` treated as a required param in `integrations.create` and `integration.update` endpoints +- ba24f3c21f: Fixed `default` field not being returned from the `setDefault` endpoints when setting to false +- 61128364d6: Fixes a problem where the calculated time for considering the visitor abandonment was the first message from the visitor and not the visitor's reply to the agent. +- d45365436e: Use group filter when set to LDAP sync process + ## 6.4.0-rc.5 ### Minor Changes diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index ef1b9e9b5a39..66ab70ee7d3c 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/core-typings", - "version": "6.4.0-rc.5", + "version": "6.4.0", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", diff --git a/packages/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index 8a8e71514de7..b0cf975ee4d8 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,25 @@ # @rocket.chat/cron +## 0.0.11 + +### Patch Changes + +- 61a106fbf2: Increase cron job check delay to 1 min from 5s. + + This reduces MongoDB requests introduced on 6.3. + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/models@0.0.15 + - @rocket.chat/random@1.2.1 + ## 0.0.11-rc.5 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index ec0de88823bb..37e751fe03d5 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.11-rc.5", + "version": "0.0.11", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/eslint-config/CHANGELOG.md b/packages/eslint-config/CHANGELOG.md index 59cacad3f786..62704f6c7714 100644 --- a/packages/eslint-config/CHANGELOG.md +++ b/packages/eslint-config/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/eslint-config +## 0.6.0 + +### Minor Changes + +- 0f56aacc4d: Unpublished changes in ESLint config + ## 0.6.0-rc.0 ### Minor Changes diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 1ef1e593f7d5..9b0adef2d80e 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/eslint-config", - "version": "0.6.0-rc.0", + "version": "0.6.0", "description": "Rocket.Chat's JS/TS ESLint config", "dependencies": { "@babel/core": "^7.20.7", diff --git a/packages/fuselage-ui-kit/CHANGELOG.md b/packages/fuselage-ui-kit/CHANGELOG.md index 354093b38e4b..dd8a0fce9789 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,24 @@ # Change Log +## 2.0.0 + +### Minor Changes + +- 1246a21648: feat: Add missing variants to UIKit button +- f9a748526d: feat: Adding new UIKit components: Callout, Checkbox, Radio Button, Time Picker, Toast Bar, Toggle Switch, Tab Navigation + +### Patch Changes + +- dc1d8ce92e: feat(fuselage-ui-kit): Introduce `TabsNavigationBlock` +- dce4a829fa: Handle invalid context on `VideoConferenceBlock` component +- Updated dependencies [074db3b419] +- Updated dependencies [b8f3d5014f] +- Updated dependencies [0f56aacc4d] + - @rocket.chat/ui-contexts@2.0.0 + - @rocket.chat/eslint-config@0.6.0 + - @rocket.chat/gazzodown@2.0.0 + - @rocket.chat/ui-video-conf@2.0.0 + ## 2.0.0-rc.5 ### Patch Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 99b23b87018c..c452ec3513a5 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/fuselage-ui-kit", "private": true, - "version": "2.0.0-rc.5", + "version": "2.0.0", "description": "UiKit elements for Rocket.Chat Apps built under Fuselage design system", "homepage": "https://rocketchat.github.io/Rocket.Chat.Fuselage/", "author": { @@ -39,16 +39,16 @@ }, "peerDependencies": { "@rocket.chat/apps-engine": "*", - "@rocket.chat/eslint-config": "0.6.0-rc.0", + "@rocket.chat/eslint-config": "0.6.0", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/fuselage-polyfills": "*", "@rocket.chat/icons": "*", "@rocket.chat/prettier-config": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.5", + "@rocket.chat/ui-contexts": "2.0.0", "@rocket.chat/ui-kit": "*", - "@rocket.chat/ui-video-conf": "2.0.0-rc.5", + "@rocket.chat/ui-video-conf": "2.0.0", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" diff --git a/packages/gazzodown/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index 8885c9f90b59..336e44b65402 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,24 @@ # @rocket.chat/gazzodown +## 2.0.0 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [074db3b419] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [d45365436e] +- Updated dependencies [b8f3d5014f] +- Updated dependencies [ee3815fce4] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/ui-client@2.0.0 + - @rocket.chat/ui-contexts@2.0.0 + ## 2.0.0-rc.5 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index f35efad6f64d..eaaa208301a5 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/gazzodown", - "version": "2.0.0-rc.5", + "version": "2.0.0", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.4.0-rc.5", + "@rocket.chat/core-typings": "6.4.0", "@rocket.chat/css-in-js": "*", "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-tokens": "*", "@rocket.chat/message-parser": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-client": "2.0.0-rc.5", - "@rocket.chat/ui-contexts": "2.0.0-rc.5", + "@rocket.chat/ui-client": "2.0.0", + "@rocket.chat/ui-contexts": "2.0.0", "katex": "*", "react": "*" }, diff --git a/packages/i18n/CHANGELOG.md b/packages/i18n/CHANGELOG.md index 88d629fae65c..7eecb2d845e9 100644 --- a/packages/i18n/CHANGELOG.md +++ b/packages/i18n/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/i18n +## 0.0.2 + +### Patch Changes + +- b8f3d5014f: Fixed the login page language switcher, now the component has a new look, is reactive and the language selection becomes concrete upon login in. Also changed the default language of the login page to be the browser language. + ## 0.0.2-rc.0 ### Patch Changes diff --git a/packages/i18n/package.json b/packages/i18n/package.json index da2dae7600ac..08c924493580 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/i18n", - "version": "0.0.2-rc.0", + "version": "0.0.2", "private": true, "devDependencies": { "@babel/core": "~7.22.10", diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index ae70025393d1..3c454da0e972 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/instance-status +## 0.0.15 + +### Patch Changes + +- @rocket.chat/models@0.0.15 + ## 0.0.15-rc.5 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 7dc7720aef9a..4b6d8a882650 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/instance-status", - "version": "0.0.15-rc.5", + "version": "0.0.15", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/livechat/CHANGELOG.md b/packages/livechat/CHANGELOG.md index ef8b45c7d311..7d537677ad04 100644 --- a/packages/livechat/CHANGELOG.md +++ b/packages/livechat/CHANGELOG.md @@ -1,5 +1,19 @@ # @rocket.chat/livechat Change Log +## 1.14.0 + +### Minor Changes + +- 04fe492555: Added new Omnichannel's trigger condition "After starting a chat". + +### Patch Changes + +- 62a13ed97d: chore: (Livechat) Replace all `dangerouslySetInnerHTML` with `gazzodown` +- 817141dcab: fix: Issue caused by spaces in the `config.url` setting +- b8f3d5014f: Fixed the login page language switcher, now the component has a new look, is reactive and the language selection becomes concrete upon login in. Also changed the default language of the login page to be the browser language. + - @rocket.chat/gazzodown@2.0.0 + - @rocket.chat/random@1.2.1 + ## 1.14.0-rc.5 ### Patch Changes diff --git a/packages/livechat/package.json b/packages/livechat/package.json index dabbe9f3f20e..12f00e594c19 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/livechat", - "version": "1.14.0-rc.5", + "version": "1.14.0", "files": [ "/build" ], diff --git a/packages/mock-providers/CHANGELOG.md b/packages/mock-providers/CHANGELOG.md index 448ae0b742a4..915bcabc5395 100644 --- a/packages/mock-providers/CHANGELOG.md +++ b/packages/mock-providers/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/mock-providers +## 0.0.2 + +### Patch Changes + +- b8f3d5014f: Fixed the login page language switcher, now the component has a new look, is reactive and the language selection becomes concrete upon login in. Also changed the default language of the login page to be the browser language. +- Updated dependencies [b8f3d5014f] + - @rocket.chat/i18n@0.0.2 + ## 0.0.2-rc.0 ### Patch Changes diff --git a/packages/mock-providers/package.json b/packages/mock-providers/package.json index d5bc013d9a18..c2aeb2665350 100644 --- a/packages/mock-providers/package.json +++ b/packages/mock-providers/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/mock-providers", - "version": "0.0.2-rc.0", + "version": "0.0.2", "private": true, "dependencies": { "@rocket.chat/i18n": "workspace:~", diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index 569331a94a00..8d03eaafa208 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,32 @@ # @rocket.chat/model-typings +## 0.1.0 + +### Minor Changes + +- 4186eecf05: Introduce the ability to report an user +- ead7c7bef2: Fixed read receipts not getting deleted after corresponding message is deleted + +### Patch Changes + +- 8a59855fcf: When setting a room as read-only, do not allow previously unmuted users to send messages. +- 5cee21468e: Fix spotlight search does not find rooms with special or non-latin characters +- aaefe865a7: fix: agent role being removed upon user deactivation +- f556518fa1: Change SAU aggregation to consider only sessions from few days ago instead of the whole past. + + This is particularly important for large workspaces in case the cron job did not run for some time, in that case the amount of sessions would accumulate and the aggregation would take a long time to run. + +- 61128364d6: Fixes a problem where the calculated time for considering the visitor abandonment was the first message from the visitor and not the visitor's reply to the agent. +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0 + ## 0.1.0-rc.5 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index 8d005aab734e..5174bf22f97a 100644 --- a/packages/model-typings/package.json +++ b/packages/model-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/model-typings", - "version": "0.1.0-rc.5", + "version": "0.1.0", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/models/CHANGELOG.md b/packages/models/CHANGELOG.md index 225f96789456..ac261acbc4d7 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,18 @@ # @rocket.chat/models +## 0.0.15 + +### Patch Changes + +- Updated dependencies [4186eecf05] +- Updated dependencies [8a59855fcf] +- Updated dependencies [5cee21468e] +- Updated dependencies [aaefe865a7] +- Updated dependencies [f556518fa1] +- Updated dependencies [ead7c7bef2] +- Updated dependencies [61128364d6] + - @rocket.chat/model-typings@0.1.0 + ## 0.0.15-rc.5 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index 317655b331e0..1644a8362c77 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.15-rc.5", + "version": "0.0.15", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/release-action/CHANGELOG.md b/packages/release-action/CHANGELOG.md index 23416df8c835..3435ec55ffa5 100644 --- a/packages/release-action/CHANGELOG.md +++ b/packages/release-action/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/release-action +## 2.2.0 + +### Minor Changes + +- f93648a5df: Add back "Engine Versions" to the release notes + +### Patch Changes + +- Updated dependencies [0f56aacc4d] + - @rocket.chat/eslint-config@0.6.0 + ## 2.2.0-rc.0 ### Minor Changes diff --git a/packages/release-action/package.json b/packages/release-action/package.json index c227df3f2d0f..0a1e3ded8927 100644 --- a/packages/release-action/package.json +++ b/packages/release-action/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/release-action", - "version": "2.2.0-rc.0", + "version": "2.2.0", "private": true, "scripts": { "build": "tsc", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index c2c6b28183d1..da3d48464546 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,32 @@ # @rocket.chat/rest-typings +## 6.4.0 + +### Minor Changes + +- 239a34e877: new: ring mobile users on direct conference calls +- 4186eecf05: Introduce the ability to report an user +- 2db32f0d4a: Add option to select what URL previews should be generated for each message. +- 19aec23cda: New AddUser workflow for Federated Rooms +- ebab8c4dd8: Added Reports Metrics Dashboard to Omnichannel +- 357a3a50fa: feat: high-contrast theme +- 1041d4d361: Added option to select between two script engine options for the integrations +- 93d4912e17: fix: missing params on updateOwnBasicInfo endpoint + +### Patch Changes + +- 203304782f: Fixed `overrideDestinationChannelEnabled` treated as a required param in `integrations.create` and `integration.update` endpoints +- 9496f1eb97: Deprecate `livechat:getOverviewData` and `livechat:getAgentOverviewData` methods and create API endpoints `livechat/analytics/overview` and `livechat/analytics/agent-overview` to fetch analytics data +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0 + ## 6.4.0-rc.5 ### Minor Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 55cb9e3f9d4c..4a325d06570b 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/rest-typings", - "version": "6.4.0-rc.5", + "version": "6.4.0", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.3", diff --git a/packages/tools/CHANGELOG.md b/packages/tools/CHANGELOG.md index 676c9927ae53..b5d9e6f419d4 100644 --- a/packages/tools/CHANGELOG.md +++ b/packages/tools/CHANGELOG.md @@ -1,5 +1,11 @@ # @rocket.chat/tools +## 0.1.0 + +### Minor Changes + +- 1041d4d361: Added option to select between two script engine options for the integrations + ## 0.1.0-rc.0 ### Minor Changes diff --git a/packages/tools/package.json b/packages/tools/package.json index 8208ac96b2f4..ed5e7bdd44bf 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/tools", - "version": "0.1.0-rc.0", + "version": "0.1.0", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index 8aa82c379c2e..77ab6ff504ca 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,19 @@ # @rocket.chat/ui-client +## 2.0.0 + +### Minor Changes + +- ebab8c4dd8: Added Reports Metrics Dashboard to Omnichannel +- ee3815fce4: feat: add ChangePassword field to Account/Security + +### Patch Changes + +- b8f3d5014f: Fixed the login page language switcher, now the component has a new look, is reactive and the language selection becomes concrete upon login in. Also changed the default language of the login page to be the browser language. +- Updated dependencies [074db3b419] +- Updated dependencies [b8f3d5014f] + - @rocket.chat/ui-contexts@2.0.0 + ## 2.0.0-rc.5 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index 4184a0b4c499..f81dd55ec5f3 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-client", - "version": "2.0.0-rc.5", + "version": "2.0.0", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -61,7 +61,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.5", + "@rocket.chat/ui-contexts": "2.0.0", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-contexts/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index 533e06007361..9ce5fe770cdd 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,33 @@ # @rocket.chat/ui-contexts +## 2.0.0 + +### Minor Changes + +- 074db3b419: UX improvement for the Moderation Console Context bar for viewing the reported messages. The Report reason is now displayed in the reported messages context bar. + The Moderation Action Modal confirmation description is updated to be more clear and concise. + +### Patch Changes + +- b8f3d5014f: Fixed the login page language switcher, now the component has a new look, is reactive and the language selection becomes concrete upon login in. Also changed the default language of the login page to be the browser language. +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [2db32f0d4a] +- Updated dependencies [982ef6f459] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [357a3a50fa] +- Updated dependencies [1041d4d361] +- Updated dependencies [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [93d4912e17] + - @rocket.chat/core-typings@6.4.0 + - @rocket.chat/rest-typings@6.4.0 + - @rocket.chat/ddp-client@0.2.0 + ## 2.0.0-rc.5 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index 9008527e7dab..92dbf1fab022 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-contexts", - "version": "2.0.0-rc.5", + "version": "2.0.0", "private": true, "devDependencies": { "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index c5c4475dd5e8..e28f20ad9ff4 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,13 @@ # @rocket.chat/ui-video-conf +## 2.0.0 + +### Patch Changes + +- Updated dependencies [074db3b419] +- Updated dependencies [b8f3d5014f] + - @rocket.chat/ui-contexts@2.0.0 + ## 2.0.0-rc.5 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index 09d910b70413..2409ce26f9ee 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "2.0.0-rc.5", + "version": "2.0.0", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.5", + "@rocket.chat/ui-contexts": "2.0.0", "react": "^17.0.2", "react-dom": "^17.0.2" }, diff --git a/packages/uikit-playground/CHANGELOG.md b/packages/uikit-playground/CHANGELOG.md index aee3d52e5249..35ae7c9ae5e9 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,24 @@ # @rocket.chat/uikit-playground +## 0.2.0 + +### Minor Changes + +- 1246a21648: feat: Add missing variants to UIKit button +- f9a748526d: feat: Adding new UIKit components: Callout, Checkbox, Radio Button, Time Picker, Toast Bar, Toggle Switch, Tab Navigation + +### Patch Changes + +- dc1d8ce92e: feat(fuselage-ui-kit): Introduce `TabsNavigationBlock` +- Updated dependencies [1246a21648] +- Updated dependencies [f9a748526d] +- Updated dependencies [dc1d8ce92e] +- Updated dependencies [074db3b419] +- Updated dependencies [dce4a829fa] +- Updated dependencies [b8f3d5014f] + - @rocket.chat/fuselage-ui-kit@2.0.0 + - @rocket.chat/ui-contexts@2.0.0 + ## 0.2.0-rc.5 ### Patch Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index a97fee768fe1..a34e4fe804b7 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -1,7 +1,7 @@ { "name": "@rocket.chat/uikit-playground", "private": true, - "version": "0.2.0-rc.5", + "version": "0.2.0", "type": "module", "scripts": { "dev": "vite", diff --git a/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index 96575b1b03dc..2f4946f4ba48 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,14 @@ # @rocket.chat/web-ui-registration +## 2.0.0 + +### Patch Changes + +- b8f3d5014f: Fixed the login page language switcher, now the component has a new look, is reactive and the language selection becomes concrete upon login in. Also changed the default language of the login page to be the browser language. +- Updated dependencies [074db3b419] +- Updated dependencies [b8f3d5014f] + - @rocket.chat/ui-contexts@2.0.0 + ## 2.0.0-rc.5 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index 0e0a4d130fac..f26718de571a 100644 --- a/packages/web-ui-registration/package.json +++ b/packages/web-ui-registration/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/web-ui-registration", - "version": "2.0.0-rc.5", + "version": "2.0.0", "private": true, "homepage": "https://rocket.chat", "main": "./dist/index.js", @@ -49,7 +49,7 @@ }, "peerDependencies": { "@rocket.chat/layout": "*", - "@rocket.chat/ui-contexts": "2.0.0-rc.5", + "@rocket.chat/ui-contexts": "2.0.0", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", diff --git a/yarn.lock b/yarn.lock index 284adfa27307..08bafa660252 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8233,9 +8233,9 @@ __metadata: "@rocket.chat/icons": "*" "@rocket.chat/prettier-config": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 2.0.0-rc.4 + "@rocket.chat/ui-contexts": 2.0.0-rc.5 "@rocket.chat/ui-kit": "*" - "@rocket.chat/ui-video-conf": 2.0.0-rc.4 + "@rocket.chat/ui-video-conf": 2.0.0-rc.5 "@tanstack/react-query": "*" react: "*" react-dom: "*" @@ -8317,14 +8317,14 @@ __metadata: ts-jest: ~29.0.5 typescript: ~5.2.2 peerDependencies: - "@rocket.chat/core-typings": 6.4.0-rc.4 + "@rocket.chat/core-typings": 6.4.0-rc.5 "@rocket.chat/css-in-js": "*" "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-tokens": "*" "@rocket.chat/message-parser": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-client": 2.0.0-rc.4 - "@rocket.chat/ui-contexts": 2.0.0-rc.4 + "@rocket.chat/ui-client": 2.0.0-rc.5 + "@rocket.chat/ui-contexts": 2.0.0-rc.5 katex: "*" react: "*" languageName: unknown @@ -9447,7 +9447,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 2.0.0-rc.4 + "@rocket.chat/ui-contexts": 2.0.0-rc.5 react: ~17.0.2 languageName: unknown linkType: soft @@ -9599,7 +9599,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 2.0.0-rc.4 + "@rocket.chat/ui-contexts": 2.0.0-rc.5 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -9683,7 +9683,7 @@ __metadata: typescript: ~5.2.2 peerDependencies: "@rocket.chat/layout": "*" - "@rocket.chat/ui-contexts": 2.0.0-rc.4 + "@rocket.chat/ui-contexts": 2.0.0-rc.5 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" From 699f10dd5728f1a8a44251f58eafd66d1285e631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=87=E3=83=AF=E3=83=B3=E3=82=B7=E3=83=A5?= <61188295+Dnouv@users.noreply.github.com> Date: Thu, 28 Sep 2023 02:04:04 +0530 Subject: [PATCH 207/275] fix: RTL lang crashes Moderation Console (#30393) --- .../client/views/admin/moderation/helpers/DateRangePicker.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/meteor/client/views/admin/moderation/helpers/DateRangePicker.tsx b/apps/meteor/client/views/admin/moderation/helpers/DateRangePicker.tsx index f870dbc52776..326cc3382b4b 100644 --- a/apps/meteor/client/views/admin/moderation/helpers/DateRangePicker.tsx +++ b/apps/meteor/client/views/admin/moderation/helpers/DateRangePicker.tsx @@ -10,7 +10,7 @@ type DateRangePickerProps = Omit, 'onChange'> & { onChange(range: { start: string; end: string }): void; }; -const formatToDateInput = (date: Moment) => date.format('YYYY-MM-DD'); +const formatToDateInput = (date: Moment) => date.locale('en').format('YYYY-MM-DD'); const todayDate = formatToDateInput(moment()); From 2872428d97915734dc506659b248eb1c155e4ba5 Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Thu, 28 Sep 2023 12:06:39 -0300 Subject: [PATCH 208/275] chore: move Omnichannel toolbox section from sidebar room list (#30502) --- .../meteor/client/sidebar/RoomList/RoomListRow.tsx | 14 ++------------ apps/meteor/client/sidebar/Sidebar.tsx | 5 +++++ apps/meteor/client/sidebar/hooks/useRoomList.ts | 1 - .../client/sidebar/sections/OmnichannelSection.tsx | 10 +++------- 4 files changed, 10 insertions(+), 20 deletions(-) diff --git a/apps/meteor/client/sidebar/RoomList/RoomListRow.tsx b/apps/meteor/client/sidebar/RoomList/RoomListRow.tsx index 69afd3c2667a..593bd784be90 100644 --- a/apps/meteor/client/sidebar/RoomList/RoomListRow.tsx +++ b/apps/meteor/client/sidebar/RoomList/RoomListRow.tsx @@ -1,21 +1,14 @@ import type { IRoom, ISubscription } from '@rocket.chat/core-typings'; import { SidebarSection } from '@rocket.chat/fuselage'; import type { useTranslation } from '@rocket.chat/ui-contexts'; -import type { ComponentType, ReactElement } from 'react'; +import type { ReactElement } from 'react'; import React, { memo, useMemo } from 'react'; import { useVideoConfAcceptCall, useVideoConfRejectIncomingCall, useVideoConfIncomingCalls } from '../../contexts/VideoConfContext'; import type { useAvatarTemplate } from '../hooks/useAvatarTemplate'; import type { useTemplateByViewMode } from '../hooks/useTemplateByViewMode'; -import OmnichannelSection from '../sections/OmnichannelSection'; import SideBarItemTemplateWithData from './SideBarItemTemplateWithData'; -const sections: { - [key: string]: ComponentType; -} = { - Omnichannel: OmnichannelSection, -}; - type RoomListRowProps = { extended: boolean; t: ReturnType; @@ -44,10 +37,7 @@ const RoomListRow = ({ data, item }: { data: RoomListRowProps; item: ISubscripti ); if (typeof item === 'string') { - const Section = sections[item]; - return Section ? ( -
- ) : ( + return ( {t(item)} diff --git a/apps/meteor/client/sidebar/Sidebar.tsx b/apps/meteor/client/sidebar/Sidebar.tsx index ae333bbdb2a1..9c7634872ed4 100644 --- a/apps/meteor/client/sidebar/Sidebar.tsx +++ b/apps/meteor/client/sidebar/Sidebar.tsx @@ -4,12 +4,16 @@ import { useSessionStorage } from '@rocket.chat/fuselage-hooks'; import { useLayout, useSetting, useUserPreference } from '@rocket.chat/ui-contexts'; import React, { memo } from 'react'; +import { useOmnichannelEnabled } from '../hooks/omnichannel/useOmnichannelEnabled'; import SidebarRoomList from './RoomList'; import SidebarFooter from './footer'; import SidebarHeader from './header'; +import OmnichannelSection from './sections/OmnichannelSection'; import StatusDisabledSection from './sections/StatusDisabledSection'; const Sidebar = () => { + const showOmnichannel = useOmnichannelEnabled(); + const sidebarViewMode = useUserPreference('sidebarViewMode'); const sidebarHideAvatar = !useUserPreference('sidebarDisplayAvatar'); const { sidebar } = useLayout(); @@ -38,6 +42,7 @@ const Sidebar = () => { > {presenceDisabled && !bannerDismissed && setBannerDismissed(true)} />} + {showOmnichannel && } diff --git a/apps/meteor/client/sidebar/hooks/useRoomList.ts b/apps/meteor/client/sidebar/hooks/useRoomList.ts index 436c7c1dc71d..fa5dfd2797cb 100644 --- a/apps/meteor/client/sidebar/hooks/useRoomList.ts +++ b/apps/meteor/client/sidebar/hooks/useRoomList.ts @@ -92,7 +92,6 @@ export const useRoomList = (): Array => { }); const groups = new Map(); - showOmnichannel && groups.set('Omnichannel', []); incomingCall.size && groups.set('Incoming Calls', incomingCall); showOmnichannel && inquiries.enabled && queue.length && groups.set('Incoming_Livechats', queue); showOmnichannel && omnichannel.size && groups.set('Open_Livechats', omnichannel); diff --git a/apps/meteor/client/sidebar/sections/OmnichannelSection.tsx b/apps/meteor/client/sidebar/sections/OmnichannelSection.tsx index 542fa05c54ab..e7dec5f3506a 100644 --- a/apps/meteor/client/sidebar/sections/OmnichannelSection.tsx +++ b/apps/meteor/client/sidebar/sections/OmnichannelSection.tsx @@ -1,15 +1,13 @@ -import type { Box } from '@rocket.chat/fuselage'; import { Sidebar } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useLayout, useRoute, usePermission, useTranslation } from '@rocket.chat/ui-contexts'; -import type { ReactElement } from 'react'; import React, { memo } from 'react'; import { useIsCallEnabled, useIsCallReady } from '../../contexts/CallContext'; import { useOmnichannelShowQueueLink } from '../../hooks/omnichannel/useOmnichannelShowQueueLink'; import { OmniChannelCallDialPad, OmnichannelCallToggle, OmnichannelLivechatToggle } from './actions'; -const OmnichannelSection = (props: typeof Box): ReactElement => { +const OmnichannelSection = () => { const t = useTranslation(); const isCallEnabled = useIsCallEnabled(); const isCallReady = useIsCallReady(); @@ -34,7 +32,7 @@ const OmnichannelSection = (props: typeof Box): ReactElement => { // The className is a paliative while we make TopBar.ToolBox optional on fuselage return ( - + {t('Omnichannel')} {showOmnichannelQueueLink && ( @@ -56,6 +54,4 @@ const OmnichannelSection = (props: typeof Box): ReactElement => { ); }; -export default Object.assign(memo(OmnichannelSection), { - size: 56, -}); +export default memo(OmnichannelSection); From 5f81a0f3cb8dfe8a53543af959b7679e03b71254 Mon Sep 17 00:00:00 2001 From: Luis Mauro <1216941+lmauromb@users.noreply.github.com> Date: Thu, 28 Sep 2023 16:17:27 -0600 Subject: [PATCH 209/275] feat: License V3 (#30287) Co-authored-by: Pierre Lehnen Co-authored-by: Guilherme Gazzo --- .changeset/twelve-files-deny.md | 22 + apps/meteor/app/api/server/v1/federation.ts | 4 +- .../app/statistics/server/lib/statistics.ts | 2 +- .../client/views/hooks/useUpgradeTabParams.ts | 10 +- .../ee/app/api-enterprise/server/index.ts | 4 +- .../authorization/server/validateUserRoles.js | 29 - .../authorization/server/validateUserRoles.ts | 43 ++ .../ee/app/canned-responses/server/index.ts | 4 +- .../ee/app/license/server/canEnableApp.ts | 25 + apps/meteor/ee/app/license/server/decrypt.ts | 10 - .../ee/app/license/server/getStatistics.ts | 9 +- apps/meteor/ee/app/license/server/index.ts | 2 - .../ee/app/license/server/lib/getAppCount.ts | 21 + .../license/server/lib/isUnderAppLimits.ts | 26 - .../license/server/license.internalService.ts | 20 +- apps/meteor/ee/app/license/server/license.ts | 467 ------------- apps/meteor/ee/app/license/server/methods.ts | 12 +- apps/meteor/ee/app/license/server/settings.ts | 18 +- apps/meteor/ee/app/license/server/startup.ts | 23 +- .../server/business-hour/Helper.ts | 4 +- .../app/livechat-enterprise/server/index.ts | 4 +- .../server/lib/LivechatEnterprise.ts | 6 +- .../app/message-read-receipt/server/index.ts | 4 +- .../meteor/ee/app/settings/server/settings.ts | 8 +- .../server/services/voipService.ts | 4 +- .../ee/client/hooks/useHasLicenseModule.ts | 5 +- apps/meteor/ee/client/lib/onToggledFeature.ts | 4 +- .../client/views/admin/users/useSeatsCap.ts | 1 + apps/meteor/ee/server/api/api.ts | 5 +- apps/meteor/ee/server/api/chat.ts | 4 +- apps/meteor/ee/server/api/licenses.ts | 21 +- apps/meteor/ee/server/api/roles.ts | 6 +- apps/meteor/ee/server/api/sessions.ts | 14 +- .../endpoints/appsCountHandler.ts | 4 +- .../ee/server/apps/communication/rest.ts | 5 +- apps/meteor/ee/server/apps/orchestrator.js | 2 +- apps/meteor/ee/server/configuration/ldap.ts | 4 +- apps/meteor/ee/server/configuration/oauth.ts | 4 +- .../server/configuration/outlookCalendar.ts | 4 +- apps/meteor/ee/server/configuration/saml.ts | 6 +- .../server/configuration/videoConference.ts | 4 +- apps/meteor/ee/server/lib/EnterpriseCheck.ts | 2 +- apps/meteor/ee/server/lib/syncUserRoles.ts | 4 +- .../server/local-services/instance/service.ts | 2 +- .../ee/server/methods/getReadReceipts.ts | 4 +- apps/meteor/ee/server/models/startup.ts | 4 +- .../ee/server/startup/apps/trialExpiration.ts | 4 +- apps/meteor/ee/server/startup/audit.ts | 5 +- .../ee/server/startup/deviceManagement.ts | 5 +- .../ee/server/startup/engagementDashboard.ts | 5 +- .../ee/server/startup/maxRoomsPerGuest.ts | 7 +- apps/meteor/ee/server/startup/seatsCap.ts | 38 +- apps/meteor/ee/server/startup/services.ts | 6 +- apps/meteor/ee/server/startup/upsell.ts | 17 +- ...getInstallationSourceFromAppStorageItem.ts | 3 +- apps/meteor/package.json | 2 + .../server/services/authorization/service.ts | 2 +- apps/meteor/server/startup/migrations/v278.ts | 4 +- ee/apps/account-service/Dockerfile | 9 + ee/apps/authorization-service/Dockerfile | 9 + ee/apps/ddp-streamer/Dockerfile | 12 +- ee/apps/omnichannel-transcript/Dockerfile | 12 +- ee/apps/presence-service/Dockerfile | 9 + ee/apps/queue-worker/Dockerfile | 12 +- ee/apps/stream-hub-service/Dockerfile | 6 + ee/packages/license/.eslintrc.json | 4 + .../license/__tests__/MockedLicenseBuilder.ts | 209 ++++++ ee/packages/license/__tests__/emitter.spec.ts | 66 ++ .../license/__tests__/setLicense.spec.ts | 103 +++ ee/packages/license/babel.config.json | 11 + ee/packages/license/jest.config.ts | 16 + ee/packages/license/package.json | 47 ++ .../license/src}/definition/ILicenseTag.ts | 0 .../license/src/definition/ILicenseV2.ts | 2 +- .../license/src/definition/ILicenseV3.ts | 64 ++ .../license/src/definition/LicenseBehavior.ts | 8 + .../license/src/definition/LicenseLimit.ts | 7 + .../license/src/definition/LicenseModule.ts | 18 + .../license/src/definition/LicensePeriod.ts | 13 + .../license/src/definition/LimitContext.ts | 5 + ee/packages/license/src/deprecated.ts | 38 + .../src/errors/DuplicatedLicenseError.ts | 6 + .../license/src/errors/InvalidLicenseError.ts | 6 + .../src/errors/NotReadyForValidation.ts | 6 + ee/packages/license/src/events/deprecated.ts | 12 + ee/packages/license/src/events/emitter.ts | 30 + ee/packages/license/src/events/listeners.ts | 75 ++ .../src/events/overwriteClassOnLicense.ts | 26 + ee/packages/license/src/index.ts | 106 +++ ee/packages/license/src/license.spec.ts | 42 ++ ee/packages/license/src/license.ts | 230 ++++++ ee/packages/license/src/logger.ts | 3 + ee/packages/license/src/modules.ts | 50 ++ ee/packages/license/src/pendingLicense.ts | 32 + ee/packages/license/src/showLicense.ts | 27 + ee/packages/license/src/tags.ts | 23 + ee/packages/license/src/token.ts | 59 ++ .../packages/license/src/v2}/bundles.ts | 0 ee/packages/license/src/v2/convertToV3.ts | 114 +++ .../packages/license/src/v2}/getTagColor.ts | 0 .../getCurrentValueForLicenseLimit.ts | 40 ++ .../src/validation/getModulesToDisable.ts | 15 + .../src/validation/getResultingBehavior.ts | 20 + .../src/validation/isBehaviorsInResult.ts | 4 + .../src/validation/isReadyForValidation.ts | 7 + .../src/validation/runValidation.spec.ts | 38 + .../license/src/validation/runValidation.ts | 22 + .../license/src/validation/validateFormat.ts | 16 + .../src/validation/validateLicenseLimits.ts | 39 ++ .../src/validation/validateLicensePeriods.ts | 38 + .../src/validation/validateLicenseUrl.ts | 59 ++ ee/packages/license/tsconfig.json | 9 + .../src/OmnichannelTranscript.ts | 2 +- .../omnichannel-services/src/QueueWorker.ts | 2 +- ee/packages/presence/src/Presence.ts | 2 +- packages/core-services/src/types/ILicense.ts | 4 +- .../core-typings/src/ee/ILicense/ILicense.ts | 20 - .../src/ee/ILicense/ILicenseTag.ts | 4 - packages/core-typings/src/index.ts | 1 - packages/jwt/.eslintrc.json | 4 + packages/jwt/__tests__/jwt.spec.ts | 90 +++ packages/jwt/jest.config.js | 5 + packages/jwt/package.json | 31 + packages/jwt/src/index.ts | 29 + packages/jwt/tsconfig.json | 10 + .../model-typings/src/models/IUsersModel.ts | 2 +- packages/rest-typings/package.json | 1 + packages/rest-typings/src/v1/licenses.ts | 4 +- yarn.lock | 659 +++++++++++------- 129 files changed, 2687 insertions(+), 1005 deletions(-) create mode 100644 .changeset/twelve-files-deny.md delete mode 100644 apps/meteor/ee/app/authorization/server/validateUserRoles.js create mode 100644 apps/meteor/ee/app/authorization/server/validateUserRoles.ts create mode 100644 apps/meteor/ee/app/license/server/canEnableApp.ts delete mode 100644 apps/meteor/ee/app/license/server/decrypt.ts create mode 100644 apps/meteor/ee/app/license/server/lib/getAppCount.ts delete mode 100644 apps/meteor/ee/app/license/server/lib/isUnderAppLimits.ts delete mode 100644 apps/meteor/ee/app/license/server/license.ts create mode 100644 ee/packages/license/.eslintrc.json create mode 100644 ee/packages/license/__tests__/MockedLicenseBuilder.ts create mode 100644 ee/packages/license/__tests__/emitter.spec.ts create mode 100644 ee/packages/license/__tests__/setLicense.spec.ts create mode 100644 ee/packages/license/babel.config.json create mode 100644 ee/packages/license/jest.config.ts create mode 100644 ee/packages/license/package.json rename {apps/meteor/ee/app/license => ee/packages/license/src}/definition/ILicenseTag.ts (100%) rename apps/meteor/ee/app/license/definition/ILicense.ts => ee/packages/license/src/definition/ILicenseV2.ts (93%) create mode 100644 ee/packages/license/src/definition/ILicenseV3.ts create mode 100644 ee/packages/license/src/definition/LicenseBehavior.ts create mode 100644 ee/packages/license/src/definition/LicenseLimit.ts create mode 100644 ee/packages/license/src/definition/LicenseModule.ts create mode 100644 ee/packages/license/src/definition/LicensePeriod.ts create mode 100644 ee/packages/license/src/definition/LimitContext.ts create mode 100644 ee/packages/license/src/deprecated.ts create mode 100644 ee/packages/license/src/errors/DuplicatedLicenseError.ts create mode 100644 ee/packages/license/src/errors/InvalidLicenseError.ts create mode 100644 ee/packages/license/src/errors/NotReadyForValidation.ts create mode 100644 ee/packages/license/src/events/deprecated.ts create mode 100644 ee/packages/license/src/events/emitter.ts create mode 100644 ee/packages/license/src/events/listeners.ts create mode 100644 ee/packages/license/src/events/overwriteClassOnLicense.ts create mode 100644 ee/packages/license/src/index.ts create mode 100644 ee/packages/license/src/license.spec.ts create mode 100644 ee/packages/license/src/license.ts create mode 100644 ee/packages/license/src/logger.ts create mode 100644 ee/packages/license/src/modules.ts create mode 100644 ee/packages/license/src/pendingLicense.ts create mode 100644 ee/packages/license/src/showLicense.ts create mode 100644 ee/packages/license/src/tags.ts create mode 100644 ee/packages/license/src/token.ts rename {apps/meteor/ee/app/license/server => ee/packages/license/src/v2}/bundles.ts (100%) create mode 100644 ee/packages/license/src/v2/convertToV3.ts rename {apps/meteor/ee/app/license/server => ee/packages/license/src/v2}/getTagColor.ts (100%) create mode 100644 ee/packages/license/src/validation/getCurrentValueForLicenseLimit.ts create mode 100644 ee/packages/license/src/validation/getModulesToDisable.ts create mode 100644 ee/packages/license/src/validation/getResultingBehavior.ts create mode 100644 ee/packages/license/src/validation/isBehaviorsInResult.ts create mode 100644 ee/packages/license/src/validation/isReadyForValidation.ts create mode 100644 ee/packages/license/src/validation/runValidation.spec.ts create mode 100644 ee/packages/license/src/validation/runValidation.ts create mode 100644 ee/packages/license/src/validation/validateFormat.ts create mode 100644 ee/packages/license/src/validation/validateLicenseLimits.ts create mode 100644 ee/packages/license/src/validation/validateLicensePeriods.ts create mode 100644 ee/packages/license/src/validation/validateLicenseUrl.ts create mode 100644 ee/packages/license/tsconfig.json delete mode 100644 packages/core-typings/src/ee/ILicense/ILicense.ts delete mode 100644 packages/core-typings/src/ee/ILicense/ILicenseTag.ts create mode 100644 packages/jwt/.eslintrc.json create mode 100644 packages/jwt/__tests__/jwt.spec.ts create mode 100644 packages/jwt/jest.config.js create mode 100644 packages/jwt/package.json create mode 100644 packages/jwt/src/index.ts create mode 100644 packages/jwt/tsconfig.json diff --git a/.changeset/twelve-files-deny.md b/.changeset/twelve-files-deny.md new file mode 100644 index 000000000000..123bf0a7764b --- /dev/null +++ b/.changeset/twelve-files-deny.md @@ -0,0 +1,22 @@ +--- +'@rocket.chat/license': minor +'@rocket.chat/jwt': minor +'@rocket.chat/omnichannel-services': minor +'@rocket.chat/omnichannel-transcript': minor +'@rocket.chat/authorization-service': minor +'@rocket.chat/stream-hub-service': minor +'@rocket.chat/presence-service': minor +'@rocket.chat/account-service': minor +'@rocket.chat/core-services': minor +'@rocket.chat/model-typings': minor +'@rocket.chat/core-typings': minor +'@rocket.chat/rest-typings': minor +'@rocket.chat/ddp-streamer': minor +'@rocket.chat/queue-worker': minor +'@rocket.chat/presence': minor +'@rocket.chat/meteor': minor +--- + +Implemented the License library, it is used to handle the functionality like expiration date, modules, limits, etc. +Also added a version v3 of the license, which contains an extended list of features. +v2 is still supported, since we convert it to v3 on the fly. diff --git a/apps/meteor/app/api/server/v1/federation.ts b/apps/meteor/app/api/server/v1/federation.ts index 02fc30763eeb..7be5b1fc13fe 100644 --- a/apps/meteor/app/api/server/v1/federation.ts +++ b/apps/meteor/app/api/server/v1/federation.ts @@ -1,7 +1,7 @@ import { Federation, FederationEE } from '@rocket.chat/core-services'; +import { License } from '@rocket.chat/license'; import { isFederationVerifyMatrixIdProps } from '@rocket.chat/rest-typings'; -import { isEnterprise } from '../../../../ee/app/license/server'; import { API } from '../api'; API.v1.addRoute( @@ -14,7 +14,7 @@ API.v1.addRoute( async get() { const { matrixIds } = this.queryParams; - const federationService = isEnterprise() ? FederationEE : Federation; + const federationService = License.hasValidLicense() ? FederationEE : Federation; const results = await federationService.verifyMatrixIds(matrixIds); diff --git a/apps/meteor/app/statistics/server/lib/statistics.ts b/apps/meteor/app/statistics/server/lib/statistics.ts index 8cfe45b42232..54470a209196 100644 --- a/apps/meteor/app/statistics/server/lib/statistics.ts +++ b/apps/meteor/app/statistics/server/lib/statistics.ts @@ -27,7 +27,7 @@ import { } from '@rocket.chat/models'; import { MongoInternals } from 'meteor/mongo'; -import { getStatistics as getEnterpriseStatistics } from '../../../../ee/app/license/server'; +import { getStatistics as getEnterpriseStatistics } from '../../../../ee/app/license/server/getStatistics'; import { readSecondaryPreferred } from '../../../../server/database/readSecondaryPreferred'; import { isRunningMs } from '../../../../server/lib/isRunningMs'; import { getControl } from '../../../../server/lib/migrations'; diff --git a/apps/meteor/client/views/hooks/useUpgradeTabParams.ts b/apps/meteor/client/views/hooks/useUpgradeTabParams.ts index e051b69db8fa..65dd4cb1e396 100644 --- a/apps/meteor/client/views/hooks/useUpgradeTabParams.ts +++ b/apps/meteor/client/views/hooks/useUpgradeTabParams.ts @@ -1,3 +1,4 @@ +import type { ILicenseV2, ILicenseV3 } from '@rocket.chat/license'; import { useSetting } from '@rocket.chat/ui-contexts'; import { format } from 'date-fns'; @@ -16,9 +17,12 @@ export const useUpgradeTabParams = (): { tabType: UpgradeTabVariant | false; tri const hasValidLicense = licensesData?.licenses.some((license) => license.modules.length > 0) ?? false; const hadExpiredTrials = cloudWorkspaceHadTrial ?? false; - const trialLicense = licensesData?.licenses?.find(({ meta }) => meta?.trial); - const isTrial = licensesData?.licenses?.every(({ meta }) => meta?.trial) ?? false; - const trialEndDate = trialLicense?.meta ? format(new Date(trialLicense.meta.trialEnd), 'yyyy-MM-dd') : undefined; + const licenses = (licensesData?.licenses || []) as (Partial & { modules: string[] })[]; + + const trialLicense = licenses.find(({ meta, information }) => information?.trial ?? meta?.trial); + const isTrial = Boolean(trialLicense); + const trialEndDateStr = trialLicense?.information?.visualExpiration || trialLicense?.meta?.trialEnd || trialLicense?.cloudMeta?.trialEnd; + const trialEndDate = trialEndDateStr ? format(new Date(trialEndDateStr), 'yyyy-MM-dd') : undefined; const upgradeTabType = getUpgradeTabType({ registered, diff --git a/apps/meteor/ee/app/api-enterprise/server/index.ts b/apps/meteor/ee/app/api-enterprise/server/index.ts index 6af539bda36c..7a528a4ec2f4 100644 --- a/apps/meteor/ee/app/api-enterprise/server/index.ts +++ b/apps/meteor/ee/app/api-enterprise/server/index.ts @@ -1,5 +1,5 @@ -import { onLicense } from '../../license/server'; +import { License } from '@rocket.chat/license'; -await onLicense('canned-responses', async () => { +await License.onLicense('canned-responses', async () => { await import('./canned-responses'); }); diff --git a/apps/meteor/ee/app/authorization/server/validateUserRoles.js b/apps/meteor/ee/app/authorization/server/validateUserRoles.js deleted file mode 100644 index fe8e3410bc01..000000000000 --- a/apps/meteor/ee/app/authorization/server/validateUserRoles.js +++ /dev/null @@ -1,29 +0,0 @@ -import { Users } from '@rocket.chat/models'; -import { Meteor } from 'meteor/meteor'; - -import { isEnterprise, getMaxGuestUsers } from '../../license/server'; - -export const validateUserRoles = async function (userId, userData) { - if (!isEnterprise()) { - return; - } - - if (!userData.roles.includes('guest')) { - return; - } - - if (userData.roles.length >= 2) { - throw new Meteor.Error('error-guests-cant-have-other-roles', "Guest users can't receive any other role", { - method: 'insertOrUpdateUser', - field: 'Assign_role', - }); - } - - const guestCount = await Users.getActiveLocalGuestCount(userData._id); - if (guestCount >= getMaxGuestUsers()) { - throw new Meteor.Error('error-max-guests-number-reached', 'Maximum number of guests reached.', { - method: 'insertOrUpdateUser', - field: 'Assign_role', - }); - } -}; diff --git a/apps/meteor/ee/app/authorization/server/validateUserRoles.ts b/apps/meteor/ee/app/authorization/server/validateUserRoles.ts new file mode 100644 index 000000000000..a07165b8c5d8 --- /dev/null +++ b/apps/meteor/ee/app/authorization/server/validateUserRoles.ts @@ -0,0 +1,43 @@ +import type { IUser } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; +import { Users } from '@rocket.chat/models'; +import { Meteor } from 'meteor/meteor'; + +import { i18n } from '../../../../server/lib/i18n'; + +export const validateUserRoles = async function (userData: Partial) { + if (!License.hasValidLicense()) { + return; + } + + const isGuest = Boolean(userData.roles?.includes('guest') && userData.roles.length === 1); + const currentUserData = userData._id ? await Users.findOneById(userData._id) : null; + const wasGuest = Boolean(currentUserData?.roles?.includes('guest') && currentUserData.roles.length === 1); + + if (currentUserData?.type === 'app') { + return; + } + + if (isGuest) { + if (wasGuest) { + return; + } + + if (await License.shouldPreventAction('guestUsers')) { + throw new Meteor.Error('error-max-guests-number-reached', 'Maximum number of guests reached.', { + method: 'insertOrUpdateUser', + field: 'Assign_role', + }); + } + + return; + } + + if (!wasGuest && userData._id) { + return; + } + + if (await License.shouldPreventAction('activeUsers')) { + throw new Meteor.Error('error-license-user-limit-reached', i18n.t('error-license-user-limit-reached')); + } +}; diff --git a/apps/meteor/ee/app/canned-responses/server/index.ts b/apps/meteor/ee/app/canned-responses/server/index.ts index 47249c017b83..99254b037380 100644 --- a/apps/meteor/ee/app/canned-responses/server/index.ts +++ b/apps/meteor/ee/app/canned-responses/server/index.ts @@ -1,6 +1,6 @@ -import { onLicense } from '../../license/server'; +import { License } from '@rocket.chat/license'; -await onLicense('canned-responses', async () => { +await License.onLicense('canned-responses', async () => { const { createSettings } = await import('./settings'); await import('./permissions'); await import('./hooks/onRemoveAgentDepartment'); diff --git a/apps/meteor/ee/app/license/server/canEnableApp.ts b/apps/meteor/ee/app/license/server/canEnableApp.ts new file mode 100644 index 000000000000..72220e27acad --- /dev/null +++ b/apps/meteor/ee/app/license/server/canEnableApp.ts @@ -0,0 +1,25 @@ +import type { IAppStorageItem } from '@rocket.chat/apps-engine/server/storage'; +import { Apps } from '@rocket.chat/core-services'; +import { License } from '@rocket.chat/license'; + +import { getInstallationSourceFromAppStorageItem } from '../../../../lib/apps/getInstallationSourceFromAppStorageItem'; + +export const canEnableApp = async (app: IAppStorageItem): Promise => { + if (!(await Apps.isInitialized())) { + return false; + } + + // Migrated apps were installed before the validation was implemented + // so they're always allowed to be enabled + if (app.migrated) { + return true; + } + + const source = getInstallationSourceFromAppStorageItem(app); + switch (source) { + case 'private': + return !(await License.shouldPreventAction('privateApps')); + default: + return !(await License.shouldPreventAction('marketplaceApps')); + } +}; diff --git a/apps/meteor/ee/app/license/server/decrypt.ts b/apps/meteor/ee/app/license/server/decrypt.ts deleted file mode 100644 index 62e34817aec6..000000000000 --- a/apps/meteor/ee/app/license/server/decrypt.ts +++ /dev/null @@ -1,10 +0,0 @@ -import crypto from 'crypto'; - -const publicKey = - 'LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQ0lqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FnOEFNSUlDQ2dLQ0FnRUFxV1Nza2Q5LzZ6Ung4a3lQY2ljcwpiMzJ3Mnd4VnV3N3lCVDk2clEvOEQreU1lQ01POXdTU3BIYS85bkZ5d293RXRpZ3B0L3dyb1BOK1ZHU3didHdQCkZYQmVxRWxCbmRHRkFsODZlNStFbGlIOEt6L2hHbkNtSk5tWHB4RUsyUkUwM1g0SXhzWVg3RERCN010eC9pcXMKY2pCL091dlNCa2ppU2xlUzdibE5JVC9kQTdLNC9DSjNvaXUwMmJMNEV4Y2xDSGVwenFOTWVQM3dVWmdweE9uZgpOT3VkOElYWUs3M3pTY3VFOEUxNTdZd3B6Q0twVmFIWDdaSmY4UXVOc09PNVcvYUlqS2wzTDYyNjkrZUlPRXJHCndPTm1hSG56Zmc5RkxwSmh6Z3BPMzhhVm43NnZENUtLakJhaldza1krNGEyZ1NRbUtOZUZxYXFPb3p5RUZNMGUKY0ZXWlZWWjNMZWg0dkVNb1lWUHlJeng5Nng4ZjIveW1QbmhJdXZRdjV3TjRmeWVwYTdFWTVVQ2NwNzF6OGtmUAo0RmNVelBBMElEV3lNaWhYUi9HNlhnUVFaNEdiL3FCQmh2cnZpSkNGemZZRGNKZ0w3RmVnRllIUDNQR0wwN1FnCnZMZXZNSytpUVpQcnhyYnh5U3FkUE9rZ3VyS2pWclhUVXI0QTlUZ2lMeUlYNVVsSnEzRS9SVjdtZk9xWm5MVGEKU0NWWEhCaHVQbG5DR1pSMDFUb1RDZktoTUcxdTBDRm5MMisxNWhDOWZxT21XdjlRa2U0M3FsSjBQZ0YzVkovWAp1eC9tVHBuazlnbmJHOUpIK21mSDM5Um9GdlROaW5Zd1NNdll6dXRWT242OXNPemR3aERsYTkwbDNBQ2g0eENWCks3Sk9YK3VIa29OdTNnMmlWeGlaVU0wQ0F3RUFBUT09Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo='; - -export default function decrypt(encrypted: string): string { - const decrypted = crypto.publicDecrypt(Buffer.from(publicKey, 'base64').toString('utf-8'), Buffer.from(encrypted, 'base64')); - - return decrypted.toString('utf-8'); -} diff --git a/apps/meteor/ee/app/license/server/getStatistics.ts b/apps/meteor/ee/app/license/server/getStatistics.ts index d7f81e416bfd..e8ff402ea1ca 100644 --- a/apps/meteor/ee/app/license/server/getStatistics.ts +++ b/apps/meteor/ee/app/license/server/getStatistics.ts @@ -1,10 +1,9 @@ import { log } from 'console'; import { Analytics } from '@rocket.chat/core-services'; +import { License } from '@rocket.chat/license'; import { CannedResponse, OmnichannelServiceLevelAgreements, LivechatRooms, LivechatTag, LivechatUnit, Users } from '@rocket.chat/models'; -import { getModules, getTags, hasLicense } from './license'; - type ENTERPRISE_STATISTICS = GenericStats & Partial; type GenericStats = { @@ -28,8 +27,8 @@ type EEOnlyStats = { export async function getStatistics(): Promise { const genericStats: GenericStats = { - modules: getModules(), - tags: getTags().map(({ name }) => name), + modules: License.getModules(), + tags: License.getTags().map(({ name }) => name), seatRequests: await Analytics.getSeatRequestCount(), }; @@ -45,7 +44,7 @@ export async function getStatistics(): Promise { // These models are only available on EE license so don't import them inside CE license as it will break the build async function getEEStatistics(): Promise { - if (!hasLicense('livechat-enterprise')) { + if (!License.hasModule('livechat-enterprise')) { return; } diff --git a/apps/meteor/ee/app/license/server/index.ts b/apps/meteor/ee/app/license/server/index.ts index f7d83ed388b8..403922524fa8 100644 --- a/apps/meteor/ee/app/license/server/index.ts +++ b/apps/meteor/ee/app/license/server/index.ts @@ -2,6 +2,4 @@ import './settings'; import './methods'; import './startup'; -export { onLicense, overwriteClassOnLicense, isEnterprise, getMaxGuestUsers } from './license'; - export { getStatistics } from './getStatistics'; diff --git a/apps/meteor/ee/app/license/server/lib/getAppCount.ts b/apps/meteor/ee/app/license/server/lib/getAppCount.ts new file mode 100644 index 000000000000..a05813f596bb --- /dev/null +++ b/apps/meteor/ee/app/license/server/lib/getAppCount.ts @@ -0,0 +1,21 @@ +import { Apps } from '@rocket.chat/core-services'; +import type { LicenseAppSources } from '@rocket.chat/license'; + +import { getInstallationSourceFromAppStorageItem } from '../../../../../lib/apps/getInstallationSourceFromAppStorageItem'; + +export async function getAppCount(source: LicenseAppSources): Promise { + if (!(await Apps.isInitialized())) { + return 0; + } + + const apps = await Apps.getApps({ enabled: true }); + + if (!apps || !Array.isArray(apps)) { + return 0; + } + + const storageItems = await Promise.all(apps.map((app) => Apps.getAppStorageItemById(app.id))); + const activeAppsFromSameSource = storageItems.filter((item) => item && getInstallationSourceFromAppStorageItem(item) === source); + + return activeAppsFromSameSource.length; +} diff --git a/apps/meteor/ee/app/license/server/lib/isUnderAppLimits.ts b/apps/meteor/ee/app/license/server/lib/isUnderAppLimits.ts deleted file mode 100644 index b53b6512e2a1..000000000000 --- a/apps/meteor/ee/app/license/server/lib/isUnderAppLimits.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Apps } from '@rocket.chat/core-services'; - -import { getInstallationSourceFromAppStorageItem } from '../../../../../lib/apps/getInstallationSourceFromAppStorageItem'; -import type { ILicense, LicenseAppSources } from '../../definition/ILicense'; - -export async function isUnderAppLimits(licenseAppsConfig: NonNullable, source: LicenseAppSources): Promise { - const apps = await Apps.getApps({ enabled: true }); - - if (!apps || !Array.isArray(apps)) { - return true; - } - - const storageItems = await Promise.all(apps.map((app) => Apps.getAppStorageItemById(app.id))); - const activeAppsFromSameSource = storageItems.filter((item) => item && getInstallationSourceFromAppStorageItem(item) === source); - - const configKey = `max${source.charAt(0).toUpperCase()}${source.slice(1)}Apps` as keyof typeof licenseAppsConfig; - const configLimit = licenseAppsConfig[configKey]; - - // If the workspace can install unlimited apps - // the config will be -1 - if (configLimit === -1) { - return true; - } - - return activeAppsFromSameSource.length < configLimit; -} diff --git a/apps/meteor/ee/app/license/server/license.internalService.ts b/apps/meteor/ee/app/license/server/license.internalService.ts index 047a67d323ff..9036a9b1848c 100644 --- a/apps/meteor/ee/app/license/server/license.internalService.ts +++ b/apps/meteor/ee/app/license/server/license.internalService.ts @@ -1,9 +1,9 @@ import type { ILicense } from '@rocket.chat/core-services'; import { api, ServiceClassInternal } from '@rocket.chat/core-services'; +import { License, type LicenseModule } from '@rocket.chat/license'; import { guestPermissions } from '../../authorization/lib/guestPermissions'; import { resetEnterprisePermissions } from '../../authorization/server/resetEnterprisePermissions'; -import { getModules, hasLicense, isEnterprise, onModule, onValidateLicenses } from './license'; export class LicenseService extends ServiceClassInternal implements ILicense { protected name = 'license'; @@ -11,8 +11,8 @@ export class LicenseService extends ServiceClassInternal implements ILicense { constructor() { super(); - onValidateLicenses((): void => { - if (!isEnterprise()) { + License.onValidateLicense((): void => { + if (!License.hasValidLicense()) { return; } @@ -20,13 +20,13 @@ export class LicenseService extends ServiceClassInternal implements ILicense { void resetEnterprisePermissions(); }); - onModule((licenseModule) => { + License.onModule((licenseModule) => { void api.broadcast('license.module', licenseModule); }); } async started(): Promise { - if (!isEnterprise()) { + if (!License.hasValidLicense()) { return; } @@ -34,16 +34,16 @@ export class LicenseService extends ServiceClassInternal implements ILicense { await resetEnterprisePermissions(); } - hasLicense(feature: string): boolean { - return hasLicense(feature); + hasModule(feature: LicenseModule): boolean { + return License.hasModule(feature); } - isEnterprise(): boolean { - return isEnterprise(); + hasValidLicense(): boolean { + return License.hasValidLicense(); } getModules(): string[] { - return getModules(); + return License.getModules(); } getGuestPermissions(): string[] { diff --git a/apps/meteor/ee/app/license/server/license.ts b/apps/meteor/ee/app/license/server/license.ts deleted file mode 100644 index fe0b22a0ee45..000000000000 --- a/apps/meteor/ee/app/license/server/license.ts +++ /dev/null @@ -1,467 +0,0 @@ -import { EventEmitter } from 'events'; - -import type { IAppStorageItem } from '@rocket.chat/apps-engine/server/storage'; -import { Apps } from '@rocket.chat/core-services'; -import { Users } from '@rocket.chat/models'; - -import { getInstallationSourceFromAppStorageItem } from '../../../../lib/apps/getInstallationSourceFromAppStorageItem'; -import type { ILicense } from '../definition/ILicense'; -import type { ILicenseTag } from '../definition/ILicenseTag'; -import type { BundleFeature } from './bundles'; -import { getBundleModules, isBundle, getBundleFromModule } from './bundles'; -import decrypt from './decrypt'; -import { getTagColor } from './getTagColor'; -import { isUnderAppLimits } from './lib/isUnderAppLimits'; - -const EnterpriseLicenses = new EventEmitter(); - -interface IValidLicense { - valid?: boolean; - license: ILicense; -} - -let maxGuestUsers = 0; -let maxRoomsPerGuest = 0; -let maxActiveUsers = 0; - -class LicenseClass { - private url: string | null = null; - - private licenses: IValidLicense[] = []; - - private encryptedLicenses = new Set(); - - private tags = new Set(); - - private modules = new Set(); - - private appsConfig: NonNullable = { - maxPrivateApps: 3, - maxMarketplaceApps: 5, - }; - - private _validateExpiration(expiration: string): boolean { - return new Date() > new Date(expiration); - } - - private _validateURL(licenseURL: string, url: string): boolean { - licenseURL = licenseURL - .replace(/\./g, '\\.') // convert dots to literal - .replace(/\*/g, '.*'); // convert * to .* - const regex = new RegExp(`^${licenseURL}$`, 'i'); - - return !!regex.exec(url); - } - - private _setAppsConfig(license: ILicense): void { - // If the license is valid, no limit is going to be applied to apps installation for now - // This guarantees that upgraded workspaces won't be affected by the new limit right away - // and gives us time to propagate the new limit schema to all licenses - const { maxPrivateApps = -1, maxMarketplaceApps = -1 } = license.apps || {}; - - if (maxPrivateApps === -1 || maxPrivateApps > this.appsConfig.maxPrivateApps) { - this.appsConfig.maxPrivateApps = maxPrivateApps; - } - - if (maxMarketplaceApps === -1 || maxMarketplaceApps > this.appsConfig.maxMarketplaceApps) { - this.appsConfig.maxMarketplaceApps = maxMarketplaceApps; - } - } - - private _validModules(licenseModules: string[]): void { - licenseModules.forEach((licenseModule) => { - const modules = isBundle(licenseModule) ? getBundleModules(licenseModule) : [licenseModule]; - - modules.forEach((module) => { - this.modules.add(module); - EnterpriseLicenses.emit('module', { module, valid: true }); - EnterpriseLicenses.emit(`valid:${module}`); - }); - }); - } - - private _invalidModules(licenseModules: string[]): void { - licenseModules.forEach((licenseModule) => { - const modules = isBundle(licenseModule) ? getBundleModules(licenseModule) : [licenseModule]; - - modules.forEach((module) => { - EnterpriseLicenses.emit('module', { module, valid: false }); - EnterpriseLicenses.emit(`invalid:${module}`); - }); - }); - } - - private _addTags(license: ILicense): void { - // if no tag present, it means it is an old license, so try check for bundles and use them as tags - if (typeof license.tag === 'undefined') { - license.modules - .filter(isBundle) - .map(getBundleFromModule) - .forEach((tag) => tag && this._addTag({ name: tag, color: getTagColor(tag) })); - return; - } - - this._addTag(license.tag); - } - - private _addTag(tag: ILicenseTag): void { - // make sure to not add duplicated tag names - for (const addedTag of this.tags) { - if (addedTag.name.toLowerCase() === tag.name.toLowerCase()) { - return; - } - } - - this.tags.add(tag); - } - - addLicense(license: ILicense): void { - this.licenses.push({ - valid: undefined, - license, - }); - - this.validate(); - } - - lockLicense(encryptedLicense: string): void { - this.encryptedLicenses.add(encryptedLicense); - } - - isLicenseDuplicate(encryptedLicense: string): boolean { - if (this.encryptedLicenses.has(encryptedLicense)) { - return true; - } - - return false; - } - - hasModule(module: string): boolean { - return this.modules.has(module); - } - - hasAnyValidLicense(): boolean { - return this.licenses.some((item) => item.valid); - } - - getLicenses(): IValidLicense[] { - return this.licenses; - } - - getModules(): string[] { - return [...this.modules]; - } - - getTags(): ILicenseTag[] { - return [...this.tags]; - } - - getAppsConfig(): NonNullable { - return this.appsConfig; - } - - setURL(url: string): void { - this.url = url.replace(/\/$/, '').replace(/^https?:\/\/(.*)$/, '$1'); - - this.validate(); - } - - validate(): void { - this.licenses = this.licenses.map((item) => { - const { license } = item; - - if (license.url) { - if (!this.url) { - return item; - } - if (!this._validateURL(license.url, this.url)) { - this.invalidate(item); - console.error(`#### License error: invalid url, licensed to ${license.url}, used on ${this.url}`); - this._invalidModules(license.modules); - return item; - } - } - - if (license.expiry && this._validateExpiration(license.expiry)) { - this.invalidate(item); - console.error(`#### License error: expired, valid until ${license.expiry}`); - this._invalidModules(license.modules); - return item; - } - - if (license.maxGuestUsers > maxGuestUsers) { - maxGuestUsers = license.maxGuestUsers; - } - - if (license.maxRoomsPerGuest > maxRoomsPerGuest) { - maxRoomsPerGuest = license.maxRoomsPerGuest; - } - - if (license.maxActiveUsers > maxActiveUsers) { - maxActiveUsers = license.maxActiveUsers; - } - - this._setAppsConfig(license); - - this._validModules(license.modules); - - this._addTags(license); - - console.log('#### License validated:', license.modules.join(', ')); - - item.valid = true; - return item; - }); - - EnterpriseLicenses.emit('validate'); - this.showLicenses(); - } - - invalidate(item: IValidLicense): void { - item.valid = false; - - EnterpriseLicenses.emit('invalidate'); - } - - async canAddNewUser(userCount = 1): Promise { - if (!maxActiveUsers) { - return true; - } - - return maxActiveUsers > (await Users.getActiveLocalUserCount()) + userCount; - } - - async canEnableApp(app: IAppStorageItem): Promise { - if (!(await Apps.isInitialized())) { - return false; - } - - // Migrated apps were installed before the validation was implemented - // so they're always allowed to be enabled - if (app.migrated) { - return true; - } - - return isUnderAppLimits(this.appsConfig, getInstallationSourceFromAppStorageItem(app)); - } - - showLicenses(): void { - if (!process.env.LICENSE_DEBUG || process.env.LICENSE_DEBUG === 'false') { - return; - } - - this.licenses - .filter((item) => item.valid) - .forEach((item) => { - const { license } = item; - - console.log('---- License enabled ----'); - console.log(' url ->', license.url); - console.log(' expiry ->', license.expiry); - console.log(' maxActiveUsers ->', license.maxActiveUsers); - console.log(' maxGuestUsers ->', license.maxGuestUsers); - console.log(' maxRoomsPerGuest ->', license.maxRoomsPerGuest); - console.log(' modules ->', license.modules.join(', ')); - console.log('-------------------------'); - }); - } -} - -const License = new LicenseClass(); - -export function addLicense(encryptedLicense: string): boolean { - if (!encryptedLicense || String(encryptedLicense).trim() === '' || License.isLicenseDuplicate(encryptedLicense)) { - return false; - } - - console.log('### New Enterprise License'); - - try { - const decrypted = decrypt(encryptedLicense); - if (!decrypted) { - return false; - } - - if (process.env.LICENSE_DEBUG && process.env.LICENSE_DEBUG !== 'false') { - console.log('##### Raw license ->', decrypted); - } - - License.addLicense(JSON.parse(decrypted)); - License.lockLicense(encryptedLicense); - - return true; - } catch (e) { - console.error('##### Invalid license'); - if (process.env.LICENSE_DEBUG && process.env.LICENSE_DEBUG !== 'false') { - console.error('##### Invalid raw license ->', encryptedLicense, e); - } - return false; - } -} - -export function validateFormat(encryptedLicense: string): boolean { - if (!encryptedLicense || String(encryptedLicense).trim() === '') { - return false; - } - - const decrypted = decrypt(encryptedLicense); - if (!decrypted) { - return false; - } - - return true; -} - -export function setURL(url: string): void { - License.setURL(url); -} - -export function hasLicense(feature: string): boolean { - return License.hasModule(feature); -} - -export function isEnterprise(): boolean { - return License.hasAnyValidLicense(); -} - -export function getMaxGuestUsers(): number { - return maxGuestUsers; -} - -export function getMaxRoomsPerGuest(): number { - return maxRoomsPerGuest; -} - -export function getMaxActiveUsers(): number { - return maxActiveUsers; -} - -export function getLicenses(): IValidLicense[] { - return License.getLicenses(); -} - -export function getModules(): string[] { - return License.getModules(); -} - -export function getTags(): ILicenseTag[] { - return License.getTags(); -} - -export function getAppsConfig(): NonNullable { - return License.getAppsConfig(); -} - -export async function canAddNewUser(userCount = 1): Promise { - return License.canAddNewUser(userCount); -} - -export async function canEnableApp(app: IAppStorageItem): Promise { - return License.canEnableApp(app); -} - -export function onLicense(feature: BundleFeature, cb: (...args: any[]) => void): void | Promise { - if (hasLicense(feature)) { - return cb(); - } - - EnterpriseLicenses.once(`valid:${feature}`, cb); -} - -function onValidFeature(feature: BundleFeature, cb: () => void): () => void { - EnterpriseLicenses.on(`valid:${feature}`, cb); - - if (hasLicense(feature)) { - cb(); - } - - return (): void => { - EnterpriseLicenses.off(`valid:${feature}`, cb); - }; -} - -function onInvalidFeature(feature: BundleFeature, cb: () => void): () => void { - EnterpriseLicenses.on(`invalid:${feature}`, cb); - - if (!hasLicense(feature)) { - cb(); - } - - return (): void => { - EnterpriseLicenses.off(`invalid:${feature}`, cb); - }; -} - -export function onToggledFeature( - feature: BundleFeature, - { - up, - down, - }: { - up?: () => Promise | void; - down?: () => Promise | void; - }, -): () => void { - let enabled = hasLicense(feature); - - const offValidFeature = onValidFeature(feature, () => { - if (!enabled) { - void up?.(); - enabled = true; - } - }); - - const offInvalidFeature = onInvalidFeature(feature, () => { - if (enabled) { - void down?.(); - enabled = false; - } - }); - - if (enabled) { - void up?.(); - } - - return (): void => { - offValidFeature(); - offInvalidFeature(); - }; -} - -export function onModule(cb: (...args: any[]) => void): void { - EnterpriseLicenses.on('module', cb); -} - -export function onValidateLicenses(cb: (...args: any[]) => void): void { - EnterpriseLicenses.on('validate', cb); -} - -export function onInvalidateLicense(cb: (...args: any[]) => void): void { - EnterpriseLicenses.on('invalidate', cb); -} - -export function flatModules(modulesAndBundles: string[]): string[] { - const bundles = modulesAndBundles.filter(isBundle); - const modules = modulesAndBundles.filter((x) => !isBundle(x)); - - const modulesFromBundles = bundles.map(getBundleModules).flat(); - - return modules.concat(modulesFromBundles); -} - -interface IOverrideClassProperties { - [key: string]: (...args: any[]) => any; -} - -type Class = { new (...args: any[]): any }; - -export async function overwriteClassOnLicense(license: BundleFeature, original: Class, overwrite: IOverrideClassProperties): Promise { - await onLicense(license, () => { - Object.entries(overwrite).forEach(([key, value]) => { - const originalFn = original.prototype[key]; - original.prototype[key] = function (...args: any[]): any { - return value.call(this, originalFn, ...args); - }; - }); - }); -} diff --git a/apps/meteor/ee/app/license/server/methods.ts b/apps/meteor/ee/app/license/server/methods.ts index 96978fad6d9a..39d14326a79a 100644 --- a/apps/meteor/ee/app/license/server/methods.ts +++ b/apps/meteor/ee/app/license/server/methods.ts @@ -1,10 +1,8 @@ +import { License, type ILicenseTag, type LicenseModule } from '@rocket.chat/license'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; -import type { ILicenseTag } from '../definition/ILicenseTag'; -import { getModules, getTags, hasLicense, isEnterprise } from './license'; - declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention interface ServerMethods { @@ -19,15 +17,15 @@ Meteor.methods({ 'license:hasLicense'(feature: string) { check(feature, String); - return hasLicense(feature); + return License.hasModule(feature as LicenseModule); }, 'license:getModules'() { - return getModules(); + return License.getModules(); }, 'license:getTags'() { - return getTags(); + return License.getTags(); }, 'license:isEnterprise'() { - return isEnterprise(); + return License.hasValidLicense(); }, }); diff --git a/apps/meteor/ee/app/license/server/settings.ts b/apps/meteor/ee/app/license/server/settings.ts index a5a07ba0200f..1bec7126ae85 100644 --- a/apps/meteor/ee/app/license/server/settings.ts +++ b/apps/meteor/ee/app/license/server/settings.ts @@ -1,8 +1,8 @@ +import { License } from '@rocket.chat/license'; import { Settings } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; import { settings, settingsRegistry } from '../../../../app/settings/server'; -import { addLicense } from './license'; Meteor.startup(async () => { await settingsRegistry.addGroup('Enterprise', async function () { @@ -29,16 +29,24 @@ settings.watch('Enterprise_License', async (license) => { return; } - if (!addLicense(license)) { - await Settings.updateValueById('Enterprise_License_Status', 'Invalid'); - return; + try { + if (!(await License.setLicense(license))) { + await Settings.updateValueById('Enterprise_License_Status', 'Invalid'); + return; + } + } catch (_error) { + // do nothing } await Settings.updateValueById('Enterprise_License_Status', 'Valid'); }); if (process.env.ROCKETCHAT_LICENSE) { - addLicense(process.env.ROCKETCHAT_LICENSE); + try { + await License.setLicense(process.env.ROCKETCHAT_LICENSE); + } catch (_error) { + // do nothing + } Meteor.startup(async () => { if (settings.get('Enterprise_License')) { diff --git a/apps/meteor/ee/app/license/server/startup.ts b/apps/meteor/ee/app/license/server/startup.ts index 4a7a0776fc0d..d3523282d1e8 100644 --- a/apps/meteor/ee/app/license/server/startup.ts +++ b/apps/meteor/ee/app/license/server/startup.ts @@ -1,13 +1,28 @@ +import { License } from '@rocket.chat/license'; +import { Subscriptions, Users } from '@rocket.chat/models'; + import { settings } from '../../../../app/settings/server'; import { callbacks } from '../../../../lib/callbacks'; -import { addLicense, setURL } from './license'; +import { getAppCount } from './lib/getAppCount'; settings.watch('Site_Url', (value) => { if (value) { - setURL(value); + void License.setWorkspaceUrl(value); } }); -callbacks.add('workspaceLicenseChanged', (updatedLicense) => { - addLicense(updatedLicense); +callbacks.add('workspaceLicenseChanged', async (updatedLicense) => { + try { + await License.setLicense(updatedLicense); + } catch (_error) { + // Ignore + } }); + +License.setLicenseLimitCounter('activeUsers', () => Users.getActiveLocalUserCount()); +License.setLicenseLimitCounter('guestUsers', () => Users.getActiveLocalGuestCount()); +License.setLicenseLimitCounter('roomsPerGuest', async (context) => (context?.userId ? Subscriptions.countByUserId(context.userId) : 0)); +License.setLicenseLimitCounter('privateApps', () => getAppCount('private')); +License.setLicenseLimitCounter('marketplaceApps', () => getAppCount('marketplace')); +// #TODO: Get real value +License.setLicenseLimitCounter('monthlyActiveContacts', async () => 0); diff --git a/apps/meteor/ee/app/livechat-enterprise/server/business-hour/Helper.ts b/apps/meteor/ee/app/livechat-enterprise/server/business-hour/Helper.ts index 5839b717349d..a441e122ef99 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/business-hour/Helper.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/business-hour/Helper.ts @@ -1,10 +1,10 @@ import type { ILivechatBusinessHour } from '@rocket.chat/core-typings'; import { LivechatBusinessHourTypes } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; import { LivechatBusinessHours, LivechatDepartment, LivechatDepartmentAgents, Users } from '@rocket.chat/models'; import moment from 'moment-timezone'; import { businessHourLogger } from '../../../../../app/livechat/server/lib/logger'; -import { isEnterprise } from '../../../license/server/license'; const getAllAgentIdsWithoutDepartment = async (): Promise => { // Fetch departments with agents excluding archived ones (disabled ones still can be tied to business hours) @@ -105,7 +105,7 @@ export const removeBusinessHourByAgentIds = async (agentIds: string[], businessH }; export const resetDefaultBusinessHourIfNeeded = async (): Promise => { - if (isEnterprise()) { + if (License.hasValidLicense()) { return; } diff --git a/apps/meteor/ee/app/livechat-enterprise/server/index.ts b/apps/meteor/ee/app/livechat-enterprise/server/index.ts index 13ebdd6a3521..13676e7cbedb 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/index.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/index.ts @@ -1,3 +1,4 @@ +import { License } from '@rocket.chat/license'; import { Meteor } from 'meteor/meteor'; import './methods/addMonitor'; @@ -25,11 +26,10 @@ import './hooks/onTransferFailure'; import './lib/routing/LoadBalancing'; import './lib/routing/LoadRotation'; import './lib/AutoCloseOnHoldScheduler'; -import { onLicense } from '../../license/server'; import './business-hour'; import { createDefaultPriorities } from './priorities'; -await onLicense('livechat-enterprise', async () => { +await License.onLicense('livechat-enterprise', async () => { require('./api'); require('./hooks'); await import('./startup'); diff --git a/apps/meteor/ee/app/livechat-enterprise/server/lib/LivechatEnterprise.ts b/apps/meteor/ee/app/livechat-enterprise/server/lib/LivechatEnterprise.ts index 83a2963a54d8..ec228e420abd 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/lib/LivechatEnterprise.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/lib/LivechatEnterprise.ts @@ -1,4 +1,5 @@ import type { IOmnichannelBusinessUnit, IOmnichannelServiceLevelAgreements, LivechatDepartmentDTO } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; import { Users, LivechatDepartment as LivechatDepartmentRaw, @@ -14,7 +15,6 @@ import { updateDepartmentAgents } from '../../../../../app/livechat/server/lib/H import { callbacks } from '../../../../../lib/callbacks'; import { addUserRolesAsync } from '../../../../../server/lib/roles/addUserRoles'; import { removeUserFromRolesAsync } from '../../../../../server/lib/roles/removeUserFromRoles'; -import { hasLicense } from '../../../license/server/license'; import { updateSLAInquiries } from './Helper'; import { removeSLAFromRooms } from './SlaHelper'; @@ -195,7 +195,7 @@ export const LivechatEnterprise = { const department = _id ? await LivechatDepartmentRaw.findOneById(_id, { projection: { _id: 1, archived: 1, enabled: 1 } }) : null; - if (!hasLicense('livechat-enterprise')) { + if (!License.hasModule('livechat-enterprise')) { const totalDepartments = await LivechatDepartmentRaw.countTotal(); if (!department && totalDepartments >= 1) { throw new Meteor.Error('error-max-departments-number-reached', 'Maximum number of departments reached', { @@ -279,6 +279,6 @@ export const LivechatEnterprise = { }, async isDepartmentCreationAvailable() { - return hasLicense('livechat-enterprise') || (await LivechatDepartmentRaw.countTotal()) === 0; + return License.hasModule('livechat-enterprise') || (await LivechatDepartmentRaw.countTotal()) === 0; }, }; diff --git a/apps/meteor/ee/app/message-read-receipt/server/index.ts b/apps/meteor/ee/app/message-read-receipt/server/index.ts index a7682e4165f0..bb405c0eaffd 100644 --- a/apps/meteor/ee/app/message-read-receipt/server/index.ts +++ b/apps/meteor/ee/app/message-read-receipt/server/index.ts @@ -1,5 +1,5 @@ -import { onLicense } from '../../license/server'; +import { License } from '@rocket.chat/license'; -await onLicense('message-read-receipt', async () => { +await License.onLicense('message-read-receipt', async () => { await import('./hooks'); }); diff --git a/apps/meteor/ee/app/settings/server/settings.ts b/apps/meteor/ee/app/settings/server/settings.ts index afb5a4378ec8..76ce7c15155a 100644 --- a/apps/meteor/ee/app/settings/server/settings.ts +++ b/apps/meteor/ee/app/settings/server/settings.ts @@ -1,17 +1,17 @@ import type { ISetting, SettingValue } from '@rocket.chat/core-typings'; +import { License, type LicenseModule } from '@rocket.chat/license'; import { Settings } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; import { settings, SettingsEvents } from '../../../../app/settings/server'; import { use } from '../../../../app/settings/server/Middleware'; -import { isEnterprise, hasLicense, onValidateLicenses } from '../../license/server/license'; export function changeSettingValue(record: ISetting): SettingValue { if (!record.enterprise) { return record.value; } - if (!isEnterprise()) { + if (!License.hasValidLicense()) { return record.invalidValue; } @@ -20,7 +20,7 @@ export function changeSettingValue(record: ISetting): SettingValue { } for (const moduleName of record.modules) { - if (!hasLicense(moduleName)) { + if (!License.hasModule(moduleName as LicenseModule)) { return record.invalidValue; } } @@ -58,5 +58,5 @@ async function updateSettings(): Promise { Meteor.startup(async () => { await updateSettings(); - onValidateLicenses(updateSettings); + License.onValidateLicense(updateSettings); }); diff --git a/apps/meteor/ee/app/voip-enterprise/server/services/voipService.ts b/apps/meteor/ee/app/voip-enterprise/server/services/voipService.ts index a28e459e57fb..f5524ee026dc 100644 --- a/apps/meteor/ee/app/voip-enterprise/server/services/voipService.ts +++ b/apps/meteor/ee/app/voip-enterprise/server/services/voipService.ts @@ -1,11 +1,11 @@ import type { ILivechatAgent, ILivechatVisitor, IVoipRoomClosingInfo, IUser, IVoipRoom } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; import type { IOmniRoomClosingMessage } from '../../../../../server/services/omnichannel-voip/internalTypes'; import { OmnichannelVoipService } from '../../../../../server/services/omnichannel-voip/service'; -import { overwriteClassOnLicense } from '../../../license/server'; import { calculateOnHoldTimeForRoom } from '../lib/calculateOnHoldTimeForRoom'; -await overwriteClassOnLicense('voip-enterprise', OmnichannelVoipService, { +await License.overwriteClassOnLicense('voip-enterprise', OmnichannelVoipService, { async getRoomClosingData( _originalFn: ( closer: ILivechatVisitor | ILivechatAgent, diff --git a/apps/meteor/ee/client/hooks/useHasLicenseModule.ts b/apps/meteor/ee/client/hooks/useHasLicenseModule.ts index a1492d39a013..c7d76b093c3b 100644 --- a/apps/meteor/ee/client/hooks/useHasLicenseModule.ts +++ b/apps/meteor/ee/client/hooks/useHasLicenseModule.ts @@ -1,9 +1,8 @@ +import type { LicenseModule } from '@rocket.chat/license'; import { useMethod, useUserId } from '@rocket.chat/ui-contexts'; import { useQuery } from '@tanstack/react-query'; -import type { BundleFeature } from '../../app/license/server/bundles'; - -export const useHasLicenseModule = (licenseName: BundleFeature): 'loading' | boolean => { +export const useHasLicenseModule = (licenseName: LicenseModule): 'loading' | boolean => { const method = useMethod('license:getModules'); const uid = useUserId(); diff --git a/apps/meteor/ee/client/lib/onToggledFeature.ts b/apps/meteor/ee/client/lib/onToggledFeature.ts index 86ab08723745..ae2e4ad9f4a8 100644 --- a/apps/meteor/ee/client/lib/onToggledFeature.ts +++ b/apps/meteor/ee/client/lib/onToggledFeature.ts @@ -1,11 +1,11 @@ +import type { LicenseModule } from '@rocket.chat/license'; import { QueryObserver } from '@tanstack/react-query'; import { queryClient } from '../../../client/lib/queryClient'; -import type { BundleFeature } from '../../app/license/server/bundles'; import { fetchFeatures } from './fetchFeatures'; export const onToggledFeature = ( - feature: BundleFeature, + feature: LicenseModule, { up, down, diff --git a/apps/meteor/ee/client/views/admin/users/useSeatsCap.ts b/apps/meteor/ee/client/views/admin/users/useSeatsCap.ts index eb029d91f537..b4a45b49dda5 100644 --- a/apps/meteor/ee/client/views/admin/users/useSeatsCap.ts +++ b/apps/meteor/ee/client/views/admin/users/useSeatsCap.ts @@ -8,6 +8,7 @@ export type SeatCapProps = { }; export const useSeatsCap = (): SeatCapProps | undefined => { + // #TODO: Stop using this endpoint const fetch = useEndpoint('GET', '/v1/licenses.maxActiveUsers'); const result = useQuery(['/v1/licenses.maxActiveUsers'], () => fetch()); diff --git a/apps/meteor/ee/server/api/api.ts b/apps/meteor/ee/server/api/api.ts index f152a94ebcbf..ee2049bb70ae 100644 --- a/apps/meteor/ee/server/api/api.ts +++ b/apps/meteor/ee/server/api/api.ts @@ -1,7 +1,8 @@ +import { License } from '@rocket.chat/license'; + import { API } from '../../../app/api/server/api'; import type { NonEnterpriseTwoFactorOptions, Options } from '../../../app/api/server/definition'; import { use } from '../../../app/settings/server/Middleware'; -import { isEnterprise } from '../../app/license/server/license'; // Overwrites two factor method to enforce 2FA check for enterprise APIs when // no license was provided to prevent abuse on enterprise APIs. @@ -10,7 +11,7 @@ const isNonEnterpriseTwoFactorOptions = (options?: Options): options is NonEnter !!options && 'forceTwoFactorAuthenticationForNonEnterprise' in options && Boolean(options.forceTwoFactorAuthenticationForNonEnterprise); API.v1.processTwoFactor = use(API.v1.processTwoFactor, ([params, ...context], next) => { - if (isNonEnterpriseTwoFactorOptions(params.options) && !isEnterprise()) { + if (isNonEnterpriseTwoFactorOptions(params.options) && !License.hasValidLicense()) { const options: NonEnterpriseTwoFactorOptions = { ...params.options, twoFactorOptions: { diff --git a/apps/meteor/ee/server/api/chat.ts b/apps/meteor/ee/server/api/chat.ts index 5d21b20f2038..2c8f8c5ca605 100644 --- a/apps/meteor/ee/server/api/chat.ts +++ b/apps/meteor/ee/server/api/chat.ts @@ -1,8 +1,8 @@ import type { IMessage, ReadReceipt } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; import { Meteor } from 'meteor/meteor'; import { API } from '../../../app/api/server/api'; -import { hasLicense } from '../../app/license/server/license'; type GetMessageReadReceiptsProps = { messageId: IMessage['_id']; @@ -24,7 +24,7 @@ API.v1.addRoute( { authRequired: true }, { async get() { - if (!hasLicense('message-read-receipt')) { + if (!License.hasModule('message-read-receipt')) { throw new Meteor.Error('error-action-not-allowed', 'This is an enterprise feature'); } diff --git a/apps/meteor/ee/server/api/licenses.ts b/apps/meteor/ee/server/api/licenses.ts index ab8d72164a97..cfd657a1f0e9 100644 --- a/apps/meteor/ee/server/api/licenses.ts +++ b/apps/meteor/ee/server/api/licenses.ts @@ -1,17 +1,9 @@ +import { License } from '@rocket.chat/license'; import { Settings, Users } from '@rocket.chat/models'; import { check } from 'meteor/check'; import { API } from '../../../app/api/server/api'; import { hasPermissionAsync } from '../../../app/authorization/server/functions/hasPermission'; -import type { ILicense } from '../../app/license/definition/ILicense'; -import { getLicenses, validateFormat, flatModules, getMaxActiveUsers, isEnterprise } from '../../app/license/server/license'; - -function licenseTransform(license: ILicense): ILicense { - return { - ...license, - modules: flatModules(license.modules), - }; -} API.v1.addRoute( 'licenses.get', @@ -22,9 +14,8 @@ API.v1.addRoute( return API.v1.unauthorized(); } - const licenses = getLicenses() - .filter(({ valid }) => valid) - .map(({ license }) => licenseTransform(license)); + const license = License.getUnmodifiedLicenseAndModules(); + const licenses = license ? [license] : []; return API.v1.success({ licenses }); }, @@ -45,7 +36,7 @@ API.v1.addRoute( } const { license } = this.bodyParams; - if (!validateFormat(license)) { + if (!(await License.validateFormat(license))) { return API.v1.failure('Invalid license'); } @@ -61,7 +52,7 @@ API.v1.addRoute( { authRequired: true }, { async get() { - const maxActiveUsers = getMaxActiveUsers() || null; + const maxActiveUsers = License.getMaxActiveUsers() || null; const activeUsers = await Users.getActiveLocalUserCount(); return API.v1.success({ maxActiveUsers, activeUsers }); @@ -74,7 +65,7 @@ API.v1.addRoute( { authOrAnonRequired: true }, { get() { - const isEnterpriseEdtion = isEnterprise(); + const isEnterpriseEdtion = License.hasValidLicense(); return API.v1.success({ isEnterprise: isEnterpriseEdtion }); }, }, diff --git a/apps/meteor/ee/server/api/roles.ts b/apps/meteor/ee/server/api/roles.ts index 712e7583b709..c10c32c3ee1a 100644 --- a/apps/meteor/ee/server/api/roles.ts +++ b/apps/meteor/ee/server/api/roles.ts @@ -1,11 +1,11 @@ import type { IRole } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; import { Roles } from '@rocket.chat/models'; import Ajv from 'ajv'; import { API } from '../../../app/api/server/api'; import { hasPermissionAsync } from '../../../app/authorization/server/functions/hasPermission'; import { settings } from '../../../app/settings/server/index'; -import { isEnterprise } from '../../app/license/server'; import { insertRoleAsync } from '../lib/roles/insertRole'; import { updateRole } from '../lib/roles/updateRole'; @@ -96,7 +96,7 @@ API.v1.addRoute( { authRequired: true }, { async post() { - if (!isEnterprise()) { + if (!License.hasValidLicense()) { throw new Meteor.Error('error-action-not-allowed', 'This is an enterprise feature'); } @@ -154,7 +154,7 @@ API.v1.addRoute( const role = await Roles.findOne(roleId); - if (!isEnterprise() && !role?.protected) { + if (!License.hasValidLicense() && !role?.protected) { throw new Meteor.Error('error-action-not-allowed', 'This is an enterprise feature'); } diff --git a/apps/meteor/ee/server/api/sessions.ts b/apps/meteor/ee/server/api/sessions.ts index 41c30aba401b..cdd454fd5bee 100644 --- a/apps/meteor/ee/server/api/sessions.ts +++ b/apps/meteor/ee/server/api/sessions.ts @@ -1,4 +1,5 @@ import type { IUser, ISession, DeviceManagementSession, DeviceManagementPopulatedSession } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; import { Users, Sessions } from '@rocket.chat/models'; import type { PaginatedResult, PaginatedRequest } from '@rocket.chat/rest-typings'; import { escapeRegExp } from '@rocket.chat/string-helpers'; @@ -7,7 +8,6 @@ import Ajv from 'ajv'; import { API } from '../../../app/api/server/api'; import { getPaginationItems } from '../../../app/api/server/helpers/getPaginationItems'; import { Notifications } from '../../../app/notifications/server'; -import { hasLicense } from '../../app/license/server/license'; const ajv = new Ajv({ coerceTypes: true }); @@ -85,7 +85,7 @@ API.v1.addRoute( { authRequired: true, validateParams: isSessionsPaginateProps }, { async get() { - if (!hasLicense('device-management')) { + if (!License.hasModule('device-management')) { return API.v1.unauthorized(); } @@ -108,7 +108,7 @@ API.v1.addRoute( { authRequired: true, validateParams: isSessionsProps }, { async get() { - if (!hasLicense('device-management')) { + if (!License.hasModule('device-management')) { return API.v1.unauthorized(); } @@ -127,7 +127,7 @@ API.v1.addRoute( { authRequired: true, validateParams: isSessionsProps }, { async post() { - if (!hasLicense('device-management')) { + if (!License.hasModule('device-management')) { return API.v1.unauthorized(); } @@ -153,7 +153,7 @@ API.v1.addRoute( { authRequired: true, twoFactorRequired: true, validateParams: isSessionsPaginateProps, permissionsRequired: ['view-device-management'] }, { async get() { - if (!hasLicense('device-management')) { + if (!License.hasModule('device-management')) { return API.v1.unauthorized(); } @@ -193,7 +193,7 @@ API.v1.addRoute( { authRequired: true, twoFactorRequired: true, validateParams: isSessionsProps, permissionsRequired: ['view-device-management'] }, { async get() { - if (!hasLicense('device-management')) { + if (!License.hasModule('device-management')) { return API.v1.unauthorized(); } @@ -212,7 +212,7 @@ API.v1.addRoute( { authRequired: true, twoFactorRequired: true, validateParams: isSessionsProps, permissionsRequired: ['logout-device-management'] }, { async post() { - if (!hasLicense('device-management')) { + if (!License.hasModule('device-management')) { return API.v1.unauthorized(); } diff --git a/apps/meteor/ee/server/apps/communication/endpoints/appsCountHandler.ts b/apps/meteor/ee/server/apps/communication/endpoints/appsCountHandler.ts index 96247e704545..fc436b8229cf 100644 --- a/apps/meteor/ee/server/apps/communication/endpoints/appsCountHandler.ts +++ b/apps/meteor/ee/server/apps/communication/endpoints/appsCountHandler.ts @@ -1,9 +1,9 @@ import type { AppManager } from '@rocket.chat/apps-engine/server/AppManager'; +import { License } from '@rocket.chat/license'; import { API } from '../../../../../app/api/server'; import type { SuccessResult } from '../../../../../app/api/server/definition'; import { getInstallationSourceFromAppStorageItem } from '../../../../../lib/apps/getInstallationSourceFromAppStorageItem'; -import { getAppsConfig } from '../../../../app/license/server/license'; import type { AppsRestApi } from '../rest'; type AppsCountResult = { @@ -23,7 +23,7 @@ export const appsCountHandler = (apiManager: AppsRestApi) => const manager = apiManager._manager as AppManager; const apps = manager.get({ enabled: true }); - const { maxMarketplaceApps, maxPrivateApps } = getAppsConfig(); + const { maxMarketplaceApps, maxPrivateApps } = License.getAppsConfig(); return API.v1.success({ totalMarketplaceEnabled: apps.filter((app) => getInstallationSourceFromAppStorageItem(app.getStorageItem()) === 'marketplace') diff --git a/apps/meteor/ee/server/apps/communication/rest.ts b/apps/meteor/ee/server/apps/communication/rest.ts index 1203d0d8c911..f356f3e45a18 100644 --- a/apps/meteor/ee/server/apps/communication/rest.ts +++ b/apps/meteor/ee/server/apps/communication/rest.ts @@ -3,6 +3,7 @@ import type { IAppInfo } from '@rocket.chat/apps-engine/definition/metadata'; import type { AppManager } from '@rocket.chat/apps-engine/server/AppManager'; import { AppInstallationSource } from '@rocket.chat/apps-engine/server/storage'; import type { IUser, IMessage } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; import { Settings, Users } from '@rocket.chat/models'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; import { Meteor } from 'meteor/meteor'; @@ -17,7 +18,7 @@ import { settings } from '../../../../app/settings/server'; import { Info } from '../../../../app/utils/rocketchat.info'; import { i18n } from '../../../../server/lib/i18n'; import { sendMessagesToAdmins } from '../../../../server/lib/sendMessagesToAdmins'; -import { canEnableApp, isEnterprise } from '../../../app/license/server/license'; +import { canEnableApp } from '../../../app/license/server/canEnableApp'; import { formatAppInstanceForRest } from '../../../lib/misc/formatAppInstanceForRest'; import { appEnableCheck } from '../marketplace/appEnableCheck'; import { notifyAppInstall } from '../marketplace/appInstall'; @@ -1149,7 +1150,7 @@ export class AppsRestApi { const storedApp = prl.getStorageItem(); const { installationSource, marketplaceInfo } = storedApp; - if (!isEnterprise() && installationSource === AppInstallationSource.MARKETPLACE) { + if (!License.hasValidLicense() && installationSource === AppInstallationSource.MARKETPLACE) { try { const baseUrl = orchestrator.getMarketplaceUrl() as string; const headers = getDefaultHeaders(); diff --git a/apps/meteor/ee/server/apps/orchestrator.js b/apps/meteor/ee/server/apps/orchestrator.js index c21508cbc626..9e4d6f00e7f0 100644 --- a/apps/meteor/ee/server/apps/orchestrator.js +++ b/apps/meteor/ee/server/apps/orchestrator.js @@ -19,7 +19,7 @@ import { } from '../../../app/apps/server/converters'; import { AppThreadsConverter } from '../../../app/apps/server/converters/threads'; import { settings, settingsRegistry } from '../../../app/settings/server'; -import { canEnableApp } from '../../app/license/server/license'; +import { canEnableApp } from '../../app/license/server/canEnableApp'; import { AppServerNotifier, AppsRestApi, AppUIKitInteractionApi } from './communication'; import { AppRealLogsStorage, AppRealStorage, ConfigurableAppSourceStorage } from './storage'; diff --git a/apps/meteor/ee/server/configuration/ldap.ts b/apps/meteor/ee/server/configuration/ldap.ts index 40815e213b0c..5f1a84557d70 100644 --- a/apps/meteor/ee/server/configuration/ldap.ts +++ b/apps/meteor/ee/server/configuration/ldap.ts @@ -1,18 +1,18 @@ import type { IImportUser, ILDAPEntry, IUser } from '@rocket.chat/core-typings'; import { cronJobs } from '@rocket.chat/cron'; +import { License } from '@rocket.chat/license'; import { Meteor } from 'meteor/meteor'; import { settings } from '../../../app/settings/server'; import { callbacks } from '../../../lib/callbacks'; import type { LDAPConnection } from '../../../server/lib/ldap/Connection'; import { logger } from '../../../server/lib/ldap/Logger'; -import { onLicense } from '../../app/license/server'; import { LDAPEEManager } from '../lib/ldap/Manager'; import { LDAPEE } from '../sdk'; import { addSettings, ldapIntervalValuesToCronMap } from '../settings/ldap'; Meteor.startup(async () => { - await onLicense('ldap-enterprise', async () => { + await License.onLicense('ldap-enterprise', async () => { await addSettings(); // Configure background sync cronjob diff --git a/apps/meteor/ee/server/configuration/oauth.ts b/apps/meteor/ee/server/configuration/oauth.ts index 984670af6003..aa66a46caf69 100644 --- a/apps/meteor/ee/server/configuration/oauth.ts +++ b/apps/meteor/ee/server/configuration/oauth.ts @@ -1,11 +1,11 @@ import type { IUser } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; import { Logger } from '@rocket.chat/logger'; import { Roles } from '@rocket.chat/models'; import { capitalize } from '@rocket.chat/string-helpers'; import { settings } from '../../../app/settings/server'; import { callbacks } from '../../../lib/callbacks'; -import { onLicense } from '../../app/license/server'; import { OAuthEEManager } from '../lib/oauth/Manager'; interface IOAuthUserService { @@ -54,7 +54,7 @@ function getChannelsMap(channelsMap: string): Record | undefined { } } -await onLicense('oauth-enterprise', () => { +await License.onLicense('oauth-enterprise', () => { callbacks.add('afterProcessOAuthUser', async (auth: IOAuthUserService) => { auth.serviceName = capitalize(auth.serviceName); const settings = getOAuthSettings(auth.serviceName); diff --git a/apps/meteor/ee/server/configuration/outlookCalendar.ts b/apps/meteor/ee/server/configuration/outlookCalendar.ts index cf36ddeb0cab..67c8d7945030 100644 --- a/apps/meteor/ee/server/configuration/outlookCalendar.ts +++ b/apps/meteor/ee/server/configuration/outlookCalendar.ts @@ -1,11 +1,11 @@ import { Calendar } from '@rocket.chat/core-services'; +import { License } from '@rocket.chat/license'; import { Meteor } from 'meteor/meteor'; -import { onLicense } from '../../app/license/server'; import { addSettings } from '../settings/outlookCalendar'; Meteor.startup(() => - onLicense('outlook-calendar', async () => { + License.onLicense('outlook-calendar', async () => { addSettings(); await Calendar.setupNextNotification(); diff --git a/apps/meteor/ee/server/configuration/saml.ts b/apps/meteor/ee/server/configuration/saml.ts index 1e50fc7160b5..96dca07829c6 100644 --- a/apps/meteor/ee/server/configuration/saml.ts +++ b/apps/meteor/ee/server/configuration/saml.ts @@ -1,13 +1,13 @@ +import { License } from '@rocket.chat/license'; import { Roles, Users } from '@rocket.chat/models'; import type { ISAMLUser } from '../../../app/meteor-accounts-saml/server/definition/ISAMLUser'; import { SAMLUtils } from '../../../app/meteor-accounts-saml/server/lib/Utils'; import { settings } from '../../../app/settings/server'; import { ensureArray } from '../../../lib/utils/arrayUtils'; -import { onLicense } from '../../app/license/server'; import { addSettings } from '../settings/saml'; -await onLicense('saml-enterprise', () => { +await License.onLicense('saml-enterprise', () => { SAMLUtils.events.on('mapUser', async ({ profile, userObject }: { profile: Record; userObject: ISAMLUser }) => { const roleAttributeName = settings.get('SAML_Custom_Default_role_attribute_name') as string; const roleAttributeSync = settings.get('SAML_Custom_Default_role_attribute_sync'); @@ -67,4 +67,4 @@ await onLicense('saml-enterprise', () => { }); // For setting creation we add the listener first because the event is emmited during startup -SAMLUtils.events.on('addSettings', (name: string): void | Promise => onLicense('saml-enterprise', () => addSettings(name))); +SAMLUtils.events.on('addSettings', (name: string): void | Promise => License.onLicense('saml-enterprise', () => addSettings(name))); diff --git a/apps/meteor/ee/server/configuration/videoConference.ts b/apps/meteor/ee/server/configuration/videoConference.ts index a9debed01b19..035110904840 100644 --- a/apps/meteor/ee/server/configuration/videoConference.ts +++ b/apps/meteor/ee/server/configuration/videoConference.ts @@ -1,16 +1,16 @@ import { VideoConf } from '@rocket.chat/core-services'; import type { IRoom, IUser, VideoConference } from '@rocket.chat/core-typings'; import { VideoConferenceStatus } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; import { Rooms, Subscriptions } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../lib/callbacks'; import { videoConfTypes } from '../../../server/lib/videoConfTypes'; -import { onLicense } from '../../app/license/server'; import { addSettings } from '../settings/video-conference'; Meteor.startup(async () => { - await onLicense('videoconference-enterprise', async () => { + await License.onLicense('videoconference-enterprise', async () => { await addSettings(); videoConfTypes.registerVideoConferenceType( diff --git a/apps/meteor/ee/server/lib/EnterpriseCheck.ts b/apps/meteor/ee/server/lib/EnterpriseCheck.ts index 8bccfed59071..ca8cd1e25b10 100644 --- a/apps/meteor/ee/server/lib/EnterpriseCheck.ts +++ b/apps/meteor/ee/server/lib/EnterpriseCheck.ts @@ -41,7 +41,7 @@ export const EnterpriseCheck: ServiceSchema = { async started(): Promise { setInterval(async () => { try { - const hasLicense = await this.broker.call('license.hasLicense', ['scalability']); + const hasLicense = await this.broker.call('license.hasValidLicense', ['scalability']); if (hasLicense) { checkFails = 0; return; diff --git a/apps/meteor/ee/server/lib/syncUserRoles.ts b/apps/meteor/ee/server/lib/syncUserRoles.ts index e38f9de3c310..f3a380a8f228 100644 --- a/apps/meteor/ee/server/lib/syncUserRoles.ts +++ b/apps/meteor/ee/server/lib/syncUserRoles.ts @@ -1,11 +1,11 @@ import { api } from '@rocket.chat/core-services'; import type { IUser, IRole, AtLeast } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; import { Users } from '@rocket.chat/models'; import { settings } from '../../../app/settings/server'; import { addUserRolesAsync } from '../../../server/lib/roles/addUserRoles'; import { removeUserFromRolesAsync } from '../../../server/lib/roles/removeUserFromRoles'; -import { canAddNewUser } from '../../app/license/server/license'; type setUserRolesOptions = { // If specified, the function will not add nor remove any role that is not on this list. @@ -72,7 +72,7 @@ export async function syncUserRoles( } const wasGuest = existingRoles.length === 1 && existingRoles[0] === 'guest'; - if (wasGuest && !(await canAddNewUser())) { + if (wasGuest && (await License.shouldPreventAction('activeUsers'))) { throw new Error('error-license-user-limit-reached'); } diff --git a/apps/meteor/ee/server/local-services/instance/service.ts b/apps/meteor/ee/server/local-services/instance/service.ts index 85c021f74769..5bb755ee347f 100644 --- a/apps/meteor/ee/server/local-services/instance/service.ts +++ b/apps/meteor/ee/server/local-services/instance/service.ts @@ -143,7 +143,7 @@ export class InstanceService extends ServiceClassInternal implements IInstanceSe await InstanceStatus.registerInstance('rocket.chat', instance); - const hasLicense = await License.hasLicense('scalability'); + const hasLicense = await License.hasModule('scalability'); if (!hasLicense) { return; } diff --git a/apps/meteor/ee/server/methods/getReadReceipts.ts b/apps/meteor/ee/server/methods/getReadReceipts.ts index a30eec300c41..78fe8a4d967e 100644 --- a/apps/meteor/ee/server/methods/getReadReceipts.ts +++ b/apps/meteor/ee/server/methods/getReadReceipts.ts @@ -1,11 +1,11 @@ import type { ReadReceipt as ReadReceiptType, IMessage } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; import { Messages } from '@rocket.chat/models'; import type { ServerMethods } from '@rocket.chat/ui-contexts'; import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { canAccessRoomIdAsync } from '../../../app/authorization/server/functions/canAccessRoom'; -import { hasLicense } from '../../app/license/server/license'; import { ReadReceipt } from '../lib/message-read-receipt/ReadReceipt'; declare module '@rocket.chat/ui-contexts' { @@ -17,7 +17,7 @@ declare module '@rocket.chat/ui-contexts' { Meteor.methods({ async getReadReceipts({ messageId }) { - if (!hasLicense('message-read-receipt')) { + if (!License.hasModule('message-read-receipt')) { throw new Meteor.Error('error-action-not-allowed', 'This is an enterprise feature', { method: 'getReadReceipts' }); } diff --git a/apps/meteor/ee/server/models/startup.ts b/apps/meteor/ee/server/models/startup.ts index 580f4c025e07..4fd8433358ca 100644 --- a/apps/meteor/ee/server/models/startup.ts +++ b/apps/meteor/ee/server/models/startup.ts @@ -1,4 +1,4 @@ -import { onLicense } from '../../app/license/server/license'; +import { License } from '@rocket.chat/license'; // To facilitate our lives with the stream // Collection will be registered on CE too @@ -8,7 +8,7 @@ import('./OmnichannelServiceLevelAgreements'); import('./AuditLog'); import('./ReadReceipts'); -await onLicense('livechat-enterprise', () => { +await License.onLicense('livechat-enterprise', () => { import('./CannedResponse'); import('./LivechatTag'); import('./LivechatUnit'); diff --git a/apps/meteor/ee/server/startup/apps/trialExpiration.ts b/apps/meteor/ee/server/startup/apps/trialExpiration.ts index 1c214ba0a406..eec50e91b7dd 100644 --- a/apps/meteor/ee/server/startup/apps/trialExpiration.ts +++ b/apps/meteor/ee/server/startup/apps/trialExpiration.ts @@ -1,10 +1,10 @@ +import { License } from '@rocket.chat/license'; import { Meteor } from 'meteor/meteor'; -import { onInvalidateLicense } from '../../../app/license/server/license'; import { Apps } from '../../apps'; Meteor.startup(() => { - onInvalidateLicense(() => { + License.onInvalidateLicense(() => { void Apps.disableApps(); }); }); diff --git a/apps/meteor/ee/server/startup/audit.ts b/apps/meteor/ee/server/startup/audit.ts index 441429e51b22..c38794a7582e 100644 --- a/apps/meteor/ee/server/startup/audit.ts +++ b/apps/meteor/ee/server/startup/audit.ts @@ -1,7 +1,8 @@ -import { onLicense } from '../../app/license/server'; +import { License } from '@rocket.chat/license'; + import { createPermissions } from '../lib/audit/startup'; -await onLicense('auditing', async () => { +await License.onLicense('auditing', async () => { await import('../lib/audit/methods'); await createPermissions(); diff --git a/apps/meteor/ee/server/startup/deviceManagement.ts b/apps/meteor/ee/server/startup/deviceManagement.ts index a9a1c805f72d..2ad5fd3b8a4f 100644 --- a/apps/meteor/ee/server/startup/deviceManagement.ts +++ b/apps/meteor/ee/server/startup/deviceManagement.ts @@ -1,8 +1,9 @@ -import { onToggledFeature } from '../../app/license/server/license'; +import { License } from '@rocket.chat/license'; + import { addSettings } from '../settings/deviceManagement'; let stopListening: (() => void) | undefined; -onToggledFeature('device-management', { +License.onToggledFeature('device-management', { up: async () => { const { createPermissions, createEmailTemplates } = await import('../lib/deviceManagement/startup'); const { listenSessionLogin } = await import('../lib/deviceManagement/session'); diff --git a/apps/meteor/ee/server/startup/engagementDashboard.ts b/apps/meteor/ee/server/startup/engagementDashboard.ts index 2fc393379bf3..ca5dda577bb0 100644 --- a/apps/meteor/ee/server/startup/engagementDashboard.ts +++ b/apps/meteor/ee/server/startup/engagementDashboard.ts @@ -1,8 +1,7 @@ +import { License } from '@rocket.chat/license'; import { Meteor } from 'meteor/meteor'; -import { onToggledFeature } from '../../app/license/server/license'; - -onToggledFeature('engagement-dashboard', { +License.onToggledFeature('engagement-dashboard', { up: () => Meteor.startup(async () => { const { prepareAnalytics, attachCallbacks } = await import('../lib/engagementDashboard/startup'); diff --git a/apps/meteor/ee/server/startup/maxRoomsPerGuest.ts b/apps/meteor/ee/server/startup/maxRoomsPerGuest.ts index f4e2452ec806..5731ca0d1deb 100644 --- a/apps/meteor/ee/server/startup/maxRoomsPerGuest.ts +++ b/apps/meteor/ee/server/startup/maxRoomsPerGuest.ts @@ -1,17 +1,14 @@ -import { Subscriptions } from '@rocket.chat/models'; +import { License } from '@rocket.chat/license'; import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../lib/callbacks'; import { i18n } from '../../../server/lib/i18n'; -import { getMaxRoomsPerGuest } from '../../app/license/server/license'; callbacks.add( 'beforeAddedToRoom', async ({ user }) => { if (user.roles?.includes('guest')) { - const totalSubscriptions = await Subscriptions.countByUserId(user._id); - - if (totalSubscriptions >= getMaxRoomsPerGuest()) { + if (await License.shouldPreventAction('roomsPerGuest', { userId: user._id })) { throw new Meteor.Error('error-max-rooms-per-guest-reached', i18n.t('error-max-rooms-per-guest-reached')); } } diff --git a/apps/meteor/ee/server/startup/seatsCap.ts b/apps/meteor/ee/server/startup/seatsCap.ts index b390539ad6b1..f6d42823cb97 100644 --- a/apps/meteor/ee/server/startup/seatsCap.ts +++ b/apps/meteor/ee/server/startup/seatsCap.ts @@ -1,4 +1,5 @@ import type { IUser } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; import { Users } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; import { throttle } from 'underscore'; @@ -6,7 +7,6 @@ import { throttle } from 'underscore'; import { callbacks } from '../../../lib/callbacks'; import { i18n } from '../../../server/lib/i18n'; import { validateUserRoles } from '../../app/authorization/server/validateUserRoles'; -import { canAddNewUser, getMaxActiveUsers, onValidateLicenses } from '../../app/license/server/license'; import { createSeatsLimitBanners, disableDangerBannerDiscardingDismissal, @@ -22,7 +22,7 @@ callbacks.add( return; } - if (!(await canAddNewUser())) { + if (await License.shouldPreventAction('activeUsers')) { throw new Meteor.Error('error-license-user-limit-reached', i18n.t('error-license-user-limit-reached')); } }, @@ -33,7 +33,7 @@ callbacks.add( callbacks.add( 'beforeUserImport', async ({ userCount }) => { - if (!(await canAddNewUser(userCount))) { + if (await License.shouldPreventAction('activeUsers', {}, userCount)) { throw new Meteor.Error('error-license-user-limit-reached', i18n.t('error-license-user-limit-reached')); } }, @@ -52,7 +52,7 @@ callbacks.add( return; } - if (!(await canAddNewUser())) { + if (await License.shouldPreventAction('activeUsers')) { throw new Meteor.Error('error-license-user-limit-reached', i18n.t('error-license-user-limit-reached')); } }, @@ -62,37 +62,13 @@ callbacks.add( callbacks.add( 'validateUserRoles', - async (userData: Partial) => { - const isGuest = userData.roles?.includes('guest'); - if (isGuest) { - await validateUserRoles(Meteor.userId(), userData); - return; - } - - if (!userData._id) { - return; - } - - const currentUserData = await Users.findOneById(userData._id); - if (currentUserData?.type === 'app') { - return; - } - - const wasGuest = currentUserData?.roles?.length === 1 && currentUserData.roles.includes('guest'); - if (!wasGuest) { - return; - } - - if (!(await canAddNewUser())) { - throw new Meteor.Error('error-license-user-limit-reached', i18n.t('error-license-user-limit-reached')); - } - }, + async (userData: Partial) => validateUserRoles(userData), callbacks.priority.MEDIUM, 'check-max-user-seats', ); const handleMaxSeatsBanners = throttle(async function _handleMaxSeatsBanners() { - const maxActiveUsers = getMaxActiveUsers(); + const maxActiveUsers = License.getMaxActiveUsers(); if (!maxActiveUsers) { await disableWarningBannerDiscardingDismissal(); @@ -137,5 +113,5 @@ Meteor.startup(async () => { await handleMaxSeatsBanners(); - onValidateLicenses(handleMaxSeatsBanners); + License.onValidateLicense(handleMaxSeatsBanners); }); diff --git a/apps/meteor/ee/server/startup/services.ts b/apps/meteor/ee/server/startup/services.ts index 5288b9a8e10e..37aec21bfe56 100644 --- a/apps/meteor/ee/server/startup/services.ts +++ b/apps/meteor/ee/server/startup/services.ts @@ -1,8 +1,8 @@ import { api } from '@rocket.chat/core-services'; +import { License } from '@rocket.chat/license'; import { isRunningMs } from '../../../server/lib/isRunningMs'; import { FederationService } from '../../../server/services/federation/service'; -import { isEnterprise, onLicense } from '../../app/license/server'; import { LicenseService } from '../../app/license/server/license.internalService'; import { OmnichannelEE } from '../../app/livechat-enterprise/server/services/omnichannel.internalService'; import { EnterpriseSettings } from '../../app/settings/server/settings.internalService'; @@ -26,13 +26,13 @@ if (!isRunningMs()) { let federationService: FederationService; void (async () => { - if (!isEnterprise()) { + if (!License.hasValidLicense()) { federationService = await FederationService.createFederationService(); api.registerService(federationService); } })(); -await onLicense('federation', async () => { +await License.onLicense('federation', async () => { const federationServiceEE = new FederationServiceEE(); if (federationService) { api.destroyService(federationService); diff --git a/apps/meteor/ee/server/startup/upsell.ts b/apps/meteor/ee/server/startup/upsell.ts index c9e4c513276c..b31bf0635060 100644 --- a/apps/meteor/ee/server/startup/upsell.ts +++ b/apps/meteor/ee/server/startup/upsell.ts @@ -1,20 +1,13 @@ +import { License } from '@rocket.chat/license'; import { Settings } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; -import { onValidateLicenses, getLicenses } from '../../app/license/server/license'; - const handleHadTrial = (): void => { - getLicenses().forEach(({ valid, license }): void => { - if (!valid) { - return; - } - - if (license.meta?.trial) { - void Settings.updateValueById('Cloud_Workspace_Had_Trial', true); - } - }); + if (License.getLicense()?.information.trial) { + void Settings.updateValueById('Cloud_Workspace_Had_Trial', true); + } }; Meteor.startup(() => { - onValidateLicenses(handleHadTrial); + License.onValidateLicense(handleHadTrial); }); diff --git a/apps/meteor/lib/apps/getInstallationSourceFromAppStorageItem.ts b/apps/meteor/lib/apps/getInstallationSourceFromAppStorageItem.ts index 0af2cee0c377..8ac29d191576 100644 --- a/apps/meteor/lib/apps/getInstallationSourceFromAppStorageItem.ts +++ b/apps/meteor/lib/apps/getInstallationSourceFromAppStorageItem.ts @@ -1,6 +1,5 @@ import type { IAppStorageItem } from '@rocket.chat/apps-engine/server/storage'; - -import type { LicenseAppSources } from '../../ee/app/license/definition/ILicense'; +import type { LicenseAppSources } from '@rocket.chat/license'; /** * There have been reports of apps not being correctly migrated from versions prior to 6.0 diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 5dea47ff3a10..69bd345bc8fb 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -246,7 +246,9 @@ "@rocket.chat/i18n": "workspace:^", "@rocket.chat/icons": "^0.32.0", "@rocket.chat/instance-status": "workspace:^", + "@rocket.chat/jwt": "workspace:^", "@rocket.chat/layout": "next", + "@rocket.chat/license": "workspace:^", "@rocket.chat/log-format": "workspace:^", "@rocket.chat/logger": "workspace:^", "@rocket.chat/logo": "^0.31.27", diff --git a/apps/meteor/server/services/authorization/service.ts b/apps/meteor/server/services/authorization/service.ts index 99863305f7c1..6918d40af871 100644 --- a/apps/meteor/server/services/authorization/service.ts +++ b/apps/meteor/server/services/authorization/service.ts @@ -39,7 +39,7 @@ export class Authorization extends ServiceClass implements IAuthorization { } async started(): Promise { - if (!(await License.isEnterprise())) { + if (!(await License.hasValidLicense())) { return; } diff --git a/apps/meteor/server/startup/migrations/v278.ts b/apps/meteor/server/startup/migrations/v278.ts index 57986fd1064f..068d86499ff9 100644 --- a/apps/meteor/server/startup/migrations/v278.ts +++ b/apps/meteor/server/startup/migrations/v278.ts @@ -1,7 +1,7 @@ +import { License } from '@rocket.chat/license'; import { Banners, Settings } from '@rocket.chat/models'; import { settings } from '../../../app/settings/server'; -import { isEnterprise } from '../../../ee/app/license/server'; import { addMigration } from '../../lib/migrations'; addMigration({ @@ -16,7 +16,7 @@ addMigration({ const LDAPEnabled = settings.get('LDAP_Enable'); const SAMLEnabled = settings.get('SAML_Custom_Default'); - const isEE = isEnterprise(); + const isEE = License.hasValidLicense(); if (!isEE && (isCustomOAuthEnabled || LDAPEnabled || SAMLEnabled)) { return; diff --git a/ee/apps/account-service/Dockerfile b/ee/apps/account-service/Dockerfile index d7ccb734071b..dbd8717e8716 100644 --- a/ee/apps/account-service/Dockerfile +++ b/ee/apps/account-service/Dockerfile @@ -19,9 +19,18 @@ COPY ./packages/rest-typings/dist packages/rest-typings/dist COPY ./packages/model-typings/package.json packages/model-typings/package.json COPY ./packages/model-typings/dist packages/model-typings/dist +COPY ./packages/jwt/package.json packages/jwt/package.json +COPY ./packages/jwt/dist packages/jwt/dist + COPY ./packages/models/package.json packages/models/package.json COPY ./packages/models/dist packages/models/dist +COPY ./packages/logger/package.json packages/logger/package.json +COPY ./packages/logger/dist packages/logger/dist + +COPY ./ee/packages/license/package.json packages/license/package.json +COPY ./ee/packages/license/dist packages/license/dist + COPY ./ee/apps/${SERVICE}/dist . COPY ./package.json . diff --git a/ee/apps/authorization-service/Dockerfile b/ee/apps/authorization-service/Dockerfile index d7ccb734071b..dbd8717e8716 100644 --- a/ee/apps/authorization-service/Dockerfile +++ b/ee/apps/authorization-service/Dockerfile @@ -19,9 +19,18 @@ COPY ./packages/rest-typings/dist packages/rest-typings/dist COPY ./packages/model-typings/package.json packages/model-typings/package.json COPY ./packages/model-typings/dist packages/model-typings/dist +COPY ./packages/jwt/package.json packages/jwt/package.json +COPY ./packages/jwt/dist packages/jwt/dist + COPY ./packages/models/package.json packages/models/package.json COPY ./packages/models/dist packages/models/dist +COPY ./packages/logger/package.json packages/logger/package.json +COPY ./packages/logger/dist packages/logger/dist + +COPY ./ee/packages/license/package.json packages/license/package.json +COPY ./ee/packages/license/dist packages/license/dist + COPY ./ee/apps/${SERVICE}/dist . COPY ./package.json . diff --git a/ee/apps/ddp-streamer/Dockerfile b/ee/apps/ddp-streamer/Dockerfile index 5250e48bf106..9386aac4f21e 100644 --- a/ee/apps/ddp-streamer/Dockerfile +++ b/ee/apps/ddp-streamer/Dockerfile @@ -25,15 +25,21 @@ COPY ./packages/ui-contexts/dist packages/ui-contexts/dist COPY ./packages/model-typings/package.json packages/model-typings/package.json COPY ./packages/model-typings/dist packages/model-typings/dist +COPY ./packages/jwt/package.json packages/jwt/package.json +COPY ./packages/jwt/dist packages/jwt/dist + COPY ./packages/models/package.json packages/models/package.json COPY ./packages/models/dist packages/models/dist -COPY ./packages/instance-status/package.json packages/instance-status/package.json -COPY ./packages/instance-status/dist packages/instance-status/dist - COPY ./packages/logger/package.json packages/logger/package.json COPY ./packages/logger/dist packages/logger/dist +COPY ./ee/packages/license/package.json packages/license/package.json +COPY ./ee/packages/license/dist packages/license/dist + +COPY ./packages/instance-status/package.json packages/instance-status/package.json +COPY ./packages/instance-status/dist packages/instance-status/dist + COPY ./ee/apps/${SERVICE}/dist . COPY ./package.json . diff --git a/ee/apps/omnichannel-transcript/Dockerfile b/ee/apps/omnichannel-transcript/Dockerfile index 95fb836e9f27..e6a1aa00fc88 100644 --- a/ee/apps/omnichannel-transcript/Dockerfile +++ b/ee/apps/omnichannel-transcript/Dockerfile @@ -19,9 +19,18 @@ COPY ./packages/rest-typings/dist packages/rest-typings/dist COPY ./packages/model-typings/package.json packages/model-typings/package.json COPY ./packages/model-typings/dist packages/model-typings/dist +COPY ./packages/jwt/package.json packages/jwt/package.json +COPY ./packages/jwt/dist packages/jwt/dist + COPY ./packages/models/package.json packages/models/package.json COPY ./packages/models/dist packages/models/dist +COPY ./packages/logger/package.json packages/logger/package.json +COPY ./packages/logger/dist packages/logger/dist + +COPY ./ee/packages/license/package.json packages/license/package.json +COPY ./ee/packages/license/dist packages/license/dist + COPY ./ee/packages/omnichannel-services/package.json ee/packages/omnichannel-services/package.json COPY ./ee/packages/omnichannel-services/dist ee/packages/omnichannel-services/dist @@ -31,9 +40,6 @@ COPY ./ee/packages/pdf-worker/dist ee/packages/pdf-worker/dist COPY ./packages/tools/package.json packages/tools/package.json COPY ./packages/tools/dist packages/tools/dist -COPY ./packages/logger/package.json packages/logger/package.json -COPY ./packages/logger/dist packages/logger/dist - COPY ./ee/apps/${SERVICE}/dist . COPY ./package.json . diff --git a/ee/apps/presence-service/Dockerfile b/ee/apps/presence-service/Dockerfile index f85c45246f29..aabf78295b8f 100644 --- a/ee/apps/presence-service/Dockerfile +++ b/ee/apps/presence-service/Dockerfile @@ -22,9 +22,18 @@ COPY ./packages/rest-typings/dist packages/rest-typings/dist COPY ./packages/model-typings/package.json packages/model-typings/package.json COPY ./packages/model-typings/dist packages/model-typings/dist +COPY ./packages/jwt/package.json packages/jwt/package.json +COPY ./packages/jwt/dist packages/jwt/dist + COPY ./packages/models/package.json packages/models/package.json COPY ./packages/models/dist packages/models/dist +COPY ./packages/logger/package.json packages/logger/package.json +COPY ./packages/logger/dist packages/logger/dist + +COPY ./ee/packages/license/package.json packages/license/package.json +COPY ./ee/packages/license/dist packages/license/dist + COPY ./packages/ui-contexts/package.json packages/ui-contexts/package.json COPY ./packages/ui-contexts/dist packages/ui-contexts/dist diff --git a/ee/apps/queue-worker/Dockerfile b/ee/apps/queue-worker/Dockerfile index 95fb836e9f27..e6a1aa00fc88 100644 --- a/ee/apps/queue-worker/Dockerfile +++ b/ee/apps/queue-worker/Dockerfile @@ -19,9 +19,18 @@ COPY ./packages/rest-typings/dist packages/rest-typings/dist COPY ./packages/model-typings/package.json packages/model-typings/package.json COPY ./packages/model-typings/dist packages/model-typings/dist +COPY ./packages/jwt/package.json packages/jwt/package.json +COPY ./packages/jwt/dist packages/jwt/dist + COPY ./packages/models/package.json packages/models/package.json COPY ./packages/models/dist packages/models/dist +COPY ./packages/logger/package.json packages/logger/package.json +COPY ./packages/logger/dist packages/logger/dist + +COPY ./ee/packages/license/package.json packages/license/package.json +COPY ./ee/packages/license/dist packages/license/dist + COPY ./ee/packages/omnichannel-services/package.json ee/packages/omnichannel-services/package.json COPY ./ee/packages/omnichannel-services/dist ee/packages/omnichannel-services/dist @@ -31,9 +40,6 @@ COPY ./ee/packages/pdf-worker/dist ee/packages/pdf-worker/dist COPY ./packages/tools/package.json packages/tools/package.json COPY ./packages/tools/dist packages/tools/dist -COPY ./packages/logger/package.json packages/logger/package.json -COPY ./packages/logger/dist packages/logger/dist - COPY ./ee/apps/${SERVICE}/dist . COPY ./package.json . diff --git a/ee/apps/stream-hub-service/Dockerfile b/ee/apps/stream-hub-service/Dockerfile index c06115c887f5..dbd8717e8716 100644 --- a/ee/apps/stream-hub-service/Dockerfile +++ b/ee/apps/stream-hub-service/Dockerfile @@ -19,12 +19,18 @@ COPY ./packages/rest-typings/dist packages/rest-typings/dist COPY ./packages/model-typings/package.json packages/model-typings/package.json COPY ./packages/model-typings/dist packages/model-typings/dist +COPY ./packages/jwt/package.json packages/jwt/package.json +COPY ./packages/jwt/dist packages/jwt/dist + COPY ./packages/models/package.json packages/models/package.json COPY ./packages/models/dist packages/models/dist COPY ./packages/logger/package.json packages/logger/package.json COPY ./packages/logger/dist packages/logger/dist +COPY ./ee/packages/license/package.json packages/license/package.json +COPY ./ee/packages/license/dist packages/license/dist + COPY ./ee/apps/${SERVICE}/dist . COPY ./package.json . diff --git a/ee/packages/license/.eslintrc.json b/ee/packages/license/.eslintrc.json new file mode 100644 index 000000000000..a83aeda48e66 --- /dev/null +++ b/ee/packages/license/.eslintrc.json @@ -0,0 +1,4 @@ +{ + "extends": ["@rocket.chat/eslint-config"], + "ignorePatterns": ["**/dist"] +} diff --git a/ee/packages/license/__tests__/MockedLicenseBuilder.ts b/ee/packages/license/__tests__/MockedLicenseBuilder.ts new file mode 100644 index 000000000000..316261744da5 --- /dev/null +++ b/ee/packages/license/__tests__/MockedLicenseBuilder.ts @@ -0,0 +1,209 @@ +import { LicenseImp } from '../src'; +import type { ILicenseTag } from '../src/definition/ILicenseTag'; +import type { ILicenseV3 } from '../src/definition/ILicenseV3'; +import type { LicenseLimit } from '../src/definition/LicenseLimit'; +import type { LicenseModule } from '../src/definition/LicenseModule'; +import type { LicensePeriod, Timestamp } from '../src/definition/LicensePeriod'; +import { encrypt } from '../src/token'; + +export class MockedLicenseBuilder { + information: { + id?: string; + autoRenew: boolean; + visualExpiration: Timestamp; + notifyAdminsAt?: Timestamp; + notifyUsersAt?: Timestamp; + trial: boolean; + offline: boolean; + createdAt: Timestamp; + grantedBy: { + method: 'manual' | 'self-service' | 'sales' | 'support' | 'reseller'; + seller?: string; + }; + grantedTo?: { + name?: string; + company?: string; + email?: string; + }; + legalText?: string; + notes?: string; + tags?: ILicenseTag[]; + }; + + validation: { + serverUrls: { + value: string; + type: 'url' | 'regex' | 'hash'; + }[]; + + serverVersions?: { + value: string; + }[]; + + serverUniqueId?: string; + cloudWorkspaceId?: string; + validPeriods: LicensePeriod[]; + legalTextAgreement?: { + type: 'required' | 'not-required' | 'accepted'; + acceptedVia?: 'cloud'; + }; + + statisticsReport: { + required: boolean; + allowedStaleInDays?: number; + }; + }; + + constructor() { + this.information = { + autoRenew: true, + // expires in 1 year + visualExpiration: new Date(new Date().setFullYear(new Date().getFullYear() + 1)).toISOString(), + // 15 days before expiration + notifyAdminsAt: new Date(new Date().setDate(new Date().getDate() + 15)).toISOString(), + // 30 days before expiration + notifyUsersAt: new Date(new Date().setDate(new Date().getDate() + 30)).toISOString(), + trial: false, + offline: false, + createdAt: new Date().toISOString(), + grantedBy: { + method: 'manual', + seller: 'Rocket.Cat', + }, + tags: [ + { + name: 'Test', + color: 'blue', + }, + ], + }; + + this.validation = { + serverUrls: [ + { + value: 'localhost:3000', + type: 'url', + }, + ], + serverVersions: [ + { + value: '3.0.0', + }, + ], + + serverUniqueId: '1234567890', + cloudWorkspaceId: '1234567890', + + validPeriods: [ + { + invalidBehavior: 'disable_modules', + modules: ['livechat-enterprise'], + validFrom: new Date(new Date().setFullYear(new Date().getFullYear() - 1)).toISOString(), + validUntil: new Date(new Date().setFullYear(new Date().getFullYear() + 1)).toISOString(), + }, + ], + + statisticsReport: { + required: true, + allowedStaleInDays: 30, + }, + }; + } + + public resetValidPeriods(): this { + this.validation.validPeriods = []; + return this; + } + + public withValidPeriod(period: LicensePeriod): this { + this.validation.validPeriods.push(period); + return this; + } + + public withGrantedTo(grantedTo: { name?: string; company?: string; email?: string }): this { + this.information.grantedTo = grantedTo; + return this; + } + + grantedModules: { + module: LicenseModule; + }[]; + + limits: { + activeUsers?: LicenseLimit[]; + guestUsers?: LicenseLimit[]; + roomsPerGuest?: LicenseLimit<'prevent_action'>[]; + privateApps?: LicenseLimit[]; + marketplaceApps?: LicenseLimit[]; + monthlyActiveContacts?: LicenseLimit[]; + }; + + cloudMeta?: Record; + + public withServerUrls(urls: { value: string; type: 'url' | 'regex' | 'hash' }): this { + this.validation.serverUrls = this.validation.serverUrls ?? []; + this.validation.serverUrls.push(urls); + return this; + } + + public withServerVersions(versions: { value: string }): this { + this.validation.serverVersions = this.validation.serverVersions ?? []; + this.validation.serverVersions.push(versions); + return this; + } + + public withGratedModules(modules: LicenseModule[]): this { + this.grantedModules = this.grantedModules ?? []; + this.grantedModules.push(...modules.map((module) => ({ module }))); + return this; + } + + withNoGratedModules(modules: LicenseModule[]): this { + this.grantedModules = this.grantedModules ?? []; + this.grantedModules = this.grantedModules.filter(({ module }) => !modules.includes(module)); + return this; + } + + public withLimits(key: K, value: ILicenseV3['limits'][K]): this { + this.limits = this.limits ?? {}; + this.limits[key] = value; + return this; + } + + public build(): ILicenseV3 { + return { + version: '3.0', + information: this.information, + validation: this.validation, + grantedModules: [...new Set(this.grantedModules)], + limits: { + activeUsers: [], + guestUsers: [], + roomsPerGuest: [], + privateApps: [], + marketplaceApps: [], + monthlyActiveContacts: [], + ...this.limits, + }, + cloudMeta: this.cloudMeta, + }; + } + + public sign(): Promise { + return encrypt(this.build()); + } +} + +export const getReadyLicenseManager = async () => { + const license = new LicenseImp(); + await license.setWorkspaceUrl('http://localhost:3000'); + await license.setWorkspaceUrl('http://localhost:3000'); + + license.setLicenseLimitCounter('activeUsers', () => 0); + license.setLicenseLimitCounter('guestUsers', () => 0); + license.setLicenseLimitCounter('roomsPerGuest', async () => 0); + license.setLicenseLimitCounter('privateApps', () => 0); + license.setLicenseLimitCounter('marketplaceApps', () => 0); + license.setLicenseLimitCounter('monthlyActiveContacts', async () => 0); + return license; +}; diff --git a/ee/packages/license/__tests__/emitter.spec.ts b/ee/packages/license/__tests__/emitter.spec.ts new file mode 100644 index 000000000000..4c7c5a8255d1 --- /dev/null +++ b/ee/packages/license/__tests__/emitter.spec.ts @@ -0,0 +1,66 @@ +/** + * @jest-environment node + */ + +import { MockedLicenseBuilder, getReadyLicenseManager } from './MockedLicenseBuilder'; + +describe('Event License behaviors', () => { + it('should call the module as they are enabled/disabled', async () => { + const license = await getReadyLicenseManager(); + const validFn = jest.fn(); + const invalidFn = jest.fn(); + + license.onValidFeature('livechat-enterprise', validFn); + license.onInvalidFeature('livechat-enterprise', invalidFn); + + const mocked = await new MockedLicenseBuilder(); + const oldToken = await mocked.sign(); + + const newToken = await mocked.withGratedModules(['livechat-enterprise']).sign(); + + // apply license + await expect(license.setLicense(oldToken)).resolves.toBe(true); + await expect(license.hasValidLicense()).toBe(true); + + await expect(license.hasModule('livechat-enterprise')).toBe(false); + + await expect(validFn).not.toBeCalled(); + await expect(invalidFn).toBeCalledTimes(1); + + // apply license containing livechat-enterprise module + + validFn.mockClear(); + invalidFn.mockClear(); + + await expect(license.setLicense(newToken)).resolves.toBe(true); + await expect(license.hasValidLicense()).toBe(true); + await expect(license.hasModule('livechat-enterprise')).toBe(true); + + await expect(validFn).toBeCalledTimes(1); + await expect(invalidFn).toBeCalledTimes(0); + + // apply the old license again + + validFn.mockClear(); + invalidFn.mockClear(); + await expect(license.setLicense(oldToken)).resolves.toBe(true); + await expect(license.hasValidLicense()).toBe(true); + await expect(license.hasModule('livechat-enterprise')).toBe(false); + await expect(validFn).toBeCalledTimes(0); + await expect(invalidFn).toBeCalledTimes(1); + }); + + it('should call `onValidateLicense` when a valid license is applied', async () => { + const license = await getReadyLicenseManager(); + const fn = jest.fn(); + + license.onValidateLicense(fn); + + const mocked = await new MockedLicenseBuilder(); + const token = await mocked.sign(); + + await expect(license.setLicense(token)).resolves.toBe(true); + await expect(license.hasValidLicense()).toBe(true); + await expect(fn).toBeCalledTimes(1); + }); +}); diff --git a/ee/packages/license/__tests__/setLicense.spec.ts b/ee/packages/license/__tests__/setLicense.spec.ts new file mode 100644 index 000000000000..962f591750ad --- /dev/null +++ b/ee/packages/license/__tests__/setLicense.spec.ts @@ -0,0 +1,103 @@ +/** + * @jest-environment node + */ + +import { LicenseImp } from '../src'; +import { DuplicatedLicenseError } from '../src/errors/DuplicatedLicenseError'; +import { InvalidLicenseError } from '../src/errors/InvalidLicenseError'; +import { NotReadyForValidation } from '../src/errors/NotReadyForValidation'; +import { MockedLicenseBuilder, getReadyLicenseManager } from './MockedLicenseBuilder'; + +// Same license used on ci tasks so no I didnt leak it +const VALID_LICENSE = + 'WMa5i+/t/LZbYOj8u3XUkivRhWBtWO6ycUjaZoVAw2DxMfdyBIAa2gMMI4x7Z2BrTZIZhFEImfOxcXcgD0QbXHGBJaMI+eYG+eofnVWi2VA7RWbpvWTULgPFgyJ4UEFeCOzVjcBLTQbmMSam3u0RlekWJkfAO0KnmLtsaEYNNA2rz1U+CLI/CdNGfdqrBu5PZZbGkH0KEzyIZMaykOjzvX+C6vd7fRxh23HecwhkBbqE8eQsCBt2ad0qC4MoVXsDaSOmSzGW+aXjuXt/9zjvrLlsmWQTSlkrEHdNkdywm0UkGxqz3+CP99n0WggUBioUiChjMuNMoceWvDvmxYP9Ml2NpYU7SnfhjmMFyXOah8ofzv8w509Y7XODvQBz+iB4Co9YnF3vT96HDDQyAV5t4jATE+0t37EAXmwjTi3qqyP7DLGK/revl+mlcwJ5kS4zZBsm1E4519FkXQOZSyWRnPdjqvh4mCLqoispZ49wKvklDvjPxCSP9us6cVXLDg7NTJr/4pfxLPOkvv7qCgugDvlDx17bXpQFPSDxmpw66FLzvb5Id0dkWjOzrRYSXb0bFWoUQjtHFzmcpFkyVhOKrQ9zA9+Zm7vXmU9Y2l2dK79EloOuHMSYAqsPEag8GMW6vI/cT4iIjHGGDePKnD0HblvTEKzql11cfT/abf2IiaY='; + +describe('License set license procedures', () => { + describe('Invalid formats', () => { + it('by default it should have no license', async () => { + const license = new LicenseImp(); + + expect(license.hasValidLicense()).toBe(false); + expect(license.getLicense()).toBeUndefined(); + }); + + it('should throw an error if the license applied is empty', async () => { + const license = new LicenseImp(); + await expect(license.setLicense('')).rejects.toThrow(InvalidLicenseError); + }); + + it('should throw an error if the license applied is invalid', async () => { + const license = new LicenseImp(); + await expect(license.setLicense('invalid')).rejects.toThrow(InvalidLicenseError); + }); + }); + + it('should throw an error if the license is duplicated', async () => { + const license = await getReadyLicenseManager(); + + await expect(license.setLicense(VALID_LICENSE)).resolves.toBe(true); + await expect(license.setLicense(VALID_LICENSE)).rejects.toThrow(DuplicatedLicenseError); + }); + + it('should keep a valid license if a new invalid license is applied', async () => { + const license = await getReadyLicenseManager(); + + await expect(license.setLicense(VALID_LICENSE)).resolves.toBe(true); + await expect(license.hasValidLicense()).toBe(true); + + await expect(license.setLicense('invalid')).rejects.toThrow(InvalidLicenseError); + await expect(license.hasValidLicense()).toBe(true); + }); + + describe('Pending cases', () => { + it('should return an error if the license is not ready for validation yet - missing workspace url', async () => { + const license = new LicenseImp(); + await expect(license.setLicense(VALID_LICENSE)).rejects.toThrow(NotReadyForValidation); + }); + + it('should return an error if the license is not ready for validation yet - missing counters', async () => { + const license = new LicenseImp(); + await license.setWorkspaceUrl('http://localhost:3000'); + + expect(license.getWorkspaceUrl()).toBe('localhost:3000'); + + await expect(license.setLicense(VALID_LICENSE)).rejects.toThrow(NotReadyForValidation); + + await expect(license.hasValidLicense()).toBe(false); + }); + + it('should return a valid license if the license is ready for validation', async () => { + const license = await getReadyLicenseManager(); + + await expect(license.setLicense(VALID_LICENSE)).resolves.toBe(true); + await expect(license.hasValidLicense()).toBe(true); + }); + }); + + describe('License V3', () => { + it('should return a valid license if the license is ready for validation', async () => { + const license = await getReadyLicenseManager(); + const token = await new MockedLicenseBuilder().sign(); + + await expect(license.setLicense(token)).resolves.toBe(true); + await expect(license.hasValidLicense()).toBe(true); + }); + + it('should accept new licenses', async () => { + const license = await getReadyLicenseManager(); + const mocked = await new MockedLicenseBuilder(); + const oldToken = await mocked.sign(); + + const newToken = await mocked.withGratedModules(['livechat-enterprise']).sign(); + + await expect(license.setLicense(oldToken)).resolves.toBe(true); + await expect(license.hasValidLicense()).toBe(true); + + await expect(license.hasModule('livechat-enterprise')).toBe(false); + + await expect(license.setLicense(newToken)).resolves.toBe(true); + await expect(license.hasValidLicense()).toBe(true); + await expect(license.hasModule('livechat-enterprise')).toBe(true); + }); + }); +}); diff --git a/ee/packages/license/babel.config.json b/ee/packages/license/babel.config.json new file mode 100644 index 000000000000..e154c0813530 --- /dev/null +++ b/ee/packages/license/babel.config.json @@ -0,0 +1,11 @@ +{ + "presets": ["@babel/preset-typescript"], + "plugins": [ + [ + "transform-inline-environment-variables", + { + "include": ["LICENSE_PUBLIC_KEY_V3"] + } + ] + ] +} diff --git a/ee/packages/license/jest.config.ts b/ee/packages/license/jest.config.ts new file mode 100644 index 000000000000..21121603f6e0 --- /dev/null +++ b/ee/packages/license/jest.config.ts @@ -0,0 +1,16 @@ +export default { + preset: 'ts-jest', + errorOnDeprecated: true, + modulePathIgnorePatterns: ['/dist/'], + testMatch: ['**/**.spec.ts'], + transform: { + '^.+\\.(t|j)sx?$': '@swc/jest', + }, + // transformIgnorePatterns: ['!node_modules/jose'], + moduleNameMapper: { + '\\.css$': 'identity-obj-proxy', + '^jose$': require.resolve('jose'), + }, + collectCoverage: true, + collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'], +}; diff --git a/ee/packages/license/package.json b/ee/packages/license/package.json new file mode 100644 index 000000000000..f6a1e7a2b7d5 --- /dev/null +++ b/ee/packages/license/package.json @@ -0,0 +1,47 @@ +{ + "name": "@rocket.chat/license", + "version": "0.0.1", + "private": true, + "devDependencies": { + "@babel/cli": "^7.23.0", + "@babel/core": "^7.23.0", + "@babel/preset-env": "^7.22.20", + "@babel/preset-typescript": "^7.23.0", + "@swc/core": "^1.3.66", + "@swc/jest": "^0.2.26", + "@types/babel__core": "^7", + "@types/babel__preset-env": "^7", + "@types/jest": "~29.5.3", + "@types/ws": "^8.5.5", + "babel-plugin-transform-inline-environment-variables": "^0.4.4", + "eslint": "~8.45.0", + "jest": "~29.6.1", + "jest-environment-jsdom": "~29.6.1", + "jest-websocket-mock": "^2.4.0", + "ts-jest": "~29.0.5", + "typescript": "^5.2.2" + }, + "scripts": { + "lint": "eslint --ext .js,.jsx,.ts,.tsx .", + "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix", + "test": "jest", + "testunit": "jest", + "build": "npm run build:types && npm run build:js", + "build:types": "tsc --emitDeclarationOnly", + "build:js": "babel src --out-dir dist --extensions \".ts,.tsx\" --source-maps inline", + "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput" + }, + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "files": [ + "/dist" + ], + "volta": { + "extends": "../../../package.json" + }, + "dependencies": { + "@rocket.chat/core-typings": "workspace:^", + "@rocket.chat/jwt": "workspace:^", + "@rocket.chat/logger": "workspace:^" + } +} diff --git a/apps/meteor/ee/app/license/definition/ILicenseTag.ts b/ee/packages/license/src/definition/ILicenseTag.ts similarity index 100% rename from apps/meteor/ee/app/license/definition/ILicenseTag.ts rename to ee/packages/license/src/definition/ILicenseTag.ts diff --git a/apps/meteor/ee/app/license/definition/ILicense.ts b/ee/packages/license/src/definition/ILicenseV2.ts similarity index 93% rename from apps/meteor/ee/app/license/definition/ILicense.ts rename to ee/packages/license/src/definition/ILicenseV2.ts index 7ac4bafdc7b5..57d921a24907 100644 --- a/apps/meteor/ee/app/license/definition/ILicense.ts +++ b/ee/packages/license/src/definition/ILicenseV2.ts @@ -1,6 +1,6 @@ import type { ILicenseTag } from './ILicenseTag'; -export interface ILicense { +export interface ILicenseV2 { url: string; expiry: string; maxActiveUsers: number; diff --git a/ee/packages/license/src/definition/ILicenseV3.ts b/ee/packages/license/src/definition/ILicenseV3.ts new file mode 100644 index 000000000000..d3a2d7f572a3 --- /dev/null +++ b/ee/packages/license/src/definition/ILicenseV3.ts @@ -0,0 +1,64 @@ +import type { ILicenseTag } from './ILicenseTag'; +import type { LicenseLimit } from './LicenseLimit'; +import type { LicenseModule } from './LicenseModule'; +import type { LicensePeriod, Timestamp } from './LicensePeriod'; + +export interface ILicenseV3 { + version: '3.0'; + information: { + id?: string; + autoRenew: boolean; + visualExpiration: Timestamp; + notifyAdminsAt?: Timestamp; + notifyUsersAt?: Timestamp; + trial: boolean; + offline: boolean; + createdAt: Timestamp; + grantedBy: { + method: 'manual' | 'self-service' | 'sales' | 'support' | 'reseller'; + seller?: string; + }; + grantedTo?: { + name?: string; + company?: string; + email?: string; + }; + legalText?: string; + notes?: string; + tags?: ILicenseTag[]; + }; + validation: { + serverUrls: { + value: string; + type: 'url' | 'regex' | 'hash'; + }[]; + serverVersions?: { + value: string; + }[]; + serverUniqueId?: string; + cloudWorkspaceId?: string; + validPeriods: LicensePeriod[]; + legalTextAgreement?: { + type: 'required' | 'not-required' | 'accepted'; + acceptedVia?: 'cloud'; + }; + statisticsReport: { + required: boolean; + allowedStaleInDays?: number; + }; + }; + grantedModules: { + module: LicenseModule; + }[]; + limits: { + activeUsers?: LicenseLimit[]; + guestUsers?: LicenseLimit[]; + roomsPerGuest?: LicenseLimit<'prevent_action'>[]; + privateApps?: LicenseLimit[]; + marketplaceApps?: LicenseLimit[]; + monthlyActiveContacts?: LicenseLimit[]; + }; + cloudMeta?: Record; +} + +export type LicenseLimitKind = keyof ILicenseV3['limits']; diff --git a/ee/packages/license/src/definition/LicenseBehavior.ts b/ee/packages/license/src/definition/LicenseBehavior.ts new file mode 100644 index 000000000000..b6d52bbfa8c5 --- /dev/null +++ b/ee/packages/license/src/definition/LicenseBehavior.ts @@ -0,0 +1,8 @@ +import type { LicenseModule } from './LicenseModule'; + +export type LicenseBehavior = 'invalidate_license' | 'start_fair_policy' | 'prevent_action' | 'prevent_installation' | 'disable_modules'; + +export type BehaviorWithContext = { + behavior: LicenseBehavior; + modules?: LicenseModule[]; +}; diff --git a/ee/packages/license/src/definition/LicenseLimit.ts b/ee/packages/license/src/definition/LicenseLimit.ts new file mode 100644 index 000000000000..40e5a62f597a --- /dev/null +++ b/ee/packages/license/src/definition/LicenseLimit.ts @@ -0,0 +1,7 @@ +import type { LicenseBehavior } from './LicenseBehavior'; +import type { LicenseModule } from './LicenseModule'; + +export type LicenseLimit = { + max: number; + behavior: T; +} & (T extends 'disable_modules' ? { behavior: T; modules: LicenseModule[] } : { behavior: T }); diff --git a/ee/packages/license/src/definition/LicenseModule.ts b/ee/packages/license/src/definition/LicenseModule.ts new file mode 100644 index 000000000000..8ecebba1983b --- /dev/null +++ b/ee/packages/license/src/definition/LicenseModule.ts @@ -0,0 +1,18 @@ +export type LicenseModule = + | 'auditing' + | 'canned-responses' + | 'ldap-enterprise' + | 'livechat-enterprise' + | 'voip-enterprise' + | 'omnichannel-mobile-enterprise' + | 'engagement-dashboard' + | 'push-privacy' + | 'scalability' + | 'teams-mention' + | 'saml-enterprise' + | 'oauth-enterprise' + | 'device-management' + | 'federation' + | 'videoconference-enterprise' + | 'message-read-receipt' + | 'outlook-calendar'; diff --git a/ee/packages/license/src/definition/LicensePeriod.ts b/ee/packages/license/src/definition/LicensePeriod.ts new file mode 100644 index 000000000000..d9bae6198fde --- /dev/null +++ b/ee/packages/license/src/definition/LicensePeriod.ts @@ -0,0 +1,13 @@ +import type { LicenseBehavior } from './LicenseBehavior'; +import type { LicenseModule } from './LicenseModule'; + +export type Timestamp = string; + +export type LicensePeriod = { + validFrom?: Timestamp; + validUntil?: Timestamp; + invalidBehavior: LicenseBehavior; +} & ({ validFrom: Timestamp } | { validUntil: Timestamp }) & + ({ invalidBehavior: 'disable_modules'; modules: LicenseModule[] } | { invalidBehavior: Exclude }); + +export type LicensePeriodBehavior = Exclude; diff --git a/ee/packages/license/src/definition/LimitContext.ts b/ee/packages/license/src/definition/LimitContext.ts new file mode 100644 index 000000000000..a2c44744bd75 --- /dev/null +++ b/ee/packages/license/src/definition/LimitContext.ts @@ -0,0 +1,5 @@ +import type { IUser } from '@rocket.chat/core-typings'; + +import type { LicenseLimitKind } from './ILicenseV3'; + +export type LimitContext = T extends 'roomsPerGuest' ? { userId: IUser['_id'] } : Record; diff --git a/ee/packages/license/src/deprecated.ts b/ee/packages/license/src/deprecated.ts new file mode 100644 index 000000000000..65851a79c7eb --- /dev/null +++ b/ee/packages/license/src/deprecated.ts @@ -0,0 +1,38 @@ +import type { ILicenseV3, LicenseLimitKind } from './definition/ILicenseV3'; +import type { LicenseManager } from './license'; +import { getModules } from './modules'; + +const getLicenseLimit = (license: ILicenseV3 | undefined, kind: LicenseLimitKind) => { + if (!license) { + return; + } + + const limitList = license.limits[kind]; + if (!limitList?.length) { + return; + } + + return Math.min(...limitList.map(({ max }) => max)); +}; + +// #TODO: Remove references to those functions + +export function getMaxActiveUsers(this: LicenseManager) { + return getLicenseLimit(this.getLicense(), 'activeUsers') ?? 0; +} + +export function getAppsConfig(this: LicenseManager) { + return { + maxPrivateApps: getLicenseLimit(this.getLicense(), 'privateApps') ?? -1, + maxMarketplaceApps: getLicenseLimit(this.getLicense(), 'marketplaceApps') ?? -1, + }; +} + +export function getUnmodifiedLicenseAndModules(this: LicenseManager) { + if (this.valid && this.unmodifiedLicense) { + return { + license: this.unmodifiedLicense, + modules: getModules.call(this), + }; + } +} diff --git a/ee/packages/license/src/errors/DuplicatedLicenseError.ts b/ee/packages/license/src/errors/DuplicatedLicenseError.ts new file mode 100644 index 000000000000..70b962d53105 --- /dev/null +++ b/ee/packages/license/src/errors/DuplicatedLicenseError.ts @@ -0,0 +1,6 @@ +export class DuplicatedLicenseError extends Error { + constructor(message = 'Duplicated license') { + super(message); + this.name = 'DuplicatedLicense'; + } +} diff --git a/ee/packages/license/src/errors/InvalidLicenseError.ts b/ee/packages/license/src/errors/InvalidLicenseError.ts new file mode 100644 index 000000000000..a1eb328acd46 --- /dev/null +++ b/ee/packages/license/src/errors/InvalidLicenseError.ts @@ -0,0 +1,6 @@ +export class InvalidLicenseError extends Error { + constructor(message = 'Invalid license') { + super(message); + this.name = 'InvalidLicenseError'; + } +} diff --git a/ee/packages/license/src/errors/NotReadyForValidation.ts b/ee/packages/license/src/errors/NotReadyForValidation.ts new file mode 100644 index 000000000000..ccb99e054500 --- /dev/null +++ b/ee/packages/license/src/errors/NotReadyForValidation.ts @@ -0,0 +1,6 @@ +export class NotReadyForValidation extends Error { + constructor(message = 'Not ready for validation') { + super(message); + this.name = 'NotReadyForValidation'; + } +} diff --git a/ee/packages/license/src/events/deprecated.ts b/ee/packages/license/src/events/deprecated.ts new file mode 100644 index 000000000000..8ebfe4729292 --- /dev/null +++ b/ee/packages/license/src/events/deprecated.ts @@ -0,0 +1,12 @@ +import type { LicenseModule } from '../definition/LicenseModule'; +import type { LicenseManager } from '../license'; +import { hasModule } from '../modules'; + +// #TODO: Remove this onLicense handler +export function onLicense(this: LicenseManager, feature: LicenseModule, cb: (...args: any[]) => void): void | Promise { + if (hasModule.call(this, feature)) { + return cb(); + } + + this.once(`valid:${feature}`, cb); +} diff --git a/ee/packages/license/src/events/emitter.ts b/ee/packages/license/src/events/emitter.ts new file mode 100644 index 000000000000..9d4025e4bce3 --- /dev/null +++ b/ee/packages/license/src/events/emitter.ts @@ -0,0 +1,30 @@ +import type { LicenseLimitKind } from '../definition/ILicenseV3'; +import type { LicenseModule } from '../definition/LicenseModule'; +import type { LicenseManager } from '../license'; +import { logger } from '../logger'; + +export function moduleValidated(this: LicenseManager, module: LicenseModule) { + try { + this.emit('module', { module, valid: true }); + this.emit(`valid:${module}`); + } catch (error) { + logger.error({ msg: 'Error running module added event', error }); + } +} + +export function moduleRemoved(this: LicenseManager, module: LicenseModule) { + try { + this.emit('module', { module, valid: false }); + this.emit(`invalid:${module}`); + } catch (error) { + logger.error({ msg: 'Error running module removed event', error }); + } +} + +export function limitReached(this: LicenseManager, limitKind: LicenseLimitKind) { + try { + this.emit(`limitReached:${limitKind}`); + } catch (error) { + logger.error({ msg: 'Error running limit reached event', error }); + } +} diff --git a/ee/packages/license/src/events/listeners.ts b/ee/packages/license/src/events/listeners.ts new file mode 100644 index 000000000000..d6e9fb016f2c --- /dev/null +++ b/ee/packages/license/src/events/listeners.ts @@ -0,0 +1,75 @@ +import type { LicenseLimitKind } from '../definition/ILicenseV3'; +import type { LicenseModule } from '../definition/LicenseModule'; +import type { LicenseManager } from '../license'; +import { hasModule } from '../modules'; + +export function onValidFeature(this: LicenseManager, feature: LicenseModule, cb: () => void) { + this.on(`valid:${feature}`, cb); + + if (hasModule.call(this, feature)) { + cb(); + } + + return (): void => { + this.off(`valid:${feature}`, cb); + }; +} + +export function onInvalidFeature(this: LicenseManager, feature: LicenseModule, cb: () => void) { + this.on(`invalid:${feature}`, cb); + + if (!hasModule.call(this, feature)) { + cb(); + } + + return (): void => { + this.off(`invalid:${feature}`, cb); + }; +} + +export function onToggledFeature( + this: LicenseManager, + feature: LicenseModule, + { up, down }: { up?: () => Promise | void; down?: () => Promise | void }, +): () => void { + let enabled = hasModule.call(this, feature); + + const offValidFeature = onValidFeature.bind(this)(feature, () => { + if (!enabled) { + void up?.(); + enabled = true; + } + }); + + const offInvalidFeature = onInvalidFeature.bind(this)(feature, () => { + if (enabled) { + void down?.(); + enabled = false; + } + }); + + if (enabled) { + void up?.(); + } + + return (): void => { + offValidFeature(); + offInvalidFeature(); + }; +} + +export function onModule(this: LicenseManager, cb: (...args: any[]) => void) { + this.on('module', cb); +} + +export function onValidateLicense(this: LicenseManager, cb: (...args: any[]) => void) { + this.on('validate', cb); +} + +export function onInvalidateLicense(this: LicenseManager, cb: (...args: any[]) => void) { + this.on('invalidate', cb); +} + +export function onLimitReached(this: LicenseManager, limitKind: LicenseLimitKind, cb: (...args: any[]) => void) { + this.on(`limitReached:${limitKind}`, cb); +} diff --git a/ee/packages/license/src/events/overwriteClassOnLicense.ts b/ee/packages/license/src/events/overwriteClassOnLicense.ts new file mode 100644 index 000000000000..00a690d8f413 --- /dev/null +++ b/ee/packages/license/src/events/overwriteClassOnLicense.ts @@ -0,0 +1,26 @@ +import type { LicenseModule } from '../definition/LicenseModule'; +import type { LicenseManager } from '../license'; +import { onLicense } from './deprecated'; + +interface IOverrideClassProperties { + [key: string]: (...args: any[]) => any; +} + +type Class = { new (...args: any[]): any }; + +export async function overwriteClassOnLicense( + this: LicenseManager, + + license: LicenseModule, + original: Class, + overwrite: IOverrideClassProperties, +): Promise { + await onLicense.call(this, license, () => { + Object.entries(overwrite).forEach(([key, value]) => { + const originalFn = original.prototype[key]; + original.prototype[key] = function (...args: any[]): any { + return value.call(this, originalFn, ...args); + }; + }); + }); +} diff --git a/ee/packages/license/src/index.ts b/ee/packages/license/src/index.ts new file mode 100644 index 000000000000..9dbd94db53ed --- /dev/null +++ b/ee/packages/license/src/index.ts @@ -0,0 +1,106 @@ +import type { LicenseLimitKind } from './definition/ILicenseV3'; +import type { LimitContext } from './definition/LimitContext'; +import { getAppsConfig, getMaxActiveUsers, getUnmodifiedLicenseAndModules } from './deprecated'; +import { onLicense } from './events/deprecated'; +import { + onInvalidFeature, + onInvalidateLicense, + onLimitReached, + onModule, + onToggledFeature, + onValidFeature, + onValidateLicense, +} from './events/listeners'; +import { overwriteClassOnLicense } from './events/overwriteClassOnLicense'; +import { LicenseManager } from './license'; +import { getModules, hasModule } from './modules'; +import { getTags } from './tags'; +import { getCurrentValueForLicenseLimit, setLicenseLimitCounter } from './validation/getCurrentValueForLicenseLimit'; +import { validateFormat } from './validation/validateFormat'; + +export * from './definition/ILicenseTag'; +export * from './definition/ILicenseV2'; +export * from './definition/ILicenseV3'; +export * from './definition/LicenseBehavior'; +export * from './definition/LicenseLimit'; +export * from './definition/LicenseModule'; +export * from './definition/LicensePeriod'; +export * from './definition/LimitContext'; + +// eslint-disable-next-line @typescript-eslint/naming-convention +interface License { + validateFormat: typeof validateFormat; + hasModule: typeof hasModule; + getModules: typeof getModules; + getTags: typeof getTags; + overwriteClassOnLicense: typeof overwriteClassOnLicense; + setLicenseLimitCounter: typeof setLicenseLimitCounter; + getCurrentValueForLicenseLimit: typeof getCurrentValueForLicenseLimit; + isLimitReached: (action: T, context?: Partial>) => Promise; + onValidFeature: typeof onValidFeature; + onInvalidFeature: typeof onInvalidFeature; + onToggledFeature: typeof onToggledFeature; + onModule: typeof onModule; + onValidateLicense: typeof onValidateLicense; + onInvalidateLicense: typeof onInvalidateLicense; + onLimitReached: typeof onLimitReached; + + // Deprecated: + onLicense: typeof onLicense; + // Deprecated: + getMaxActiveUsers: typeof getMaxActiveUsers; + // Deprecated: + getAppsConfig: typeof getAppsConfig; + // Deprecated: + getUnmodifiedLicenseAndModules: typeof getUnmodifiedLicenseAndModules; +} + +export class LicenseImp extends LicenseManager implements License { + validateFormat = validateFormat; + + hasModule = hasModule; + + getModules = getModules; + + getTags = getTags; + + overwriteClassOnLicense = overwriteClassOnLicense; + + public setLicenseLimitCounter = setLicenseLimitCounter; + + getCurrentValueForLicenseLimit = getCurrentValueForLicenseLimit; + + public async isLimitReached(action: T, context?: Partial>) { + return this.shouldPreventAction(action, context, 0); + } + + onValidFeature = onValidFeature; + + onInvalidFeature = onInvalidFeature; + + onToggledFeature = onToggledFeature; + + onModule = onModule; + + onValidateLicense = onValidateLicense; + + onInvalidateLicense = onInvalidateLicense; + + onLimitReached = onLimitReached; + + // Deprecated: + onLicense = onLicense; + + // Deprecated: + getMaxActiveUsers = getMaxActiveUsers; + + // Deprecated: + getAppsConfig = getAppsConfig; + + // Deprecated: + getUnmodifiedLicenseAndModules = getUnmodifiedLicenseAndModules; +} + +const license = new LicenseImp(); + +export { license as License }; diff --git a/ee/packages/license/src/license.spec.ts b/ee/packages/license/src/license.spec.ts new file mode 100644 index 000000000000..36744585d59f --- /dev/null +++ b/ee/packages/license/src/license.spec.ts @@ -0,0 +1,42 @@ +import { MockedLicenseBuilder, getReadyLicenseManager } from '../__tests__/MockedLicenseBuilder'; + +it('should not prevent if there is no license', async () => { + const license = await getReadyLicenseManager(); + const result = await license.shouldPreventAction('activeUsers'); + expect(result).toBe(false); +}); + +it('should not prevent if the counter is under the limit', async () => { + const licenseManager = await getReadyLicenseManager(); + + const license = await new MockedLicenseBuilder().withLimits('activeUsers', [ + { + max: 10, + behavior: 'prevent_action', + }, + ]); + + await expect(licenseManager.setLicense(await license.sign())).resolves.toBe(true); + + licenseManager.setLicenseLimitCounter('activeUsers', () => 5); + await expect(licenseManager.shouldPreventAction('activeUsers')).resolves.toBe(false); +}); + +it('should prevent if the counter is equal or over the limit', async () => { + const licenseManager = await getReadyLicenseManager(); + + const license = await new MockedLicenseBuilder().withLimits('activeUsers', [ + { + max: 10, + behavior: 'prevent_action', + }, + ]); + + await expect(licenseManager.setLicense(await license.sign())).resolves.toBe(true); + + licenseManager.setLicenseLimitCounter('activeUsers', () => 10); + await expect(licenseManager.shouldPreventAction('activeUsers')).resolves.toBe(true); + + licenseManager.setLicenseLimitCounter('activeUsers', () => 11); + await expect(licenseManager.shouldPreventAction('activeUsers')).resolves.toBe(true); +}); diff --git a/ee/packages/license/src/license.ts b/ee/packages/license/src/license.ts new file mode 100644 index 000000000000..2fb25b0e3b4f --- /dev/null +++ b/ee/packages/license/src/license.ts @@ -0,0 +1,230 @@ +import { Emitter } from '@rocket.chat/emitter'; + +import type { ILicenseV2 } from './definition/ILicenseV2'; +import type { ILicenseV3, LicenseLimitKind } from './definition/ILicenseV3'; +import type { BehaviorWithContext } from './definition/LicenseBehavior'; +import type { LicenseModule } from './definition/LicenseModule'; +import type { LimitContext } from './definition/LimitContext'; +import { DuplicatedLicenseError } from './errors/DuplicatedLicenseError'; +import { InvalidLicenseError } from './errors/InvalidLicenseError'; +import { NotReadyForValidation } from './errors/NotReadyForValidation'; +import { logger } from './logger'; +import { invalidateAll, replaceModules } from './modules'; +import { applyPendingLicense, clearPendingLicense, hasPendingLicense, isPendingLicense, setPendingLicense } from './pendingLicense'; +import { showLicense } from './showLicense'; +import { replaceTags } from './tags'; +import { decrypt } from './token'; +import { convertToV3 } from './v2/convertToV3'; +import { getCurrentValueForLicenseLimit } from './validation/getCurrentValueForLicenseLimit'; +import { getModulesToDisable } from './validation/getModulesToDisable'; +import { isBehaviorsInResult } from './validation/isBehaviorsInResult'; +import { isReadyForValidation } from './validation/isReadyForValidation'; +import { runValidation } from './validation/runValidation'; +import { validateFormat } from './validation/validateFormat'; + +export class LicenseManager extends Emitter< + Record<`limitReached:${LicenseLimitKind}` | `${'invalid' | 'valid'}:${LicenseModule}`, undefined> & { + validate: undefined; + invalidate: undefined; + module: { module: LicenseModule; valid: boolean }; + } +> { + dataCounters = new Map) => Promise>(); + + pendingLicense = ''; + + modules = new Set(); + + private workspaceUrl: string | undefined; + + private _license: ILicenseV3 | undefined; + + private _unmodifiedLicense: ILicenseV2 | ILicenseV3 | undefined; + + private _valid: boolean | undefined; + + private _inFairPolicy: boolean | undefined; + + private _lockedLicense: string | undefined; + + public get license(): ILicenseV3 | undefined { + return this._license; + } + + public get unmodifiedLicense(): ILicenseV2 | ILicenseV3 | undefined { + return this._unmodifiedLicense; + } + + public get valid(): boolean | undefined { + return this._valid; + } + + public get inFairPolicy(): boolean { + return Boolean(this._inFairPolicy); + } + + public async setWorkspaceUrl(url: string) { + this.workspaceUrl = url.replace(/\/$/, '').replace(/^https?:\/\/(.*)$/, '$1'); + + if (hasPendingLicense.call(this)) { + await applyPendingLicense.call(this); + } + } + + public getWorkspaceUrl() { + return this.workspaceUrl; + } + + private clearLicenseData(): void { + this._license = undefined; + this._unmodifiedLicense = undefined; + this._inFairPolicy = undefined; + this._valid = false; + this._lockedLicense = undefined; + clearPendingLicense.call(this); + } + + private async setLicenseV3(newLicense: ILicenseV3, encryptedLicense: string, originalLicense?: ILicenseV2 | ILicenseV3): Promise { + const hadValidLicense = this.hasValidLicense(); + this.clearLicenseData(); + + try { + this._unmodifiedLicense = originalLicense || newLicense; + this._license = newLicense; + + await this.validateLicense(); + + this._lockedLicense = encryptedLicense; + } finally { + if (hadValidLicense && !this.hasValidLicense()) { + this.emit('invalidate'); + invalidateAll.call(this); + } + } + } + + private async setLicenseV2(newLicense: ILicenseV2, encryptedLicense: string): Promise { + return this.setLicenseV3(convertToV3(newLicense), encryptedLicense, newLicense); + } + + private isLicenseDuplicated(encryptedLicense: string): boolean { + return Boolean(this._lockedLicense && this._lockedLicense === encryptedLicense); + } + + private async validateLicense(): Promise { + if (!this._license) { + throw new InvalidLicenseError(); + } + + if (!isReadyForValidation.call(this)) { + throw new NotReadyForValidation(); + } + + // #TODO: Only include 'prevent_installation' here if this is actually the initial installation of the license + const validationResult = await runValidation.call(this, this._license, [ + 'invalidate_license', + 'prevent_installation', + 'start_fair_policy', + 'disable_modules', + ]); + + this.processValidationResult(validationResult); + } + + public async setLicense(encryptedLicense: string): Promise { + if (!(await validateFormat(encryptedLicense))) { + throw new InvalidLicenseError(); + } + + if (this.isLicenseDuplicated(encryptedLicense)) { + // If there is a pending license but the user is trying to revert to the license that is currently active + if (hasPendingLicense.call(this) && !isPendingLicense.call(this, encryptedLicense)) { + // simply remove the pending license + clearPendingLicense.call(this); + throw new Error('Invalid license 1'); + } + + throw new DuplicatedLicenseError(); + } + + if (!isReadyForValidation.call(this)) { + // If we can't validate the license data yet, but is a valid license string, store it to validate when we can + setPendingLicense.call(this, encryptedLicense); + throw new NotReadyForValidation(); + } + + logger.info('New Enterprise License'); + try { + const decrypted = JSON.parse(await decrypt(encryptedLicense)); + + logger.debug({ msg: 'license', decrypted }); + + if (!encryptedLicense.startsWith('RCV3_')) { + await this.setLicenseV2(decrypted, encryptedLicense); + return true; + } + await this.setLicenseV3(decrypted, encryptedLicense); + + return true; + } catch (e) { + logger.error('Invalid license'); + + logger.error({ msg: 'Invalid raw license', encryptedLicense, e }); + + throw new InvalidLicenseError(); + } + } + + private processValidationResult(result: BehaviorWithContext[]): void { + if (!this._license || isBehaviorsInResult(result, ['invalidate_license', 'prevent_installation'])) { + return; + } + + this._valid = true; + this._inFairPolicy = isBehaviorsInResult(result, ['start_fair_policy']); + + if (this._license.information.tags) { + replaceTags(this._license.information.tags); + } + + const disabledModules = getModulesToDisable(result); + const modulesToEnable = this._license.grantedModules.filter(({ module }) => !disabledModules.includes(module)); + + replaceModules.call( + this, + modulesToEnable.map(({ module }) => module), + ); + logger.log({ msg: 'License validated', modules: modulesToEnable }); + + this.emit('validate'); + showLicense.call(this, this._license, this._valid); + } + + public hasValidLicense(): boolean { + return Boolean(this.getLicense()); + } + + public getLicense(): ILicenseV3 | undefined { + if (this._valid && this._license) { + return this._license; + } + } + + public async shouldPreventAction( + action: T, + context?: Partial>, + newCount = 1, + ): Promise { + const license = this.getLicense(); + if (!license) { + return false; + } + + const currentValue = (await getCurrentValueForLicenseLimit.call(this, action, context)) + newCount; + return Boolean( + license.limits[action] + ?.filter(({ behavior, max }) => behavior === 'prevent_action' && max >= 0) + .some(({ max }) => max < currentValue), + ); + } +} diff --git a/ee/packages/license/src/logger.ts b/ee/packages/license/src/logger.ts new file mode 100644 index 000000000000..120b08691c6c --- /dev/null +++ b/ee/packages/license/src/logger.ts @@ -0,0 +1,3 @@ +import { Logger } from '@rocket.chat/logger'; + +export const logger = new Logger('License'); diff --git a/ee/packages/license/src/modules.ts b/ee/packages/license/src/modules.ts new file mode 100644 index 000000000000..7570ec525fc7 --- /dev/null +++ b/ee/packages/license/src/modules.ts @@ -0,0 +1,50 @@ +import type { LicenseModule } from './definition/LicenseModule'; +import { moduleRemoved, moduleValidated } from './events/emitter'; +import type { LicenseManager } from './license'; + +export function notifyValidatedModules(this: LicenseManager, licenseModules: LicenseModule[]) { + licenseModules.forEach((module) => { + this.modules.add(module); + moduleValidated.call(this, module); + }); +} + +export function notifyInvalidatedModules(this: LicenseManager, licenseModules: LicenseModule[]) { + licenseModules.forEach((module) => { + moduleRemoved.call(this, module); + this.modules.delete(module); + }); +} + +export function invalidateAll(this: LicenseManager) { + notifyInvalidatedModules.call(this, [...this.modules]); + this.modules.clear(); +} + +export function getModules(this: LicenseManager) { + return [...this.modules]; +} + +export function hasModule(this: LicenseManager, module: LicenseModule) { + return this.modules.has(module); +} + +export function replaceModules(this: LicenseManager, newModules: LicenseModule[]) { + for (const moduleName of newModules) { + if (this.modules.has(moduleName)) { + continue; + } + + this.modules.add(moduleName); + moduleValidated.call(this, moduleName); + } + + for (const moduleName of this.modules) { + if (newModules.includes(moduleName)) { + continue; + } + + moduleRemoved.call(this, moduleName); + this.modules.delete(moduleName); + } +} diff --git a/ee/packages/license/src/pendingLicense.ts b/ee/packages/license/src/pendingLicense.ts new file mode 100644 index 000000000000..2c2140044336 --- /dev/null +++ b/ee/packages/license/src/pendingLicense.ts @@ -0,0 +1,32 @@ +import type { LicenseManager } from './license'; +import { logger } from './logger'; + +export function setPendingLicense(this: LicenseManager, encryptedLicense: string) { + this.pendingLicense = encryptedLicense; + if (this.pendingLicense) { + logger.info('Storing license as pending validation.'); + } +} + +export function applyPendingLicense(this: LicenseManager) { + if (this.pendingLicense) { + logger.info('Applying pending license.'); + this.setLicense(this.pendingLicense); + } +} + +export function hasPendingLicense(this: LicenseManager) { + return Boolean(this.pendingLicense); +} + +export function isPendingLicense(this: LicenseManager, encryptedLicense: string) { + return !!this.pendingLicense && this.pendingLicense === encryptedLicense; +} + +export function clearPendingLicense(this: LicenseManager) { + if (this.pendingLicense) { + logger.info('Removing pending license.'); + } + + this.pendingLicense = ''; +} diff --git a/ee/packages/license/src/showLicense.ts b/ee/packages/license/src/showLicense.ts new file mode 100644 index 000000000000..3dda60a43b76 --- /dev/null +++ b/ee/packages/license/src/showLicense.ts @@ -0,0 +1,27 @@ +import type { ILicenseV3 } from './definition/ILicenseV3'; +import type { LicenseManager } from './license'; +import { getModules } from './modules'; + +export function showLicense(this: LicenseManager, license: ILicenseV3 | undefined, valid: boolean | undefined) { + if (!process.env.LICENSE_DEBUG || process.env.LICENSE_DEBUG === 'false') { + return; + } + + if (!license || !valid) { + return; + } + + const { + validation: { serverUrls, validPeriods }, + limits, + } = license; + + const modules = getModules.call(this); + + console.log('---- License enabled ----'); + console.log(' url ->', JSON.stringify(serverUrls)); + console.log(' periods ->', JSON.stringify(validPeriods)); + console.log(' limits ->', JSON.stringify(limits)); + console.log(' modules ->', modules.join(', ')); + console.log('-------------------------'); +} diff --git a/ee/packages/license/src/tags.ts b/ee/packages/license/src/tags.ts new file mode 100644 index 000000000000..ca2639678475 --- /dev/null +++ b/ee/packages/license/src/tags.ts @@ -0,0 +1,23 @@ +import type { ILicenseTag } from './definition/ILicenseTag'; + +export const tags = new Set(); + +export const addTag = (tag: ILicenseTag) => { + // make sure to not add duplicated tag names + for (const addedTag of tags) { + if (addedTag.name.toLowerCase() === tag.name.toLowerCase()) { + return; + } + } + + tags.add(tag); +}; + +export const replaceTags = (newTags: ILicenseTag[]) => { + tags.clear(); + for (const tag of newTags) { + addTag(tag); + } +}; + +export const getTags = () => [...tags]; diff --git a/ee/packages/license/src/token.ts b/ee/packages/license/src/token.ts new file mode 100644 index 000000000000..80ecc29b4a3f --- /dev/null +++ b/ee/packages/license/src/token.ts @@ -0,0 +1,59 @@ +import crypto from 'crypto'; + +import { verify, sign, getPairs } from '@rocket.chat/jwt'; + +import type { ILicenseV3 } from './definition/ILicenseV3'; + +const PUBLIC_KEY_V2 = + 'LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQ0lqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FnOEFNSUlDQ2dLQ0FnRUFxV1Nza2Q5LzZ6Ung4a3lQY2ljcwpiMzJ3Mnd4VnV3N3lCVDk2clEvOEQreU1lQ01POXdTU3BIYS85bkZ5d293RXRpZ3B0L3dyb1BOK1ZHU3didHdQCkZYQmVxRWxCbmRHRkFsODZlNStFbGlIOEt6L2hHbkNtSk5tWHB4RUsyUkUwM1g0SXhzWVg3RERCN010eC9pcXMKY2pCL091dlNCa2ppU2xlUzdibE5JVC9kQTdLNC9DSjNvaXUwMmJMNEV4Y2xDSGVwenFOTWVQM3dVWmdweE9uZgpOT3VkOElYWUs3M3pTY3VFOEUxNTdZd3B6Q0twVmFIWDdaSmY4UXVOc09PNVcvYUlqS2wzTDYyNjkrZUlPRXJHCndPTm1hSG56Zmc5RkxwSmh6Z3BPMzhhVm43NnZENUtLakJhaldza1krNGEyZ1NRbUtOZUZxYXFPb3p5RUZNMGUKY0ZXWlZWWjNMZWg0dkVNb1lWUHlJeng5Nng4ZjIveW1QbmhJdXZRdjV3TjRmeWVwYTdFWTVVQ2NwNzF6OGtmUAo0RmNVelBBMElEV3lNaWhYUi9HNlhnUVFaNEdiL3FCQmh2cnZpSkNGemZZRGNKZ0w3RmVnRllIUDNQR0wwN1FnCnZMZXZNSytpUVpQcnhyYnh5U3FkUE9rZ3VyS2pWclhUVXI0QTlUZ2lMeUlYNVVsSnEzRS9SVjdtZk9xWm5MVGEKU0NWWEhCaHVQbG5DR1pSMDFUb1RDZktoTUcxdTBDRm5MMisxNWhDOWZxT21XdjlRa2U0M3FsSjBQZ0YzVkovWAp1eC9tVHBuazlnbmJHOUpIK21mSDM5Um9GdlROaW5Zd1NNdll6dXRWT242OXNPemR3aERsYTkwbDNBQ2g0eENWCks3Sk9YK3VIa29OdTNnMmlWeGlaVU0wQ0F3RUFBUT09Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo='; + +const PUBLIC_KEY_V3 = ''; + +let TEST_KEYS: [string, string] | undefined = undefined; + +export async function decrypt(encrypted: string): Promise { + if (process.env.NODE_ENV === 'test') { + if (encrypted.startsWith('RCV3_')) { + const jwt = encrypted.substring(5); + + TEST_KEYS = TEST_KEYS ?? (await getPairs()); + + if (!TEST_KEYS) { + throw new Error('Missing LICENSE_PUBLIC_KEY_V3'); + } + + const [spki] = TEST_KEYS; + + const [payload] = await verify(jwt, spki); + return JSON.stringify(payload); + } + } + + // handle V3 + if (encrypted.startsWith('RCV3_')) { + const jwt = encrypted.substring(5); + const [payload] = await verify(jwt, PUBLIC_KEY_V3); + + return JSON.stringify(payload); + } + + const decrypted = crypto.publicDecrypt(Buffer.from(PUBLIC_KEY_V2, 'base64').toString('utf-8'), Buffer.from(encrypted, 'base64')); + + return decrypted.toString('utf-8'); +} + +export async function encrypt(license: ILicenseV3): Promise { + if (process.env.NODE_ENV !== 'test') { + throw new Error('This function should only be used in tests'); + } + + TEST_KEYS = TEST_KEYS ?? (await getPairs()); + + if (!TEST_KEYS) { + throw new Error('Missing LICENSE_PUBLIC_KEY_V3'); + } + + const [, pkcs8] = TEST_KEYS; + + return `RCV3_${await sign(license, pkcs8)}`; +} diff --git a/apps/meteor/ee/app/license/server/bundles.ts b/ee/packages/license/src/v2/bundles.ts similarity index 100% rename from apps/meteor/ee/app/license/server/bundles.ts rename to ee/packages/license/src/v2/bundles.ts diff --git a/ee/packages/license/src/v2/convertToV3.ts b/ee/packages/license/src/v2/convertToV3.ts new file mode 100644 index 000000000000..7586f54c8c54 --- /dev/null +++ b/ee/packages/license/src/v2/convertToV3.ts @@ -0,0 +1,114 @@ +/** + * FromV2ToV3 + * Transform a License V2 into a V3 representation. + */ + +import type { ILicenseV2 } from '../definition/ILicenseV2'; +import type { ILicenseV3 } from '../definition/ILicenseV3'; +import type { LicenseModule } from '../definition/LicenseModule'; +import { isBundle, getBundleFromModule, getBundleModules } from './bundles'; +import { getTagColor } from './getTagColor'; + +export const convertToV3 = (v2: ILicenseV2): ILicenseV3 => { + return { + version: '3.0', + information: { + autoRenew: false, + visualExpiration: new Date(Date.parse(v2.meta?.trialEnd || v2.expiry)).toISOString(), + trial: v2.meta?.trial || false, + offline: false, + createdAt: new Date().toISOString(), + grantedBy: { + method: 'manual', + seller: 'V2', + }, + // if no tag present, it means it is an old license, so try check for bundles and use them as tags + tags: v2.tag + ? [v2.tag] + : [ + ...(v2.modules.filter(isBundle).map(getBundleFromModule).filter(Boolean) as string[]).map((tag) => ({ + name: tag, + color: getTagColor(tag), + })), + ], + }, + validation: { + serverUrls: [ + { + value: v2.url, + type: 'url', + }, + ], + validPeriods: [ + { + validUntil: new Date(Date.parse(v2.expiry)).toISOString(), + invalidBehavior: 'invalidate_license', + }, + ], + statisticsReport: { + required: true, + }, + }, + grantedModules: [ + ...new Set( + v2.modules + .map((licenseModule) => (isBundle(licenseModule) ? getBundleModules(licenseModule) : [licenseModule])) + .reduce((prev, curr) => [...prev, ...curr], []) + .map((licenseModule) => ({ module: licenseModule as LicenseModule })), + ), + ], + limits: { + ...(v2.maxActiveUsers + ? { + activeUsers: [ + { + max: v2.maxActiveUsers, + behavior: 'prevent_action', + }, + ], + } + : {}), + ...(v2.maxGuestUsers + ? { + guestUsers: [ + { + max: v2.maxGuestUsers, + behavior: 'prevent_action', + }, + ], + } + : {}), + ...(v2.maxRoomsPerGuest + ? { + roomsPerGuest: [ + { + max: v2.maxRoomsPerGuest, + behavior: 'prevent_action', + }, + ], + } + : {}), + ...(v2.apps?.maxPrivateApps + ? { + privateApps: [ + { + max: v2.apps.maxPrivateApps, + behavior: 'prevent_action', + }, + ], + } + : {}), + ...(v2.apps?.maxMarketplaceApps + ? { + marketplaceApps: [ + { + max: v2.apps.maxMarketplaceApps, + behavior: 'prevent_action', + }, + ], + } + : {}), + }, + cloudMeta: v2.meta, + }; +}; diff --git a/apps/meteor/ee/app/license/server/getTagColor.ts b/ee/packages/license/src/v2/getTagColor.ts similarity index 100% rename from apps/meteor/ee/app/license/server/getTagColor.ts rename to ee/packages/license/src/v2/getTagColor.ts diff --git a/ee/packages/license/src/validation/getCurrentValueForLicenseLimit.ts b/ee/packages/license/src/validation/getCurrentValueForLicenseLimit.ts new file mode 100644 index 000000000000..88cedc6c7bc9 --- /dev/null +++ b/ee/packages/license/src/validation/getCurrentValueForLicenseLimit.ts @@ -0,0 +1,40 @@ +import type { IUser } from '@rocket.chat/core-typings'; + +import type { LicenseLimitKind } from '../definition/ILicenseV3'; +import type { LicenseManager } from '../license'; +import { logger } from '../logger'; +import { applyPendingLicense, hasPendingLicense } from '../pendingLicense'; + +type LimitContext = T extends 'roomsPerGuest' ? { userId: IUser['_id'] } : Record; + +export function setLicenseLimitCounter( + this: LicenseManager, + limitKey: T, + fn: (context?: LimitContext) => Promise | number, +) { + this.dataCounters.set(limitKey, fn as (context?: LimitContext) => Promise); + + if (hasPendingLicense.call(this) && hasAllDataCounters.call(this)) { + void applyPendingLicense.call(this); + } +} + +export async function getCurrentValueForLicenseLimit( + this: LicenseManager, + limitKey: T, + context?: Partial>, +): Promise { + const counterFn = this.dataCounters.get(limitKey); + if (!counterFn) { + logger.error({ msg: 'Unable to validate license limit due to missing data counter.', limitKey }); + throw new Error('Unable to validate license limit due to missing data counter.'); + } + + return counterFn(context as LimitContext | undefined); +} + +export function hasAllDataCounters(this: LicenseManager) { + return ( + ['activeUsers', 'guestUsers', 'roomsPerGuest', 'privateApps', 'marketplaceApps', 'monthlyActiveContacts'] as LicenseLimitKind[] + ).every((limitKey) => this.dataCounters.has(limitKey)); +} diff --git a/ee/packages/license/src/validation/getModulesToDisable.ts b/ee/packages/license/src/validation/getModulesToDisable.ts new file mode 100644 index 000000000000..d42426e8af26 --- /dev/null +++ b/ee/packages/license/src/validation/getModulesToDisable.ts @@ -0,0 +1,15 @@ +import type { BehaviorWithContext, LicenseBehavior } from '../definition/LicenseBehavior'; +import type { LicenseModule } from '../definition/LicenseModule'; + +const filterValidationResult = (result: BehaviorWithContext[], expectedBehavior: LicenseBehavior) => + result.filter(({ behavior }) => behavior === expectedBehavior) as BehaviorWithContext[]; + +export const getModulesToDisable = (validationResult: BehaviorWithContext[]): LicenseModule[] => { + return [ + ...new Set([ + ...filterValidationResult(validationResult, 'disable_modules') + .map(({ modules }) => modules || []) + .flat(), + ]), + ]; +}; diff --git a/ee/packages/license/src/validation/getResultingBehavior.ts b/ee/packages/license/src/validation/getResultingBehavior.ts new file mode 100644 index 000000000000..47e2d91b8b89 --- /dev/null +++ b/ee/packages/license/src/validation/getResultingBehavior.ts @@ -0,0 +1,20 @@ +import type { BehaviorWithContext } from '../definition/LicenseBehavior'; +import type { LicenseLimit } from '../definition/LicenseLimit'; +import type { LicensePeriod } from '../definition/LicensePeriod'; + +export const getResultingBehavior = (data: LicenseLimit | LicensePeriod | Partial): BehaviorWithContext => { + const behavior = 'invalidBehavior' in data ? data.invalidBehavior : data.behavior; + + switch (behavior) { + case 'disable_modules': + return { + behavior, + modules: ('modules' in data && data.modules) || [], + }; + + default: + return { + behavior, + } as BehaviorWithContext; + } +}; diff --git a/ee/packages/license/src/validation/isBehaviorsInResult.ts b/ee/packages/license/src/validation/isBehaviorsInResult.ts new file mode 100644 index 000000000000..7e6ed89db8ec --- /dev/null +++ b/ee/packages/license/src/validation/isBehaviorsInResult.ts @@ -0,0 +1,4 @@ +import type { BehaviorWithContext, LicenseBehavior } from '../definition/LicenseBehavior'; + +export const isBehaviorsInResult = (result: BehaviorWithContext[], expectedBehaviors: LicenseBehavior[]) => + result.some(({ behavior }) => expectedBehaviors.includes(behavior)); diff --git a/ee/packages/license/src/validation/isReadyForValidation.ts b/ee/packages/license/src/validation/isReadyForValidation.ts new file mode 100644 index 000000000000..aa763bf7f353 --- /dev/null +++ b/ee/packages/license/src/validation/isReadyForValidation.ts @@ -0,0 +1,7 @@ +import type { LicenseManager } from '../license'; +import { hasAllDataCounters } from './getCurrentValueForLicenseLimit'; + +// Can only validate licenses once the workspace URL and the data counter functions are set +export function isReadyForValidation(this: LicenseManager) { + return Boolean(this.getWorkspaceUrl() && hasAllDataCounters.call(this)); +} diff --git a/ee/packages/license/src/validation/runValidation.spec.ts b/ee/packages/license/src/validation/runValidation.spec.ts new file mode 100644 index 000000000000..98797c86cd27 --- /dev/null +++ b/ee/packages/license/src/validation/runValidation.spec.ts @@ -0,0 +1,38 @@ +/** + * @jest-environment node + */ + +import { MockedLicenseBuilder, getReadyLicenseManager } from '../../__tests__/MockedLicenseBuilder'; +import { runValidation } from './runValidation'; + +describe('Validation behaviors', () => { + it('should return a behavior if the license period is invalid', async () => { + const licenseManager = await getReadyLicenseManager(); + + // two days ago + const validFrom = new Date(new Date().setDate(new Date().getDate() - 2)); + // one day ago + const validUntil = new Date(new Date().setDate(new Date().getDate() - 1)); + + const license = await new MockedLicenseBuilder().resetValidPeriods().withValidPeriod({ + validFrom: validFrom.toISOString(), + validUntil: validUntil.toISOString(), + invalidBehavior: 'disable_modules', + modules: ['livechat-enterprise'], + }); + + await expect( + runValidation.call(licenseManager, await license.build(), [ + 'invalidate_license', + 'prevent_installation', + 'start_fair_policy', + 'disable_modules', + ]), + ).resolves.toStrictEqual([ + { + behavior: 'disable_modules', + modules: ['livechat-enterprise'], + }, + ]); + }); +}); diff --git a/ee/packages/license/src/validation/runValidation.ts b/ee/packages/license/src/validation/runValidation.ts new file mode 100644 index 000000000000..9cb623b8eae0 --- /dev/null +++ b/ee/packages/license/src/validation/runValidation.ts @@ -0,0 +1,22 @@ +import type { ILicenseV3 } from '../definition/ILicenseV3'; +import type { LicenseBehavior, BehaviorWithContext } from '../definition/LicenseBehavior'; +import type { LicenseManager } from '../license'; +import { validateLicenseLimits } from './validateLicenseLimits'; +import { validateLicensePeriods } from './validateLicensePeriods'; +import { validateLicenseUrl } from './validateLicenseUrl'; + +export async function runValidation( + this: LicenseManager, + license: ILicenseV3, + behaviorsToValidate: LicenseBehavior[] = [], +): Promise { + const shouldValidateBehavior = (behavior: LicenseBehavior) => !behaviorsToValidate.length || behaviorsToValidate.includes(behavior); + + return [ + ...new Set([ + ...validateLicenseUrl.call(this, license, shouldValidateBehavior), + ...validateLicensePeriods(license, shouldValidateBehavior), + ...(await validateLicenseLimits.call(this, license, shouldValidateBehavior)), + ]), + ]; +} diff --git a/ee/packages/license/src/validation/validateFormat.ts b/ee/packages/license/src/validation/validateFormat.ts new file mode 100644 index 000000000000..a8c2488cd9fc --- /dev/null +++ b/ee/packages/license/src/validation/validateFormat.ts @@ -0,0 +1,16 @@ +import { InvalidLicenseError } from '../errors/InvalidLicenseError'; +import { decrypt } from '../token'; + +export const validateFormat = async (encryptedLicense: string): Promise => { + if (!encryptedLicense || String(encryptedLicense).trim() === '') { + throw new InvalidLicenseError('Empty license'); + } + + try { + await decrypt(encryptedLicense); + } catch (e) { + throw new InvalidLicenseError(); + } + + return true; +}; diff --git a/ee/packages/license/src/validation/validateLicenseLimits.ts b/ee/packages/license/src/validation/validateLicenseLimits.ts new file mode 100644 index 000000000000..168effe6a250 --- /dev/null +++ b/ee/packages/license/src/validation/validateLicenseLimits.ts @@ -0,0 +1,39 @@ +import type { ILicenseV3 } from '../definition/ILicenseV3'; +import type { BehaviorWithContext, LicenseBehavior } from '../definition/LicenseBehavior'; +import type { LicenseManager } from '../license'; +import { logger } from '../logger'; +import { getCurrentValueForLicenseLimit } from './getCurrentValueForLicenseLimit'; +import { getResultingBehavior } from './getResultingBehavior'; + +export async function validateLicenseLimits( + this: LicenseManager, + license: ILicenseV3, + behaviorFilter: (behavior: LicenseBehavior) => boolean, +): Promise { + const { limits } = license; + + const limitKeys = Object.keys(limits) as (keyof ILicenseV3['limits'])[]; + return ( + await Promise.all( + limitKeys.map(async (limitKey) => { + // Filter the limit list before running any query in the database so we don't end up loading some value we won't use. + const limitList = limits[limitKey]?.filter(({ behavior, max }) => max >= 0 && behaviorFilter(behavior)); + if (!limitList?.length) { + return []; + } + + const currentValue = await getCurrentValueForLicenseLimit.call(this, limitKey); + return limitList + .filter(({ max }) => max < currentValue) + .map((limit) => { + logger.error({ + msg: 'Limit validation failed', + kind: limitKey, + limit, + }); + return getResultingBehavior(limit); + }); + }), + ) + ).flat(); +} diff --git a/ee/packages/license/src/validation/validateLicensePeriods.ts b/ee/packages/license/src/validation/validateLicensePeriods.ts new file mode 100644 index 000000000000..5b3fae433e38 --- /dev/null +++ b/ee/packages/license/src/validation/validateLicensePeriods.ts @@ -0,0 +1,38 @@ +import type { ILicenseV3 } from '../definition/ILicenseV3'; +import type { BehaviorWithContext, LicenseBehavior } from '../definition/LicenseBehavior'; +import type { Timestamp } from '../definition/LicensePeriod'; +import { logger } from '../logger'; +import { getResultingBehavior } from './getResultingBehavior'; + +export const isPeriodInvalid = (from: Timestamp | undefined, until: Timestamp | undefined) => { + const now = new Date(); + + if (from && now < new Date(from)) { + return true; + } + + if (until && now > new Date(until)) { + return true; + } + + return false; +}; + +export const validateLicensePeriods = ( + license: ILicenseV3, + behaviorFilter: (behavior: LicenseBehavior) => boolean, +): BehaviorWithContext[] => { + const { + validation: { validPeriods }, + } = license; + + return validPeriods + .filter(({ validFrom, validUntil, invalidBehavior }) => behaviorFilter(invalidBehavior) && isPeriodInvalid(validFrom, validUntil)) + .map((period) => { + logger.error({ + msg: 'Period validation failed', + period, + }); + return getResultingBehavior(period); + }); +}; diff --git a/ee/packages/license/src/validation/validateLicenseUrl.ts b/ee/packages/license/src/validation/validateLicenseUrl.ts new file mode 100644 index 000000000000..55cd076c4378 --- /dev/null +++ b/ee/packages/license/src/validation/validateLicenseUrl.ts @@ -0,0 +1,59 @@ +import type { ILicenseV3 } from '../definition/ILicenseV3'; +import type { BehaviorWithContext, LicenseBehavior } from '../definition/LicenseBehavior'; +import type { LicenseManager } from '../license'; +import { logger } from '../logger'; +import { getResultingBehavior } from './getResultingBehavior'; + +export const validateUrl = (licenseURL: string, url: string) => { + licenseURL = licenseURL + .replace(/\./g, '\\.') // convert dots to literal + .replace(/\*/g, '.*'); // convert * to .* + const regex = new RegExp(`^${licenseURL}$`, 'i'); + + return !!regex.exec(url); +}; + +export function validateLicenseUrl( + this: LicenseManager, + license: ILicenseV3, + behaviorFilter: (behavior: LicenseBehavior) => boolean, +): BehaviorWithContext[] { + if (!behaviorFilter('invalidate_license')) { + return []; + } + + const { + validation: { serverUrls }, + } = license; + + const workspaceUrl = this.getWorkspaceUrl(); + + if (!workspaceUrl) { + logger.error('Unable to validate license URL without knowing the workspace URL.'); + return [getResultingBehavior({ behavior: 'invalidate_license' })]; + } + + return serverUrls + .filter((url) => { + switch (url.type) { + case 'regex': + // #TODO + break; + case 'hash': + // #TODO + break; + case 'url': + return !validateUrl(url.value, workspaceUrl); + } + + return false; + }) + .map((url) => { + logger.error({ + msg: 'Url validation failed', + url, + workspaceUrl, + }); + return getResultingBehavior({ behavior: 'invalidate_license' }); + }); +} diff --git a/ee/packages/license/tsconfig.json b/ee/packages/license/tsconfig.json new file mode 100644 index 000000000000..539d1c0af1b8 --- /dev/null +++ b/ee/packages/license/tsconfig.json @@ -0,0 +1,9 @@ +{ + "extends": "../../../tsconfig.base.server.json", + "compilerOptions": { + "declaration": true, + "rootDir": "./src", + "outDir": "./dist" + }, + "include": ["./src/**/*"] +} diff --git a/ee/packages/omnichannel-services/src/OmnichannelTranscript.ts b/ee/packages/omnichannel-services/src/OmnichannelTranscript.ts index 802a6e15d0eb..899d298fb445 100644 --- a/ee/packages/omnichannel-services/src/OmnichannelTranscript.ts +++ b/ee/packages/omnichannel-services/src/OmnichannelTranscript.ts @@ -78,7 +78,7 @@ export class OmnichannelTranscript extends ServiceClass implements IOmnichannelT async started(): Promise { try { - this.shouldWork = await licenseService.hasLicense('scalability'); + this.shouldWork = await licenseService.hasModule('scalability'); } catch (e: unknown) { // ignore } diff --git a/ee/packages/omnichannel-services/src/QueueWorker.ts b/ee/packages/omnichannel-services/src/QueueWorker.ts index 141cb937f475..bfb69362fac6 100644 --- a/ee/packages/omnichannel-services/src/QueueWorker.ts +++ b/ee/packages/omnichannel-services/src/QueueWorker.ts @@ -35,7 +35,7 @@ export class QueueWorker extends ServiceClass implements IQueueWorkerService { async started(): Promise { try { - this.shouldWork = await License.hasLicense('scalability'); + this.shouldWork = await License.hasModule('scalability'); } catch (e: unknown) { // ignore } diff --git a/ee/packages/presence/src/Presence.ts b/ee/packages/presence/src/Presence.ts index 238cd445def4..fb656fc3e158 100755 --- a/ee/packages/presence/src/Presence.ts +++ b/ee/packages/presence/src/Presence.ts @@ -65,7 +65,7 @@ export class Presence extends ServiceClass implements IPresence { try { await Settings.updateValueById('Presence_broadcast_disabled', false); - this.hasLicense = await License.hasLicense('scalability'); + this.hasLicense = await License.hasModule('scalability'); } catch (e: unknown) { // ignore } diff --git a/packages/core-services/src/types/ILicense.ts b/packages/core-services/src/types/ILicense.ts index 7b89a006bfc0..c9247f8887ce 100644 --- a/packages/core-services/src/types/ILicense.ts +++ b/packages/core-services/src/types/ILicense.ts @@ -1,9 +1,9 @@ import type { IServiceClass } from './ServiceClass'; export interface ILicense extends IServiceClass { - hasLicense(feature: string): boolean; + hasModule(feature: string): boolean; - isEnterprise(): boolean; + hasValidLicense(): boolean; getModules(): string[]; diff --git a/packages/core-typings/src/ee/ILicense/ILicense.ts b/packages/core-typings/src/ee/ILicense/ILicense.ts deleted file mode 100644 index 8490ab1d7cbe..000000000000 --- a/packages/core-typings/src/ee/ILicense/ILicense.ts +++ /dev/null @@ -1,20 +0,0 @@ -import type { ILicenseTag } from './ILicenseTag'; - -export interface ILicense { - url: string; - expiry: string; - maxActiveUsers: number; - modules: string[]; - maxGuestUsers: number; - maxRoomsPerGuest: number; - tag?: ILicenseTag; - meta?: { - trial: boolean; - trialEnd: string; - workspaceId: string; - }; - apps?: { - maxPrivateApps: number; - maxMarketplaceApps: number; - }; -} diff --git a/packages/core-typings/src/ee/ILicense/ILicenseTag.ts b/packages/core-typings/src/ee/ILicense/ILicenseTag.ts deleted file mode 100644 index 2f11fdebd5db..000000000000 --- a/packages/core-typings/src/ee/ILicense/ILicenseTag.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface ILicenseTag { - name: string; - color: string; -} diff --git a/packages/core-typings/src/index.ts b/packages/core-typings/src/index.ts index 8cd004dd09f1..459e5680900b 100644 --- a/packages/core-typings/src/index.ts +++ b/packages/core-typings/src/index.ts @@ -39,7 +39,6 @@ export * from './IUserSession'; export * from './IUserStatus'; export * from './IUser'; -export * from './ee/ILicense/ILicense'; export * from './ee/IAuditLog'; export * from './import'; diff --git a/packages/jwt/.eslintrc.json b/packages/jwt/.eslintrc.json new file mode 100644 index 000000000000..a83aeda48e66 --- /dev/null +++ b/packages/jwt/.eslintrc.json @@ -0,0 +1,4 @@ +{ + "extends": ["@rocket.chat/eslint-config"], + "ignorePatterns": ["**/dist"] +} diff --git a/packages/jwt/__tests__/jwt.spec.ts b/packages/jwt/__tests__/jwt.spec.ts new file mode 100644 index 000000000000..302cfdf22c96 --- /dev/null +++ b/packages/jwt/__tests__/jwt.spec.ts @@ -0,0 +1,90 @@ +import { generateKeyPair, exportPKCS8, exportSPKI } from 'jose'; + +import { sign, verify } from '../src/index'; + +it('should sign and verify a jwt with RS256', async () => { + const { publicKey, privateKey } = await generateKeyPair('RS256'); + const spki = await exportSPKI(publicKey); + const pkcs8 = await exportPKCS8(privateKey); + + const licenseV3 = { + information: { + id: '64d28d096400df50b6ace670', + autoRenew: true, + createdAt: '2023-08-08T18:44:25.719+0000', + visualExpiration: '2024-09-08T18:44:25.719+0000', + notifyAdminsAt: '2024-09-01T18:44:25.719+0000', + notifyUsersAt: '2024-09-05T18:44:25.719+0000', + trial: false, + offline: false, + grantedBy: { method: 'manual', seller: 'john.rocketseed@rocket.chat' }, + grantedTo: { name: 'Alice Clientseed', company: 'Client', email: 'alice.clientseed@client.com' }, + legalText: "This license can't be used for reselling", + notes: 'Plan Premium', + tags: [{ name: 'Enterprise', color: '#CCCCCC' }], + }, + validation: { + serverUrls: [{ value: 'https://localhost:3000', type: 'url' }], + serverVersions: [{ value: '6.4' }], + cloudWorkspaceId: 'alks-a9sj0diba09shdiasodjha9s0diha9s9duabsiuhdai0sdh0a9hs09da09s8d09a80s9d8', + serverUniqueId: '64d28d096400df50b6ace670', + validUntil: '2024-09-18T18:44:25.719+0000', + validFrom: '2024-07-08T18:44:25.719+0000', + installationAllowedUntil: '2024-07-09T18:44:25.719+0000', + legalTextAgreement: { type: 'accepted', acceptedVia: 'cloud' }, + statisticsReport: { required: true, allowedStaleInDays: 5 }, + }, + grantedModules: [ + { module: 'auditing' }, + { module: 'canned-responses' }, + { module: 'ldap-enterprise' }, + { module: 'livechat-enterprise' }, + { module: 'voip-enterprise' }, + { module: 'omnichannel-mobile-enterprise' }, + { module: 'engagement-dashboard' }, + { module: 'push-privacy' }, + { module: 'scalability' }, + { module: 'teams-mention' }, + { module: 'saml-enterprise' }, + { module: 'oauth-enterprise' }, + { module: 'device-management' }, + { module: 'federation' }, + { module: 'videoconference-enterprise' }, + { module: 'message-read-receipt' }, + { module: 'outlook-calendar' }, + ], + limits: { + activeUsers: [ + { max: 500, behavior: 'start_fair_policy' }, + { max: 1000, behavior: 'prevent_action' }, + { max: 1100, behavior: 'invalidate_license' }, + ], + guestUsers: [ + { max: 200, behavior: 'start_fair_policy' }, + { max: 400, behavior: 'prevent_action' }, + { max: 500, behavior: 'invalidate_license' }, + ], + roomsPerGuest: [ + { max: 5, behavior: 'start_fair_policy' }, + { max: 10, behavior: 'prevent_action' }, + ], + privateApps: [ + { max: 5, behavior: 'start_fair_policy' }, + { max: 10, behavior: 'prevent_action' }, + { max: 11, behavior: 'invalidate_license' }, + ], + marketplaceApps: [ + { max: 5, behavior: 'start_fair_policy' }, + { max: 10, behavior: 'prevent_action' }, + { max: 11, behavior: 'invalidate_license' }, + ], + }, + cloudMeta: { lastStatisticId: '64d28d096400df50b6ace671' }, + }; + + const token = await sign(licenseV3, pkcs8); + const [payload, protectedHeader] = await verify(token, spki); + + expect(protectedHeader).toEqual({ alg: 'RS256', typ: 'JWT' }); + expect(payload).toEqual(licenseV3); +}); diff --git a/packages/jwt/jest.config.js b/packages/jwt/jest.config.js new file mode 100644 index 000000000000..6231bde11685 --- /dev/null +++ b/packages/jwt/jest.config.js @@ -0,0 +1,5 @@ +/** @type {import('ts-jest').JestConfigWithTsJest} */ +module.exports = { + preset: 'ts-jest', + testEnvironment: 'node', +}; diff --git a/packages/jwt/package.json b/packages/jwt/package.json new file mode 100644 index 000000000000..b6be368917c3 --- /dev/null +++ b/packages/jwt/package.json @@ -0,0 +1,31 @@ +{ + "name": "@rocket.chat/jwt", + "version": "0.0.1", + "private": true, + "devDependencies": { + "@types/jest": "~29.5.3", + "eslint": "~8.45.0", + "jest": "~29.6.1", + "ts-jest": "^29.1.1", + "typescript": "~5.2.2" + }, + "scripts": { + "lint": "eslint --ext .js,.jsx,.ts,.tsx .", + "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix", + "test": "jest", + "testunit": "jest", + "build": "rm -rf dist && tsc -p tsconfig.json", + "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput" + }, + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "files": [ + "/dist" + ], + "volta": { + "extends": "../../package.json" + }, + "dependencies": { + "jose": "^4.14.4" + } +} diff --git a/packages/jwt/src/index.ts b/packages/jwt/src/index.ts new file mode 100644 index 000000000000..3508471f9d81 --- /dev/null +++ b/packages/jwt/src/index.ts @@ -0,0 +1,29 @@ +import { SignJWT, importPKCS8, jwtVerify, importSPKI, generateKeyPair, exportSPKI, exportPKCS8 } from 'jose'; +import type { JWTPayload } from 'jose'; + +export async function sign(keyObject: object, pkcs8: string, alg = 'RS256') { + const privateKey = await importPKCS8(pkcs8, alg); + + const token = await new SignJWT(keyObject as JWTPayload).setProtectedHeader({ alg, typ: 'JWT' }).sign(privateKey); + + return token; +} + +export async function verify(jwt: string, spki: string, alg = 'RS256') { + const publicKey = await importSPKI(spki, alg); + + const { payload, protectedHeader } = await jwtVerify(jwt, publicKey, {}); + + return [payload, protectedHeader]; +} + +export async function getPairs(): Promise<[string, string]> { + if (process.env.NODE_ENV !== 'test') { + throw new Error('This function should only be used in tests'); + } + const { publicKey, privateKey } = await generateKeyPair('RS256'); + const spki = await exportSPKI(publicKey); + const pkcs8 = await exportPKCS8(privateKey); + + return [spki, pkcs8]; +} diff --git a/packages/jwt/tsconfig.json b/packages/jwt/tsconfig.json new file mode 100644 index 000000000000..f236186070e8 --- /dev/null +++ b/packages/jwt/tsconfig.json @@ -0,0 +1,10 @@ +{ + "extends": "../../tsconfig.base.server.json", + "compilerOptions": { + "declaration": true, + "module": "commonjs", + "rootDir": "./src", + "outDir": "./dist" + }, + "include": ["./src/**/*"] +} diff --git a/packages/model-typings/src/models/IUsersModel.ts b/packages/model-typings/src/models/IUsersModel.ts index c0ce51f79f45..1ee2a432c3df 100644 --- a/packages/model-typings/src/models/IUsersModel.ts +++ b/packages/model-typings/src/models/IUsersModel.ts @@ -372,7 +372,7 @@ export interface IUsersModel extends IBaseModel { getUsersToSendOfflineEmail(userIds: string[]): FindCursor>; countActiveUsersByService(service: string, options?: FindOptions): Promise; getActiveLocalUserCount(): Promise; - getActiveLocalGuestCount(): Promise; + getActiveLocalGuestCount(exceptions?: IUser['_id'] | IUser['_id'][]): Promise; removeOlderResumeTokensByUserId(userId: string, fromDate: Date): Promise; findAllUsersWithPendingAvatar(): FindCursor; updateCustomFieldsById(userId: string, customFields: Record): Promise; diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 8b6f60f294b3..9da7694d28b9 100644 --- a/packages/rest-typings/package.json +++ b/packages/rest-typings/package.json @@ -26,6 +26,7 @@ "dependencies": { "@rocket.chat/apps-engine": "1.41.0-alpha.290", "@rocket.chat/core-typings": "workspace:^", + "@rocket.chat/license": "workspace:^", "@rocket.chat/message-parser": "next", "@rocket.chat/ui-kit": "^0.32.1", "ajv": "^8.11.0", diff --git a/packages/rest-typings/src/v1/licenses.ts b/packages/rest-typings/src/v1/licenses.ts index c6d102a967e4..96c67e2654bb 100644 --- a/packages/rest-typings/src/v1/licenses.ts +++ b/packages/rest-typings/src/v1/licenses.ts @@ -1,4 +1,4 @@ -import type { ILicense } from '@rocket.chat/core-typings'; +import type { ILicenseV2, ILicenseV3 } from '@rocket.chat/license'; import Ajv from 'ajv'; const ajv = new Ajv({ @@ -24,7 +24,7 @@ export const isLicensesAddProps = ajv.compile(licensesAddProps export type LicensesEndpoints = { '/v1/licenses.get': { - GET: () => { licenses: Array }; + GET: () => { licenses: Array }; }; '/v1/licenses.add': { POST: (params: licensesAddProps) => void; diff --git a/yarn.lock b/yarn.lock index 145079c6eb7a..a3d8d34c8906 100644 --- a/yarn.lock +++ b/yarn.lock @@ -966,6 +966,33 @@ __metadata: languageName: node linkType: hard +"@babel/cli@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/cli@npm:7.23.0" + dependencies: + "@jridgewell/trace-mapping": ^0.3.17 + "@nicolo-ribaudo/chokidar-2": 2.1.8-no-fsevents.3 + chokidar: ^3.4.0 + commander: ^4.0.1 + convert-source-map: ^2.0.0 + fs-readdir-recursive: ^1.1.0 + glob: ^7.2.0 + make-dir: ^2.1.0 + slash: ^2.0.0 + peerDependencies: + "@babel/core": ^7.0.0-0 + dependenciesMeta: + "@nicolo-ribaudo/chokidar-2": + optional: true + chokidar: + optional: true + bin: + babel: ./bin/babel.js + babel-external-helpers: ./bin/babel-external-helpers.js + checksum: beeb189560bf9c4ea951ef637eefa5214654678fb09c4aaa6695921037059c1e1553c610fe95fbd19a9cdfd9f5598a812fc13df40a6b9a9ea899e43fc6c42052 + languageName: node + linkType: hard + "@babel/code-frame@npm:7.12.11": version: 7.12.11 resolution: "@babel/code-frame@npm:7.12.11" @@ -975,20 +1002,20 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.22.10, @babel/code-frame@npm:^7.22.5, @babel/code-frame@npm:^7.5.5, @babel/code-frame@npm:^7.8.3": - version: 7.22.10 - resolution: "@babel/code-frame@npm:7.22.10" +"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.10.4, @babel/code-frame@npm:^7.12.13, @babel/code-frame@npm:^7.22.10, @babel/code-frame@npm:^7.22.13, @babel/code-frame@npm:^7.5.5, @babel/code-frame@npm:^7.8.3": + version: 7.22.13 + resolution: "@babel/code-frame@npm:7.22.13" dependencies: - "@babel/highlight": ^7.22.10 + "@babel/highlight": ^7.22.13 chalk: ^2.4.2 - checksum: 89a06534ad19759da6203a71bad120b1d7b2ddc016c8e07d4c56b35dea25e7396c6da60a754e8532a86733092b131ae7f661dbe6ba5d165ea777555daa2ed3c9 + checksum: 22e342c8077c8b77eeb11f554ecca2ba14153f707b85294fcf6070b6f6150aae88a7b7436dd88d8c9289970585f3fe5b9b941c5aa3aa26a6d5a8ef3f292da058 languageName: node linkType: hard -"@babel/compat-data@npm:^7.20.5, @babel/compat-data@npm:^7.22.5, @babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.22.9": - version: 7.22.9 - resolution: "@babel/compat-data@npm:7.22.9" - checksum: bed77d9044ce948b4327b30dd0de0779fa9f3a7ed1f2d31638714ed00229fa71fc4d1617ae0eb1fad419338d3658d0e9a5a083297451e09e73e078d0347ff808 +"@babel/compat-data@npm:^7.20.5, @babel/compat-data@npm:^7.22.20, @babel/compat-data@npm:^7.22.6, @babel/compat-data@npm:^7.22.9": + version: 7.22.20 + resolution: "@babel/compat-data@npm:7.22.20" + checksum: efedd1d18878c10fde95e4d82b1236a9aba41395ef798cbb651f58dbf5632dbff475736c507b8d13d4c8f44809d41c0eb2ef0d694283af9ba5dd8339b6dab451 languageName: node linkType: hard @@ -1016,7 +1043,30 @@ __metadata: languageName: node linkType: hard -"@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.20.7, @babel/core@npm:^7.21.4, @babel/core@npm:^7.7.5, @babel/core@npm:~7.22.10, @babel/core@npm:~7.22.9": +"@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.20.7, @babel/core@npm:^7.21.4, @babel/core@npm:^7.23.0, @babel/core@npm:^7.7.5": + version: 7.23.0 + resolution: "@babel/core@npm:7.23.0" + dependencies: + "@ampproject/remapping": ^2.2.0 + "@babel/code-frame": ^7.22.13 + "@babel/generator": ^7.23.0 + "@babel/helper-compilation-targets": ^7.22.15 + "@babel/helper-module-transforms": ^7.23.0 + "@babel/helpers": ^7.23.0 + "@babel/parser": ^7.23.0 + "@babel/template": ^7.22.15 + "@babel/traverse": ^7.23.0 + "@babel/types": ^7.23.0 + convert-source-map: ^2.0.0 + debug: ^4.1.0 + gensync: ^1.0.0-beta.2 + json5: ^2.2.3 + semver: ^6.3.1 + checksum: cebd9b48dbc970a7548522f207f245c69567e5ea17ebb1a4e4de563823cf20a01177fe8d2fe19b6e1461361f92fa169fd0b29f8ee9d44eeec84842be1feee5f2 + languageName: node + linkType: hard + +"@babel/core@npm:~7.22.10, @babel/core@npm:~7.22.9": version: 7.22.10 resolution: "@babel/core@npm:7.22.10" dependencies: @@ -1053,15 +1103,15 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.12.5, @babel/generator@npm:^7.22.10, @babel/generator@npm:^7.7.2": - version: 7.22.10 - resolution: "@babel/generator@npm:7.22.10" +"@babel/generator@npm:^7.12.11, @babel/generator@npm:^7.12.5, @babel/generator@npm:^7.22.10, @babel/generator@npm:^7.23.0, @babel/generator@npm:^7.7.2": + version: 7.23.0 + resolution: "@babel/generator@npm:7.23.0" dependencies: - "@babel/types": ^7.22.10 + "@babel/types": ^7.23.0 "@jridgewell/gen-mapping": ^0.3.2 "@jridgewell/trace-mapping": ^0.3.17 jsesc: ^2.5.1 - checksum: 59a79730abdff9070692834bd3af179e7a9413fa2ff7f83dff3eb888765aeaeb2bfc7b0238a49613ed56e1af05956eff303cc139f2407eda8df974813e486074 + checksum: 8efe24adad34300f1f8ea2add420b28171a646edc70f2a1b3e1683842f23b8b7ffa7e35ef0119294e1901f45bfea5b3dc70abe1f10a1917ccdfb41bed69be5f1 languageName: node linkType: hard @@ -1083,35 +1133,35 @@ __metadata: languageName: node linkType: hard -"@babel/helper-compilation-targets@npm:^7.13.0, @babel/helper-compilation-targets@npm:^7.20.7, @babel/helper-compilation-targets@npm:^7.22.10, @babel/helper-compilation-targets@npm:^7.22.5, @babel/helper-compilation-targets@npm:^7.22.6": - version: 7.22.10 - resolution: "@babel/helper-compilation-targets@npm:7.22.10" +"@babel/helper-compilation-targets@npm:^7.13.0, @babel/helper-compilation-targets@npm:^7.20.7, @babel/helper-compilation-targets@npm:^7.22.10, @babel/helper-compilation-targets@npm:^7.22.15, @babel/helper-compilation-targets@npm:^7.22.5, @babel/helper-compilation-targets@npm:^7.22.6": + version: 7.22.15 + resolution: "@babel/helper-compilation-targets@npm:7.22.15" dependencies: "@babel/compat-data": ^7.22.9 - "@babel/helper-validator-option": ^7.22.5 + "@babel/helper-validator-option": ^7.22.15 browserslist: ^4.21.9 lru-cache: ^5.1.1 semver: ^6.3.1 - checksum: f6f1896816392bcff671bbe6e277307729aee53befb4a66ea126e2a91eda78d819a70d06fa384c74ef46c1595544b94dca50bef6c78438d9ffd31776dafbd435 + checksum: ce85196769e091ae54dd39e4a80c2a9df1793da8588e335c383d536d54f06baf648d0a08fc873044f226398c4ded15c4ae9120ee18e7dfd7c639a68e3cdc9980 languageName: node linkType: hard -"@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.21.0, @babel/helper-create-class-features-plugin@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-create-class-features-plugin@npm:7.22.5" +"@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.21.0, @babel/helper-create-class-features-plugin@npm:^7.22.11, @babel/helper-create-class-features-plugin@npm:^7.22.15, @babel/helper-create-class-features-plugin@npm:^7.22.5": + version: 7.22.15 + resolution: "@babel/helper-create-class-features-plugin@npm:7.22.15" dependencies: "@babel/helper-annotate-as-pure": ^7.22.5 "@babel/helper-environment-visitor": ^7.22.5 "@babel/helper-function-name": ^7.22.5 - "@babel/helper-member-expression-to-functions": ^7.22.5 + "@babel/helper-member-expression-to-functions": ^7.22.15 "@babel/helper-optimise-call-expression": ^7.22.5 - "@babel/helper-replace-supers": ^7.22.5 + "@babel/helper-replace-supers": ^7.22.9 "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 - "@babel/helper-split-export-declaration": ^7.22.5 - semver: ^6.3.0 + "@babel/helper-split-export-declaration": ^7.22.6 + semver: ^6.3.1 peerDependencies: "@babel/core": ^7.0.0 - checksum: f1e91deae06dbee6dd956c0346bca600adfbc7955427795d9d8825f0439a3c3290c789ba2b4a02a1cdf6c1a1bd163dfa16d3d5e96b02a8efb639d2a774e88ed9 + checksum: 52c500d8d164abb3a360b1b7c4b8fff77bc4a5920d3a2b41ae6e1d30617b0dc0b972c1f5db35b1752007e04a748908b4a99bc872b73549ae837e87dcdde005a3 languageName: node linkType: hard @@ -1161,20 +1211,20 @@ __metadata: languageName: node linkType: hard -"@babel/helper-environment-visitor@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-environment-visitor@npm:7.22.5" - checksum: 248532077d732a34cd0844eb7b078ff917c3a8ec81a7f133593f71a860a582f05b60f818dc5049c2212e5baa12289c27889a4b81d56ef409b4863db49646c4b1 +"@babel/helper-environment-visitor@npm:^7.22.20, @babel/helper-environment-visitor@npm:^7.22.5": + version: 7.22.20 + resolution: "@babel/helper-environment-visitor@npm:7.22.20" + checksum: d80ee98ff66f41e233f36ca1921774c37e88a803b2f7dca3db7c057a5fea0473804db9fb6729e5dbfd07f4bed722d60f7852035c2c739382e84c335661590b69 languageName: node linkType: hard -"@babel/helper-function-name@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-function-name@npm:7.22.5" +"@babel/helper-function-name@npm:^7.22.5, @babel/helper-function-name@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/helper-function-name@npm:7.23.0" dependencies: - "@babel/template": ^7.22.5 - "@babel/types": ^7.22.5 - checksum: 6b1f6ce1b1f4e513bf2c8385a557ea0dd7fa37971b9002ad19268ca4384bbe90c09681fe4c076013f33deabc63a53b341ed91e792de741b4b35e01c00238177a + "@babel/template": ^7.22.15 + "@babel/types": ^7.23.0 + checksum: e44542257b2d4634a1f979244eb2a4ad8e6d75eb6761b4cfceb56b562f7db150d134bc538c8e6adca3783e3bc31be949071527aa8e3aab7867d1ad2d84a26e10 languageName: node linkType: hard @@ -1187,36 +1237,36 @@ __metadata: languageName: node linkType: hard -"@babel/helper-member-expression-to-functions@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-member-expression-to-functions@npm:7.22.5" +"@babel/helper-member-expression-to-functions@npm:^7.22.15": + version: 7.23.0 + resolution: "@babel/helper-member-expression-to-functions@npm:7.23.0" dependencies: - "@babel/types": ^7.22.5 - checksum: 4bd5791529c280c00743e8bdc669ef0d4cd1620d6e3d35e0d42b862f8262bc2364973e5968007f960780344c539a4b9cf92ab41f5b4f94560a9620f536de2a39 + "@babel/types": ^7.23.0 + checksum: 494659361370c979ada711ca685e2efe9460683c36db1b283b446122596602c901e291e09f2f980ecedfe6e0f2bd5386cb59768285446530df10c14df1024e75 languageName: node linkType: hard -"@babel/helper-module-imports@npm:^7.12.13, @babel/helper-module-imports@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-module-imports@npm:7.22.5" +"@babel/helper-module-imports@npm:^7.12.13, @babel/helper-module-imports@npm:^7.22.15, @babel/helper-module-imports@npm:^7.22.5": + version: 7.22.15 + resolution: "@babel/helper-module-imports@npm:7.22.15" dependencies: - "@babel/types": ^7.22.5 - checksum: 9ac2b0404fa38b80bdf2653fbeaf8e8a43ccb41bd505f9741d820ed95d3c4e037c62a1bcdcb6c9527d7798d2e595924c4d025daed73283badc180ada2c9c49ad + "@babel/types": ^7.22.15 + checksum: ecd7e457df0a46f889228f943ef9b4a47d485d82e030676767e6a2fdcbdaa63594d8124d4b55fd160b41c201025aec01fc27580352b1c87a37c9c6f33d116702 languageName: node linkType: hard -"@babel/helper-module-transforms@npm:^7.12.1, @babel/helper-module-transforms@npm:^7.22.5, @babel/helper-module-transforms@npm:^7.22.9": - version: 7.22.9 - resolution: "@babel/helper-module-transforms@npm:7.22.9" +"@babel/helper-module-transforms@npm:^7.12.1, @babel/helper-module-transforms@npm:^7.22.5, @babel/helper-module-transforms@npm:^7.22.9, @babel/helper-module-transforms@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/helper-module-transforms@npm:7.23.0" dependencies: - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-module-imports": ^7.22.5 + "@babel/helper-environment-visitor": ^7.22.20 + "@babel/helper-module-imports": ^7.22.15 "@babel/helper-simple-access": ^7.22.5 "@babel/helper-split-export-declaration": ^7.22.6 - "@babel/helper-validator-identifier": ^7.22.5 + "@babel/helper-validator-identifier": ^7.22.20 peerDependencies: "@babel/core": ^7.0.0 - checksum: 2751f77660518cf4ff027514d6f4794f04598c6393be7b04b8e46c6e21606e11c19f3f57ab6129a9c21bacdf8b3ffe3af87bb401d972f34af2d0ffde02ac3001 + checksum: 6e2afffb058cf3f8ce92f5116f710dda4341c81cfcd872f9a0197ea594f7ce0ab3cb940b0590af2fe99e60d2e5448bfba6bca8156ed70a2ed4be2adc8586c891 languageName: node linkType: hard @@ -1256,17 +1306,16 @@ __metadata: languageName: node linkType: hard -"@babel/helper-replace-supers@npm:^7.16.7, @babel/helper-replace-supers@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-replace-supers@npm:7.22.5" +"@babel/helper-replace-supers@npm:^7.16.7, @babel/helper-replace-supers@npm:^7.22.5, @babel/helper-replace-supers@npm:^7.22.9": + version: 7.22.20 + resolution: "@babel/helper-replace-supers@npm:7.22.20" dependencies: - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-member-expression-to-functions": ^7.22.5 + "@babel/helper-environment-visitor": ^7.22.20 + "@babel/helper-member-expression-to-functions": ^7.22.15 "@babel/helper-optimise-call-expression": ^7.22.5 - "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.5 - "@babel/types": ^7.22.5 - checksum: af29deff6c6dc3fa2d1a517390716aa3f4d329855e8689f1d5c3cb07c1b898e614a5e175f1826bb58e9ff1480e6552885a71a9a0ba5161787aaafa2c79b216cc + peerDependencies: + "@babel/core": ^7.0.0 + checksum: a0008332e24daedea2e9498733e3c39b389d6d4512637e000f96f62b797e702ee24a407ccbcd7a236a551590a38f31282829a8ef35c50a3c0457d88218cae639 languageName: node linkType: hard @@ -1288,7 +1337,7 @@ __metadata: languageName: node linkType: hard -"@babel/helper-split-export-declaration@npm:^7.22.5, @babel/helper-split-export-declaration@npm:^7.22.6": +"@babel/helper-split-export-declaration@npm:^7.22.6": version: 7.22.6 resolution: "@babel/helper-split-export-declaration@npm:7.22.6" dependencies: @@ -1304,17 +1353,17 @@ __metadata: languageName: node linkType: hard -"@babel/helper-validator-identifier@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-validator-identifier@npm:7.22.5" - checksum: 7f0f30113474a28298c12161763b49de5018732290ca4de13cdaefd4fd0d635a6fe3f6686c37a02905fb1e64f21a5ee2b55140cf7b070e729f1bd66866506aea +"@babel/helper-validator-identifier@npm:^7.22.20": + version: 7.22.20 + resolution: "@babel/helper-validator-identifier@npm:7.22.20" + checksum: 136412784d9428266bcdd4d91c32bcf9ff0e8d25534a9d94b044f77fe76bc50f941a90319b05aafd1ec04f7d127cd57a179a3716009ff7f3412ef835ada95bdc languageName: node linkType: hard -"@babel/helper-validator-option@npm:^7.16.7, @babel/helper-validator-option@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/helper-validator-option@npm:7.22.5" - checksum: bbeca8a85ee86990215c0424997438b388b8d642d69b9f86c375a174d3cdeb270efafd1ff128bc7a1d370923d13b6e45829ba8581c027620e83e3a80c5c414b3 +"@babel/helper-validator-option@npm:^7.16.7, @babel/helper-validator-option@npm:^7.22.15, @babel/helper-validator-option@npm:^7.22.5": + version: 7.22.15 + resolution: "@babel/helper-validator-option@npm:7.22.15" + checksum: 68da52b1e10002a543161494c4bc0f4d0398c8fdf361d5f7f4272e95c45d5b32d974896d44f6a0ea7378c9204988879d73613ca683e13bd1304e46d25ff67a8d languageName: node linkType: hard @@ -1329,58 +1378,58 @@ __metadata: languageName: node linkType: hard -"@babel/helpers@npm:^7.12.5, @babel/helpers@npm:^7.22.10": - version: 7.22.10 - resolution: "@babel/helpers@npm:7.22.10" +"@babel/helpers@npm:^7.12.5, @babel/helpers@npm:^7.22.10, @babel/helpers@npm:^7.23.0": + version: 7.23.1 + resolution: "@babel/helpers@npm:7.23.1" dependencies: - "@babel/template": ^7.22.5 - "@babel/traverse": ^7.22.10 - "@babel/types": ^7.22.10 - checksum: 3b1219e362df390b6c5d94b75a53fc1c2eb42927ced0b8022d6a29b833a839696206b9bdad45b4805d05591df49fc16b6fb7db758c9c2ecfe99e3e94cb13020f + "@babel/template": ^7.22.15 + "@babel/traverse": ^7.23.0 + "@babel/types": ^7.23.0 + checksum: acfc345102045c24ea2a4d60e00dcf8220e215af3add4520e2167700661338e6a80bd56baf44bb764af05ec6621101c9afc315dc107e18c61fa6da8acbdbb893 languageName: node linkType: hard -"@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.22.10": - version: 7.22.10 - resolution: "@babel/highlight@npm:7.22.10" +"@babel/highlight@npm:^7.10.4, @babel/highlight@npm:^7.22.13": + version: 7.22.20 + resolution: "@babel/highlight@npm:7.22.20" dependencies: - "@babel/helper-validator-identifier": ^7.22.5 + "@babel/helper-validator-identifier": ^7.22.20 chalk: ^2.4.2 js-tokens: ^4.0.0 - checksum: f714a1e1a72dd9d72f6383f4f30fd342e21a8df32d984a4ea8f5eab691bb6ba6db2f8823d4b4cf135d98869e7a98925b81306aa32ee3c429f8cfa52c75889e1b + checksum: 84bd034dca309a5e680083cd827a766780ca63cef37308404f17653d32366ea76262bd2364b2d38776232f2d01b649f26721417d507e8b4b6da3e4e739f6d134 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.20.7, @babel/parser@npm:^7.22.10, @babel/parser@npm:^7.22.5": - version: 7.22.10 - resolution: "@babel/parser@npm:7.22.10" +"@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.20.7, @babel/parser@npm:^7.22.10, @babel/parser@npm:^7.22.15, @babel/parser@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/parser@npm:7.23.0" bin: parser: ./bin/babel-parser.js - checksum: af51567b7d3cdf523bc608eae057397486c7fa6c2e5753027c01fe5c36f0767b2d01ce3049b222841326cc5b8c7fda1d810ac1a01af0a97bb04679e2ef9f7049 + checksum: 453fdf8b9e2c2b7d7b02139e0ce003d1af21947bbc03eb350fb248ee335c9b85e4ab41697ddbdd97079698de825a265e45a0846bb2ed47a2c7c1df833f42a354 languageName: node linkType: hard -"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.22.5" +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:^7.22.15": + version: 7.22.15 + resolution: "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@npm:7.22.15" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0 - checksum: 1e353a060fb2cd8f1256d28cd768f16fb02513f905b9b6d656fb0242c96c341a196fa188b27c2701506a6e27515359fbcc1a5ca7fa8b9b530cf88fbd137baefc + checksum: 8910ca21a7ec7c06f7b247d4b86c97c5aa15ef321518f44f6f490c5912fdf82c605aaa02b90892e375d82ccbedeadfdeadd922c1b836c9dd4c596871bf654753 languageName: node linkType: hard -"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:7.22.5" +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:^7.22.15": + version: 7.22.15 + resolution: "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@npm:7.22.15" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 - "@babel/plugin-transform-optional-chaining": ^7.22.5 + "@babel/plugin-transform-optional-chaining": ^7.22.15 peerDependencies: "@babel/core": ^7.13.0 - checksum: 16e7a5f3bf2f2ac0ca032a70bf0ebd7e886d84dbb712b55c0643c04c495f0f221fbcbca14b5f8f8027fa6c87a3dafae0934022ad2b409384af6c5c356495b7bd + checksum: fbefedc0da014c37f1a50a8094ce7dbbf2181ae93243f23d6ecba2499b5b20196c2124d6a4dfe3e9e0125798e80593103e456352a4beb4e5c6f7c75efb80fdac languageName: node linkType: hard @@ -1798,9 +1847,9 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-async-generator-functions@npm:^7.22.10": - version: 7.22.10 - resolution: "@babel/plugin-transform-async-generator-functions@npm:7.22.10" +"@babel/plugin-transform-async-generator-functions@npm:^7.22.15": + version: 7.22.15 + resolution: "@babel/plugin-transform-async-generator-functions@npm:7.22.15" dependencies: "@babel/helper-environment-visitor": ^7.22.5 "@babel/helper-plugin-utils": ^7.22.5 @@ -1808,7 +1857,7 @@ __metadata: "@babel/plugin-syntax-async-generators": ^7.8.4 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 87d77b66fda05b42450aa285fa031aa3963c52aab00190f95f6c3ddefbed683035c1f314347c888f8406fba5d436b888ff75b5e36b8ab23afd4ca4c3f086f88c + checksum: fad98786b446ce63bde0d14a221e2617eef5a7bbca62b49d96f16ab5e1694521234cfba6145b830fbf9af16d60a8a3dbf148e8694830bd91796fe333b0599e73 languageName: node linkType: hard @@ -1836,14 +1885,14 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-block-scoping@npm:^7.12.12, @babel/plugin-transform-block-scoping@npm:^7.22.10": - version: 7.22.10 - resolution: "@babel/plugin-transform-block-scoping@npm:7.22.10" +"@babel/plugin-transform-block-scoping@npm:^7.12.12, @babel/plugin-transform-block-scoping@npm:^7.22.15": + version: 7.23.0 + resolution: "@babel/plugin-transform-block-scoping@npm:7.23.0" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: b1d06f358dedcb748a57e5feea4b9285c60593fb2912b921f22898c57c552c78fe18128678c8f84dd4ea1d4e5aebede8783830b24cd63f22c30261156d78bc77 + checksum: 0cfe925cc3b5a3ad407e2253fab3ceeaa117a4b291c9cb245578880872999bca91bd83ffa0128ae9ca356330702e1ef1dcb26804f28d2cef678239caf629f73e languageName: node linkType: hard @@ -1859,35 +1908,35 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-class-static-block@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-class-static-block@npm:7.22.5" +"@babel/plugin-transform-class-static-block@npm:^7.22.11": + version: 7.22.11 + resolution: "@babel/plugin-transform-class-static-block@npm:7.22.11" dependencies: - "@babel/helper-create-class-features-plugin": ^7.22.5 + "@babel/helper-create-class-features-plugin": ^7.22.11 "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-class-static-block": ^7.14.5 peerDependencies: "@babel/core": ^7.12.0 - checksum: bc48b92dbaf625a14f2bf62382384eef01e0515802426841636ae9146e27395d068c7a8a45e9e15699491b0a01d990f38f179cbc9dc89274a393f85648772f12 + checksum: 69f040506fad66f1c6918d288d0e0edbc5c8a07c8b4462c1184ad2f9f08995d68b057126c213871c0853ae0c72afc60ec87492049dfacb20902e32346a448bcb languageName: node linkType: hard -"@babel/plugin-transform-classes@npm:^7.12.1, @babel/plugin-transform-classes@npm:^7.22.6": - version: 7.22.6 - resolution: "@babel/plugin-transform-classes@npm:7.22.6" +"@babel/plugin-transform-classes@npm:^7.12.1, @babel/plugin-transform-classes@npm:^7.22.15": + version: 7.22.15 + resolution: "@babel/plugin-transform-classes@npm:7.22.15" dependencies: "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-compilation-targets": ^7.22.6 + "@babel/helper-compilation-targets": ^7.22.15 "@babel/helper-environment-visitor": ^7.22.5 "@babel/helper-function-name": ^7.22.5 "@babel/helper-optimise-call-expression": ^7.22.5 "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-replace-supers": ^7.22.5 + "@babel/helper-replace-supers": ^7.22.9 "@babel/helper-split-export-declaration": ^7.22.6 globals: ^11.1.0 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 8380e855c01033dbc7460d9acfbc1fc37c880350fa798c2de8c594ef818ade0e4c96173ec72f05f2a4549d8d37135e18cb62548352d51557b45a0fb4388d2f3f + checksum: d3f4d0c107dd8a3557ea3575cc777fab27efa92958b41e4a9822f7499725c1f554beae58855de16ddec0a7b694e45f59a26cea8fbde4275563f72f09c6e039a0 languageName: node linkType: hard @@ -1903,14 +1952,14 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-destructuring@npm:^7.12.1, @babel/plugin-transform-destructuring@npm:^7.22.10": - version: 7.22.10 - resolution: "@babel/plugin-transform-destructuring@npm:7.22.10" +"@babel/plugin-transform-destructuring@npm:^7.12.1, @babel/plugin-transform-destructuring@npm:^7.22.15": + version: 7.23.0 + resolution: "@babel/plugin-transform-destructuring@npm:7.23.0" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 011707801bd0029fd4f0523d24d06fdc0cbe8c9da280d75728f76713d639c4dc976e1b56a1ba7bff25468f86867efb71c9b4cac81140adbdd0abf2324b19a8bb + checksum: cd6dd454ccc2766be551e4f8a04b1acc2aa539fa19e5c7501c56cc2f8cc921dd41a7ffb78455b4c4b2f954fcab8ca4561ba7c9c7bd5af9f19465243603d18cc3 languageName: node linkType: hard @@ -1937,15 +1986,15 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-dynamic-import@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-dynamic-import@npm:7.22.5" +"@babel/plugin-transform-dynamic-import@npm:^7.22.11": + version: 7.22.11 + resolution: "@babel/plugin-transform-dynamic-import@npm:7.22.11" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-dynamic-import": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 186a6d59f36eb3c5824739fc9c22ed0f4ca68e001662aa3a302634346a8b785cb9579b23b0c158f4570604d697d19598ca09b58c60a7fa2894da1163c4eb1907 + checksum: 78fc9c532210bf9e8f231747f542318568ac360ee6c27e80853962c984283c73da3f8f8aebe83c2096090a435b356b092ed85de617a156cbe0729d847632be45 languageName: node linkType: hard @@ -1961,15 +2010,15 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-export-namespace-from@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-export-namespace-from@npm:7.22.5" +"@babel/plugin-transform-export-namespace-from@npm:^7.22.11": + version: 7.22.11 + resolution: "@babel/plugin-transform-export-namespace-from@npm:7.22.11" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-export-namespace-from": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 3d197b788758044983c96b9c49bed4b456055f35a388521a405968db0f6e2ffb6fd59110e3931f4dcc5e126ae9e5e00e154a0afb47a7ea359d8d0dea79f480d7 + checksum: 73af5883a321ed56a4bfd43c8a7de0164faebe619287706896fc6ee2f7a4e69042adaa1338c0b8b4bdb9f7e5fdceb016fb1d40694cb43ca3b8827429e8aac4bf languageName: node linkType: hard @@ -1985,14 +2034,14 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-for-of@npm:^7.12.1, @babel/plugin-transform-for-of@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-for-of@npm:7.22.5" +"@babel/plugin-transform-for-of@npm:^7.12.1, @babel/plugin-transform-for-of@npm:^7.22.15": + version: 7.22.15 + resolution: "@babel/plugin-transform-for-of@npm:7.22.15" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: d7b8d4db010bce7273674caa95c4e6abd909362866ce297e86a2ecaa9ae636e05d525415811db9b3c942155df7f3651d19b91dd6c41f142f7308a97c7cb06023 + checksum: f395ae7bce31e14961460f56cf751b5d6e37dd27d7df5b1f4e49fec1c11b6f9cf71991c7ffbe6549878591e87df0d66af798cf26edfa4bfa6b4c3dba1fb2f73a languageName: node linkType: hard @@ -2009,15 +2058,15 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-json-strings@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-json-strings@npm:7.22.5" +"@babel/plugin-transform-json-strings@npm:^7.22.11": + version: 7.22.11 + resolution: "@babel/plugin-transform-json-strings@npm:7.22.11" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-json-strings": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 4e00b902487a670b6c8948f33f9108133fd745cf9d1478aca515fb460b9b2f12e137988ebc1663630fb82070a870aed8b0c1aa4d007a841c18004619798f255c + checksum: 50665e5979e66358c50e90a26db53c55917f78175127ac2fa05c7888d156d418ffb930ec0a109353db0a7c5f57c756ce01bfc9825d24cbfd2b3ec453f2ed8cba languageName: node linkType: hard @@ -2032,15 +2081,15 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-logical-assignment-operators@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-logical-assignment-operators@npm:7.22.5" +"@babel/plugin-transform-logical-assignment-operators@npm:^7.22.11": + version: 7.22.11 + resolution: "@babel/plugin-transform-logical-assignment-operators@npm:7.22.11" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-logical-assignment-operators": ^7.10.4 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 18748e953c08f64885f18c224eac58df10a13eac4d845d16b5d9b6276907da7ca2530dfebe6ed41cdc5f8a75d9db3e36d8eb54ddce7cd0364af1cab09b435302 + checksum: c664e9798e85afa7f92f07b867682dee7392046181d82f5d21bae6f2ca26dfe9c8375cdc52b7483c3fc09a983c1989f60eff9fbc4f373b0c0a74090553d05739 languageName: node linkType: hard @@ -2067,30 +2116,30 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-modules-commonjs@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-modules-commonjs@npm:7.22.5" +"@babel/plugin-transform-modules-commonjs@npm:^7.22.15, @babel/plugin-transform-modules-commonjs@npm:^7.22.5, @babel/plugin-transform-modules-commonjs@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/plugin-transform-modules-commonjs@npm:7.23.0" dependencies: - "@babel/helper-module-transforms": ^7.22.5 + "@babel/helper-module-transforms": ^7.23.0 "@babel/helper-plugin-utils": ^7.22.5 "@babel/helper-simple-access": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 2067aca8f6454d54ffcce69b02c457cfa61428e11372f6a1d99ff4fcfbb55c396ed2ca6ca886bf06c852e38c1a205b8095921b2364fd0243f3e66bc1dda61caa + checksum: 7fb25997194053e167c4207c319ff05362392da841bd9f42ddb3caf9c8798a5d203bd926d23ddf5830fdf05eddc82c2810f40d1287e3a4f80b07eff13d1024b5 languageName: node linkType: hard -"@babel/plugin-transform-modules-systemjs@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-modules-systemjs@npm:7.22.5" +"@babel/plugin-transform-modules-systemjs@npm:^7.22.11": + version: 7.23.0 + resolution: "@babel/plugin-transform-modules-systemjs@npm:7.23.0" dependencies: "@babel/helper-hoist-variables": ^7.22.5 - "@babel/helper-module-transforms": ^7.22.5 + "@babel/helper-module-transforms": ^7.23.0 "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-validator-identifier": ^7.22.5 + "@babel/helper-validator-identifier": ^7.22.20 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 04f4178589543396b3c24330a67a59c5e69af5e96119c9adda730c0f20122deaff54671ebbc72ad2df6495a5db8a758bd96942de95fba7ad427de9c80b1b38c8 + checksum: 2d481458b22605046badea2317d5cc5c94ac3031c2293e34c96f02063f5b02af0979c4da6a8fbc67cc249541575dc9c6d710db6b919ede70b7337a22d9fd57a7 languageName: node linkType: hard @@ -2129,42 +2178,42 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.22.5" +"@babel/plugin-transform-nullish-coalescing-operator@npm:^7.22.11": + version: 7.22.11 + resolution: "@babel/plugin-transform-nullish-coalescing-operator@npm:7.22.11" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-nullish-coalescing-operator": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: e6a059169d257fc61322d0708edae423072449b7c33de396261e68dee582aec5396789a1c22bce84e5bd88a169623c2e750b513fc222930979e6accd52a44bf2 + checksum: 167babecc8b8fe70796a7b7d34af667ebbf43da166c21689502e5e8cc93180b7a85979c77c9f64b7cce431b36718bd0a6df9e5e0ffea4ae22afb22cfef886372 languageName: node linkType: hard -"@babel/plugin-transform-numeric-separator@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-numeric-separator@npm:7.22.5" +"@babel/plugin-transform-numeric-separator@npm:^7.22.11": + version: 7.22.11 + resolution: "@babel/plugin-transform-numeric-separator@npm:7.22.11" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-numeric-separator": ^7.10.4 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 9e7837d4eae04f211ebaa034fe5003d2927b6bf6d5b9dc09f2b1183c01482cdde5a75b8bd5c7ff195c2abc7b923339eb0b2a9d27cb78359d38248a3b2c2367c4 + checksum: af064d06a4a041767ec396a5f258103f64785df290e038bba9f0ef454e6c914f2ac45d862bbdad8fac2c7ad47fa4e95356f29053c60c100a0160b02a995fe2a3 languageName: node linkType: hard -"@babel/plugin-transform-object-rest-spread@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-object-rest-spread@npm:7.22.5" +"@babel/plugin-transform-object-rest-spread@npm:^7.22.15": + version: 7.22.15 + resolution: "@babel/plugin-transform-object-rest-spread@npm:7.22.15" dependencies: - "@babel/compat-data": ^7.22.5 - "@babel/helper-compilation-targets": ^7.22.5 + "@babel/compat-data": ^7.22.9 + "@babel/helper-compilation-targets": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-object-rest-spread": ^7.8.3 - "@babel/plugin-transform-parameters": ^7.22.5 + "@babel/plugin-transform-parameters": ^7.22.15 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 3b5e091f0dc67108f2e41ed5a97e15bbe4381a19d9a7eea80b71c7de1d8169fd28784e1e41a3d2ad12709ab212e58fc481282a5bb65d591fae7b443048de3330 + checksum: 62197a6f12289c1c1bd57f3bed9f0f765ca32390bfe91e0b5561dd94dd9770f4480c4162dec98da094bc0ba99d2c2ebba68de47c019454041b0b7a68ba2ec66d languageName: node linkType: hard @@ -2180,39 +2229,39 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-optional-catch-binding@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-optional-catch-binding@npm:7.22.5" +"@babel/plugin-transform-optional-catch-binding@npm:^7.22.11": + version: 7.22.11 + resolution: "@babel/plugin-transform-optional-catch-binding@npm:7.22.11" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-optional-catch-binding": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: b0e8b4233ff06b5c9d285257f49c5bd441f883189b24282e6200f9ebdf5db29aeeebbffae57fbbcd5df9f4387b3e66e5d322aaae5652a78e89685ddbae46bbd1 + checksum: f17abd90e1de67c84d63afea29c8021c74abb2794d3a6eeafb0bbe7372d3db32aefca386e392116ec63884537a4a2815d090d26264d259bacc08f6e3ed05294c languageName: node linkType: hard -"@babel/plugin-transform-optional-chaining@npm:^7.22.10, @babel/plugin-transform-optional-chaining@npm:^7.22.5": - version: 7.22.10 - resolution: "@babel/plugin-transform-optional-chaining@npm:7.22.10" +"@babel/plugin-transform-optional-chaining@npm:^7.22.15": + version: 7.23.0 + resolution: "@babel/plugin-transform-optional-chaining@npm:7.23.0" dependencies: "@babel/helper-plugin-utils": ^7.22.5 "@babel/helper-skip-transparent-expression-wrappers": ^7.22.5 "@babel/plugin-syntax-optional-chaining": ^7.8.3 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 522d6214bb9f6ede8a2fc56a873e791aabd62f0b3be78fb8e62ca801a9033bcadabfb77aec6739f0e67f0f15f7c739c08bafafd66d3676edf1941fe6429cebcd + checksum: f702634f2b97e5260dbec0d4bde05ccb6f4d96d7bfa946481aeacfa205ca846cb6e096a38312f9d51fdbdac1f258f211138c5f7075952e46a5bf8574de6a1329 languageName: node linkType: hard -"@babel/plugin-transform-parameters@npm:^7.12.1, @babel/plugin-transform-parameters@npm:^7.20.7, @babel/plugin-transform-parameters@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-parameters@npm:7.22.5" +"@babel/plugin-transform-parameters@npm:^7.12.1, @babel/plugin-transform-parameters@npm:^7.20.7, @babel/plugin-transform-parameters@npm:^7.22.15": + version: 7.22.15 + resolution: "@babel/plugin-transform-parameters@npm:7.22.15" dependencies: "@babel/helper-plugin-utils": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: b44f89cf97daf23903776ba27c2ab13b439d80d8c8a95be5c476ab65023b1e0c0e94c28d3745f3b60a58edc4e590fa0cd4287a0293e51401ca7d29a2ddb13b8e + checksum: 541188bb7d1876cad87687b5c7daf90f63d8208ae83df24acb1e2b05020ad1c78786b2723ca4054a83fcb74fb6509f30c4cacc5b538ee684224261ad5fb047c1 languageName: node linkType: hard @@ -2228,17 +2277,17 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-private-property-in-object@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-private-property-in-object@npm:7.22.5" +"@babel/plugin-transform-private-property-in-object@npm:^7.22.11": + version: 7.22.11 + resolution: "@babel/plugin-transform-private-property-in-object@npm:7.22.11" dependencies: "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-create-class-features-plugin": ^7.22.5 + "@babel/helper-create-class-features-plugin": ^7.22.11 "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-private-property-in-object": ^7.14.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 9ac019fb2772f3af6278a7f4b8b14b0663accb3fd123d87142ceb2fbc57fd1afa07c945d1329029b026b9ee122096ef71a3f34f257a9e04cf4245b87298c38b4 + checksum: 4d029d84901e53c46dead7a46e2990a7bc62470f4e4ca58a0d063394f86652fd58fe4eea1eb941da3669cd536b559b9d058b342b59300026346b7a2a51badac8 languageName: node linkType: hard @@ -2403,17 +2452,17 @@ __metadata: languageName: node linkType: hard -"@babel/plugin-transform-typescript@npm:^7.22.5": - version: 7.22.5 - resolution: "@babel/plugin-transform-typescript@npm:7.22.5" +"@babel/plugin-transform-typescript@npm:^7.22.15, @babel/plugin-transform-typescript@npm:^7.22.5": + version: 7.22.15 + resolution: "@babel/plugin-transform-typescript@npm:7.22.15" dependencies: "@babel/helper-annotate-as-pure": ^7.22.5 - "@babel/helper-create-class-features-plugin": ^7.22.5 + "@babel/helper-create-class-features-plugin": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 "@babel/plugin-syntax-typescript": ^7.22.5 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: d12f1ca1ef1f2a54432eb044d2999705d1205ebe211c2a7f05b12e8eb2d2a461fd7657b5486b2f2f1efe7c0c0dc8e80725b767073d40fe4ae059a7af057b05e4 + checksum: c5d96cdbf0e1512707aa1c1e3ac6b370a25fd9c545d26008ce44eb13a47bd7fd67a1eb799c98b5ccc82e33a345fda55c0055e1fe3ed97646ed405dd13020b226 languageName: node linkType: hard @@ -2464,16 +2513,16 @@ __metadata: languageName: node linkType: hard -"@babel/preset-env@npm:^7.12.11, @babel/preset-env@npm:~7.22.10, @babel/preset-env@npm:~7.22.9": - version: 7.22.10 - resolution: "@babel/preset-env@npm:7.22.10" +"@babel/preset-env@npm:^7.12.11, @babel/preset-env@npm:^7.22.20, @babel/preset-env@npm:~7.22.10, @babel/preset-env@npm:~7.22.9": + version: 7.22.20 + resolution: "@babel/preset-env@npm:7.22.20" dependencies: - "@babel/compat-data": ^7.22.9 - "@babel/helper-compilation-targets": ^7.22.10 + "@babel/compat-data": ^7.22.20 + "@babel/helper-compilation-targets": ^7.22.15 "@babel/helper-plugin-utils": ^7.22.5 - "@babel/helper-validator-option": ^7.22.5 - "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": ^7.22.5 - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": ^7.22.5 + "@babel/helper-validator-option": ^7.22.15 + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression": ^7.22.15 + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": ^7.22.15 "@babel/plugin-proposal-private-property-in-object": 7.21.0-placeholder-for-preset-env.2 "@babel/plugin-syntax-async-generators": ^7.8.4 "@babel/plugin-syntax-class-properties": ^7.12.13 @@ -2494,41 +2543,41 @@ __metadata: "@babel/plugin-syntax-top-level-await": ^7.14.5 "@babel/plugin-syntax-unicode-sets-regex": ^7.18.6 "@babel/plugin-transform-arrow-functions": ^7.22.5 - "@babel/plugin-transform-async-generator-functions": ^7.22.10 + "@babel/plugin-transform-async-generator-functions": ^7.22.15 "@babel/plugin-transform-async-to-generator": ^7.22.5 "@babel/plugin-transform-block-scoped-functions": ^7.22.5 - "@babel/plugin-transform-block-scoping": ^7.22.10 + "@babel/plugin-transform-block-scoping": ^7.22.15 "@babel/plugin-transform-class-properties": ^7.22.5 - "@babel/plugin-transform-class-static-block": ^7.22.5 - "@babel/plugin-transform-classes": ^7.22.6 + "@babel/plugin-transform-class-static-block": ^7.22.11 + "@babel/plugin-transform-classes": ^7.22.15 "@babel/plugin-transform-computed-properties": ^7.22.5 - "@babel/plugin-transform-destructuring": ^7.22.10 + "@babel/plugin-transform-destructuring": ^7.22.15 "@babel/plugin-transform-dotall-regex": ^7.22.5 "@babel/plugin-transform-duplicate-keys": ^7.22.5 - "@babel/plugin-transform-dynamic-import": ^7.22.5 + "@babel/plugin-transform-dynamic-import": ^7.22.11 "@babel/plugin-transform-exponentiation-operator": ^7.22.5 - "@babel/plugin-transform-export-namespace-from": ^7.22.5 - "@babel/plugin-transform-for-of": ^7.22.5 + "@babel/plugin-transform-export-namespace-from": ^7.22.11 + "@babel/plugin-transform-for-of": ^7.22.15 "@babel/plugin-transform-function-name": ^7.22.5 - "@babel/plugin-transform-json-strings": ^7.22.5 + "@babel/plugin-transform-json-strings": ^7.22.11 "@babel/plugin-transform-literals": ^7.22.5 - "@babel/plugin-transform-logical-assignment-operators": ^7.22.5 + "@babel/plugin-transform-logical-assignment-operators": ^7.22.11 "@babel/plugin-transform-member-expression-literals": ^7.22.5 "@babel/plugin-transform-modules-amd": ^7.22.5 - "@babel/plugin-transform-modules-commonjs": ^7.22.5 - "@babel/plugin-transform-modules-systemjs": ^7.22.5 + "@babel/plugin-transform-modules-commonjs": ^7.22.15 + "@babel/plugin-transform-modules-systemjs": ^7.22.11 "@babel/plugin-transform-modules-umd": ^7.22.5 "@babel/plugin-transform-named-capturing-groups-regex": ^7.22.5 "@babel/plugin-transform-new-target": ^7.22.5 - "@babel/plugin-transform-nullish-coalescing-operator": ^7.22.5 - "@babel/plugin-transform-numeric-separator": ^7.22.5 - "@babel/plugin-transform-object-rest-spread": ^7.22.5 + "@babel/plugin-transform-nullish-coalescing-operator": ^7.22.11 + "@babel/plugin-transform-numeric-separator": ^7.22.11 + "@babel/plugin-transform-object-rest-spread": ^7.22.15 "@babel/plugin-transform-object-super": ^7.22.5 - "@babel/plugin-transform-optional-catch-binding": ^7.22.5 - "@babel/plugin-transform-optional-chaining": ^7.22.10 - "@babel/plugin-transform-parameters": ^7.22.5 + "@babel/plugin-transform-optional-catch-binding": ^7.22.11 + "@babel/plugin-transform-optional-chaining": ^7.22.15 + "@babel/plugin-transform-parameters": ^7.22.15 "@babel/plugin-transform-private-methods": ^7.22.5 - "@babel/plugin-transform-private-property-in-object": ^7.22.5 + "@babel/plugin-transform-private-property-in-object": ^7.22.11 "@babel/plugin-transform-property-literals": ^7.22.5 "@babel/plugin-transform-regenerator": ^7.22.10 "@babel/plugin-transform-reserved-words": ^7.22.5 @@ -2542,7 +2591,7 @@ __metadata: "@babel/plugin-transform-unicode-regex": ^7.22.5 "@babel/plugin-transform-unicode-sets-regex": ^7.22.5 "@babel/preset-modules": 0.1.6-no-external-plugins - "@babel/types": ^7.22.10 + "@babel/types": ^7.22.19 babel-plugin-polyfill-corejs2: ^0.4.5 babel-plugin-polyfill-corejs3: ^0.8.3 babel-plugin-polyfill-regenerator: ^0.5.2 @@ -2550,7 +2599,7 @@ __metadata: semver: ^6.3.1 peerDependencies: "@babel/core": ^7.0.0-0 - checksum: 4145a660a7b05e21e6d8b6cdf348c6931238abb15282a258bdb5e04cd3cca9356dc120ecfe0d1b977819ade4aac50163127c86db2300227ff60392d24daa0b7c + checksum: 99357a5cb30f53bacdc0d1cd6dff0f052ea6c2d1ba874d969bba69897ef716e87283e84a59dc52fb49aa31fd1b6f55ed756c64c04f5678380700239f6030b881 languageName: node linkType: hard @@ -2596,7 +2645,22 @@ __metadata: languageName: node linkType: hard -"@babel/preset-typescript@npm:^7.12.7, @babel/preset-typescript@npm:~7.22.5": +"@babel/preset-typescript@npm:^7.12.7, @babel/preset-typescript@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/preset-typescript@npm:7.23.0" + dependencies: + "@babel/helper-plugin-utils": ^7.22.5 + "@babel/helper-validator-option": ^7.22.15 + "@babel/plugin-syntax-jsx": ^7.22.5 + "@babel/plugin-transform-modules-commonjs": ^7.23.0 + "@babel/plugin-transform-typescript": ^7.22.15 + peerDependencies: + "@babel/core": ^7.0.0-0 + checksum: 3d5fce83e83f11c07e0ea13542bca181abb3b482b8981ec9c64e6add9d7beed3c54d063dc4bc9fd383165c71114a245abef89a289680833c5a8552fe3e7c4407 + languageName: node + linkType: hard + +"@babel/preset-typescript@npm:~7.22.5": version: 7.22.5 resolution: "@babel/preset-typescript@npm:7.22.5" dependencies: @@ -2660,43 +2724,43 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.12.7, @babel/template@npm:^7.22.5, @babel/template@npm:^7.3.3": - version: 7.22.5 - resolution: "@babel/template@npm:7.22.5" +"@babel/template@npm:^7.12.7, @babel/template@npm:^7.22.15, @babel/template@npm:^7.22.5, @babel/template@npm:^7.3.3": + version: 7.22.15 + resolution: "@babel/template@npm:7.22.15" dependencies: - "@babel/code-frame": ^7.22.5 - "@babel/parser": ^7.22.5 - "@babel/types": ^7.22.5 - checksum: c5746410164039aca61829cdb42e9a55410f43cace6f51ca443313f3d0bdfa9a5a330d0b0df73dc17ef885c72104234ae05efede37c1cc8a72dc9f93425977a3 + "@babel/code-frame": ^7.22.13 + "@babel/parser": ^7.22.15 + "@babel/types": ^7.22.15 + checksum: 1f3e7dcd6c44f5904c184b3f7fe280394b191f2fed819919ffa1e529c259d5b197da8981b6ca491c235aee8dbad4a50b7e31304aa531271cb823a4a24a0dd8fd 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.22.10, @babel/traverse@npm:^7.22.5": - version: 7.22.10 - resolution: "@babel/traverse@npm:7.22.10" +"@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.22.10, @babel/traverse@npm:^7.23.0": + version: 7.23.0 + resolution: "@babel/traverse@npm:7.23.0" dependencies: - "@babel/code-frame": ^7.22.10 - "@babel/generator": ^7.22.10 - "@babel/helper-environment-visitor": ^7.22.5 - "@babel/helper-function-name": ^7.22.5 + "@babel/code-frame": ^7.22.13 + "@babel/generator": ^7.23.0 + "@babel/helper-environment-visitor": ^7.22.20 + "@babel/helper-function-name": ^7.23.0 "@babel/helper-hoist-variables": ^7.22.5 "@babel/helper-split-export-declaration": ^7.22.6 - "@babel/parser": ^7.22.10 - "@babel/types": ^7.22.10 + "@babel/parser": ^7.23.0 + "@babel/types": ^7.23.0 debug: ^4.1.0 globals: ^11.1.0 - checksum: 9f7b358563bfb0f57ac4ed639f50e5c29a36b821a1ce1eea0c7db084f5b925e3275846d0de63bde01ca407c85d9804e0efbe370d92cd2baaafde3bd13b0f4cdb + checksum: 0b17fae53269e1af2cd3edba00892bc2975ad5df9eea7b84815dab07dfec2928c451066d51bc65b4be61d8499e77db7e547ce69ef2a7b0eca3f96269cb43a0b0 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.2.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.10, @babel/types@npm:^7.22.5, @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.22.10 - resolution: "@babel/types@npm:7.22.10" +"@babel/types@npm:^7.0.0, @babel/types@npm:^7.12.11, @babel/types@npm:^7.12.7, @babel/types@npm:^7.2.0, @babel/types@npm:^7.20.7, @babel/types@npm:^7.22.10, @babel/types@npm:^7.22.15, @babel/types@npm:^7.22.19, @babel/types@npm:^7.22.5, @babel/types@npm:^7.23.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.23.0 + resolution: "@babel/types@npm:7.23.0" dependencies: "@babel/helper-string-parser": ^7.22.5 - "@babel/helper-validator-identifier": ^7.22.5 + "@babel/helper-validator-identifier": ^7.22.20 to-fast-properties: ^2.0.0 - checksum: 095c4f4b7503fa816e4094113f0ec2351ef96ff32012010b771693066ff628c7c664b21c6bd3fb93aeb46fe7c61f6b3a3c9e4ed0034d6a2481201c417371c8af + checksum: 215fe04bd7feef79eeb4d33374b39909ce9cad1611c4135a4f7fdf41fe3280594105af6d7094354751514625ea92d0875aba355f53e86a92600f290e77b0e604 languageName: node linkType: hard @@ -4524,6 +4588,13 @@ __metadata: languageName: node linkType: hard +"@nicolo-ribaudo/chokidar-2@npm:2.1.8-no-fsevents.3": + version: 2.1.8-no-fsevents.3 + resolution: "@nicolo-ribaudo/chokidar-2@npm:2.1.8-no-fsevents.3" + checksum: ee55cc9241aeea7eb94b8a8551bfa4246c56c53bc71ecda0a2104018fcc328ba5723b33686bdf9cc65d4df4ae65e8016b89e0bbdeb94e0309fe91bb9ced42344 + languageName: node + linkType: hard + "@nicolo-ribaudo/eslint-scope-5-internals@npm:5.1.1-v1": version: 5.1.1-v1 resolution: "@nicolo-ribaudo/eslint-scope-5-internals@npm:5.1.1-v1" @@ -8365,6 +8436,19 @@ __metadata: languageName: unknown linkType: soft +"@rocket.chat/jwt@workspace:^, @rocket.chat/jwt@workspace:packages/jwt": + version: 0.0.0-use.local + resolution: "@rocket.chat/jwt@workspace:packages/jwt" + dependencies: + "@types/jest": ~29.5.3 + eslint: ~8.45.0 + jest: ~29.6.1 + jose: ^4.14.4 + ts-jest: ^29.1.1 + typescript: ~5.2.2 + languageName: unknown + linkType: soft + "@rocket.chat/layout@npm:next": version: 0.32.0-dev.312 resolution: "@rocket.chat/layout@npm:0.32.0-dev.312" @@ -8377,6 +8461,33 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/license@workspace:^, @rocket.chat/license@workspace:ee/packages/license": + version: 0.0.0-use.local + resolution: "@rocket.chat/license@workspace:ee/packages/license" + dependencies: + "@babel/cli": ^7.23.0 + "@babel/core": ^7.23.0 + "@babel/preset-env": ^7.22.20 + "@babel/preset-typescript": ^7.23.0 + "@rocket.chat/core-typings": "workspace:^" + "@rocket.chat/jwt": "workspace:^" + "@rocket.chat/logger": "workspace:^" + "@swc/core": ^1.3.66 + "@swc/jest": ^0.2.26 + "@types/babel__core": ^7 + "@types/babel__preset-env": ^7 + "@types/jest": ~29.5.3 + "@types/ws": ^8.5.5 + babel-plugin-transform-inline-environment-variables: ^0.4.4 + eslint: ~8.45.0 + jest: ~29.6.1 + jest-environment-jsdom: ~29.6.1 + jest-websocket-mock: ^2.4.0 + ts-jest: ~29.0.5 + typescript: ^5.2.2 + languageName: unknown + linkType: soft + "@rocket.chat/livechat@workspace:^, @rocket.chat/livechat@workspace:packages/livechat": version: 0.0.0-use.local resolution: "@rocket.chat/livechat@workspace:packages/livechat" @@ -8587,7 +8698,9 @@ __metadata: "@rocket.chat/i18n": "workspace:^" "@rocket.chat/icons": ^0.32.0 "@rocket.chat/instance-status": "workspace:^" + "@rocket.chat/jwt": "workspace:^" "@rocket.chat/layout": next + "@rocket.chat/license": "workspace:^" "@rocket.chat/livechat": "workspace:^" "@rocket.chat/log-format": "workspace:^" "@rocket.chat/logger": "workspace:^" @@ -9262,6 +9375,7 @@ __metadata: "@rocket.chat/apps-engine": 1.41.0-alpha.290 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/eslint-config": "workspace:^" + "@rocket.chat/license": "workspace:^" "@rocket.chat/message-parser": next "@rocket.chat/ui-kit": ^0.32.1 "@types/jest": ~29.5.3 @@ -15271,6 +15385,13 @@ __metadata: languageName: node linkType: hard +"babel-plugin-transform-inline-environment-variables@npm:^0.4.4": + version: 0.4.4 + resolution: "babel-plugin-transform-inline-environment-variables@npm:0.4.4" + checksum: fa361287411301237fd8ce332aff4f8e8ccb8db30e87a2ddc7224c8bf7cd792eda47aca24dc2e09e70bce4c027bc8cbe22f4999056be37a25d2472945df21ef5 + languageName: node + linkType: hard + "babel-polyfill@npm:^6.2.0": version: 6.26.0 resolution: "babel-polyfill@npm:6.26.0" @@ -16795,7 +16916,7 @@ __metadata: languageName: node linkType: hard -"chokidar@npm:3.5.3, chokidar@npm:>=3.0.0 <4.0.0, chokidar@npm:^3.4.1, chokidar@npm:^3.4.2, chokidar@npm:^3.5.1, chokidar@npm:^3.5.3": +"chokidar@npm:3.5.3, chokidar@npm:>=3.0.0 <4.0.0, chokidar@npm:^3.4.0, chokidar@npm:^3.4.1, chokidar@npm:^3.4.2, chokidar@npm:^3.5.1, chokidar@npm:^3.5.3": version: 3.5.3 resolution: "chokidar@npm:3.5.3" dependencies: @@ -17337,7 +17458,7 @@ __metadata: languageName: node linkType: hard -"commander@npm:^4.0.0, commander@npm:^4.1.1": +"commander@npm:^4.0.0, commander@npm:^4.0.1, commander@npm:^4.1.1": version: 4.1.1 resolution: "commander@npm:4.1.1" checksum: d7b9913ff92cae20cb577a4ac6fcc121bd6223319e54a40f51a14740a681ad5c574fd29a57da478a5f234a6fa6c52cbf0b7c641353e03c648b1ae85ba670b977 @@ -21944,6 +22065,13 @@ __metadata: languageName: node linkType: hard +"fs-readdir-recursive@npm:^1.1.0": + version: 1.1.0 + resolution: "fs-readdir-recursive@npm:1.1.0" + checksum: 29d50f3d2128391c7fc9fd051c8b7ea45bcc8aa84daf31ef52b17218e20bfd2bd34d02382742801954cc8d1905832b68227f6b680a666ce525d8b6b75068ad1e + languageName: node + linkType: hard + "fs-write-stream-atomic@npm:^1.0.8": version: 1.0.10 resolution: "fs-write-stream-atomic@npm:1.0.10" @@ -26021,10 +26149,10 @@ __metadata: languageName: node linkType: hard -"jose@npm:^4.11.1": - version: 4.12.0 - resolution: "jose@npm:4.12.0" - checksum: 09e67611768127ab54b6b507401de4b1f87e1e285cf2c2fc917e931e001b7e584c90081b421f483f13a6eec4fc44936e4a5f4b8ae2d59928061e886e35d33fa2 +"jose@npm:^4.11.1, jose@npm:^4.14.4": + version: 4.14.6 + resolution: "jose@npm:4.14.6" + checksum: eae81a234e7bf1446b1bd80722b3462b014e3835b155c3a7799c1c5043163a53a0dc28d347004151b031e6b7b863403aabf8814d9cc217ce21f8c2f3ebd4b335 languageName: node linkType: hard @@ -37241,6 +37369,39 @@ __metadata: languageName: node linkType: hard +"ts-jest@npm:^29.1.1": + version: 29.1.1 + resolution: "ts-jest@npm:29.1.1" + dependencies: + bs-logger: 0.x + fast-json-stable-stringify: 2.x + jest-util: ^29.0.0 + json5: ^2.2.3 + lodash.memoize: 4.x + make-error: 1.x + semver: ^7.5.3 + yargs-parser: ^21.0.1 + peerDependencies: + "@babel/core": ">=7.0.0-beta.0 <8" + "@jest/types": ^29.0.0 + babel-jest: ^29.0.0 + jest: ^29.0.0 + typescript: ">=4.3 <6" + peerDependenciesMeta: + "@babel/core": + optional: true + "@jest/types": + optional: true + babel-jest: + optional: true + esbuild: + optional: true + bin: + ts-jest: cli.js + checksum: a8c9e284ed4f819526749f6e4dc6421ec666f20ab44d31b0f02b4ed979975f7580b18aea4813172d43e39b29464a71899f8893dd29b06b4a351a3af8ba47b402 + languageName: node + linkType: hard + "ts-jest@npm:~29.0.5": version: 29.0.5 resolution: "ts-jest@npm:29.0.5" @@ -37717,7 +37878,7 @@ __metadata: languageName: node linkType: hard -"typescript@npm:~5.2.2": +"typescript@npm:^5.2.2, typescript@npm:~5.2.2": version: 5.2.2 resolution: "typescript@npm:5.2.2" bin: @@ -37727,7 +37888,7 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@~5.2.2#~builtin": +"typescript@patch:typescript@^5.2.2#~builtin, typescript@patch:typescript@~5.2.2#~builtin": version: 5.2.2 resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f456af" bin: From f3118c7c6802a26a4e0873afba6ef5fced2f6c2d Mon Sep 17 00:00:00 2001 From: Igor Rincon Date: Thu, 28 Sep 2023 20:38:44 -0300 Subject: [PATCH 210/275] ci: Security/GitHub jira integration (#29776) Co-authored-by: B. Cestari <5381475+brunobcestari@users.noreply.github.com> --- .../vulnerabilities-jira-integration.yml | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/vulnerabilities-jira-integration.yml diff --git a/.github/workflows/vulnerabilities-jira-integration.yml b/.github/workflows/vulnerabilities-jira-integration.yml new file mode 100644 index 000000000000..2daeb533937d --- /dev/null +++ b/.github/workflows/vulnerabilities-jira-integration.yml @@ -0,0 +1,22 @@ +name: Github vulnerabilities and jira board integration + +on: + schedule: + - cron: '0 1 * * *' + +jobs: + IntegrateSecurityVulnerabilities: + runs-on: ubuntu-latest + steps: + - name: "Github vulnerabilities and jira board integration" + uses: RocketChat/github-vulnerabilities-jira-integration@v0.3 + env: + JIRA_URL: https://rocketchat.atlassian.net/ + JIRA_TOKEN: ${{ secrets.JIRA_TOKEN }} + GITHUB_TOKEN: ${{ secrets._GITHUB_TOKEN }} + JIRA_EMAIL: security-team-accounts@rocket.chat + JIRA_PROJECT_ID: GJIT + UID_CUSTOMFIELD_ID: customfield_10059 + JIRA_COMPLETE_PHASE_ID: 31 + JIRA_START_PHASE_ID: 11 + From 67333988a61b458e1e5bce0200540872e618fb82 Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Fri, 29 Sep 2023 01:40:51 -0300 Subject: [PATCH 211/275] chore: Prevent call license and registration status endpoints when not enough permission (#30336) --- apps/meteor/client/hooks/useLicense.ts | 20 ++++++++++++++----- .../client/hooks/useRegistrationStatus.ts | 20 ++++++++++++++----- .../hooks/useAdministrationItems.spec.tsx | 9 +++++++-- 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/apps/meteor/client/hooks/useLicense.ts b/apps/meteor/client/hooks/useLicense.ts index 99b7e5e3461c..0f568d9bd5cc 100644 --- a/apps/meteor/client/hooks/useLicense.ts +++ b/apps/meteor/client/hooks/useLicense.ts @@ -1,13 +1,23 @@ import type { OperationResult } from '@rocket.chat/rest-typings'; -import { useEndpoint } from '@rocket.chat/ui-contexts'; +import { useEndpoint, usePermission } from '@rocket.chat/ui-contexts'; import type { UseQueryResult } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query'; export const useLicense = (): UseQueryResult> => { const getLicenses = useEndpoint('GET', '/v1/licenses.get'); + const canViewLicense = usePermission('view-privileged-setting'); - return useQuery(['licenses', 'getLicenses'], () => getLicenses(), { - staleTime: Infinity, - keepPreviousData: true, - }); + return useQuery( + ['licenses', 'getLicenses'], + () => { + if (!canViewLicense) { + throw new Error('unauthorized api call'); + } + return getLicenses(); + }, + { + staleTime: Infinity, + keepPreviousData: true, + }, + ); }; diff --git a/apps/meteor/client/hooks/useRegistrationStatus.ts b/apps/meteor/client/hooks/useRegistrationStatus.ts index 8b091459291b..9260d672bec5 100644 --- a/apps/meteor/client/hooks/useRegistrationStatus.ts +++ b/apps/meteor/client/hooks/useRegistrationStatus.ts @@ -1,13 +1,23 @@ import type { OperationResult } from '@rocket.chat/rest-typings'; -import { useEndpoint } from '@rocket.chat/ui-contexts'; +import { useEndpoint, usePermission } from '@rocket.chat/ui-contexts'; import type { UseQueryResult } from '@tanstack/react-query'; import { useQuery } from '@tanstack/react-query'; export const useRegistrationStatus = (): UseQueryResult> => { const getRegistrationStatus = useEndpoint('GET', '/v1/cloud.registrationStatus'); + const canViewregistrationStatus = usePermission('manage-cloud'); - return useQuery(['getRegistrationStatus'], () => getRegistrationStatus(), { - keepPreviousData: true, - staleTime: Infinity, - }); + return useQuery( + ['getRegistrationStatus'], + () => { + if (!canViewregistrationStatus) { + throw new Error('unauthorized api call'); + } + return getRegistrationStatus(); + }, + { + keepPreviousData: true, + staleTime: Infinity, + }, + ); }; diff --git a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.spec.tsx b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.spec.tsx index 248b91418739..b0b20972d346 100644 --- a/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.spec.tsx +++ b/apps/meteor/client/sidebar/header/actions/hooks/useAdministrationItems.spec.tsx @@ -19,12 +19,14 @@ it('should not show upgrade item if has license and not have trial', async () => workspaceRegistered: false, } as any, })) + .withPermission('view-privileged-setting') + .withPermission('manage-cloud') .build(), }); await waitFor(() => !!(result.all.length > 1)); - expect(result.current).toEqual([]); + expect(result.current.length).toEqual(1); }); it('should return an upgrade item if not have license or if have a trial', async () => { @@ -42,10 +44,13 @@ it('should return an upgrade item if not have license or if have a trial', async workspaceRegistered: false, } as any, })) + .withPermission('view-privileged-setting') + .withPermission('manage-cloud') .build(), }); - await waitFor(() => !!result.current[0]); + // Workspace admin is also expected to be here + await waitFor(() => result.current.length > 1); expect(result.current[0]).toEqual( expect.objectContaining({ From 1642bad3ae154e38e9777658c5f48574c515b1c6 Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Fri, 29 Sep 2023 01:50:27 -0300 Subject: [PATCH 212/275] feat: Auto-enable autotranslate (#30370) --- .changeset/large-pandas-beam.md | 5 + .../functions/addUserToDefaultChannels.ts | 3 + .../app/lib/server/functions/addUserToRoom.ts | 6 +- .../app/lib/server/functions/createRoom.ts | 6 +- .../rocketchat-i18n/i18n/en.i18n.json | 2 + ...tSubscriptionAutotranslateDefaultConfig.ts | 28 ++++ .../meteor/server/methods/addAllUserToRoom.ts | 3 + apps/meteor/server/settings/message.ts | 8 ++ .../tests/end-to-end/api/00-autotranslate.js | 130 +++++++++++++++++- 9 files changed, 188 insertions(+), 3 deletions(-) create mode 100644 .changeset/large-pandas-beam.md create mode 100644 apps/meteor/server/lib/getSubscriptionAutotranslateDefaultConfig.ts diff --git a/.changeset/large-pandas-beam.md b/.changeset/large-pandas-beam.md new file mode 100644 index 000000000000..19f1eade9a9b --- /dev/null +++ b/.changeset/large-pandas-beam.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": minor +--- + +New setting to automatically enable autotranslate when joining rooms diff --git a/apps/meteor/app/lib/server/functions/addUserToDefaultChannels.ts b/apps/meteor/app/lib/server/functions/addUserToDefaultChannels.ts index 6dc477a2926f..ad632a3b7dfc 100644 --- a/apps/meteor/app/lib/server/functions/addUserToDefaultChannels.ts +++ b/apps/meteor/app/lib/server/functions/addUserToDefaultChannels.ts @@ -3,6 +3,7 @@ import type { IUser } from '@rocket.chat/core-typings'; import { Subscriptions, Rooms } from '@rocket.chat/models'; import { callbacks } from '../../../../lib/callbacks'; +import { getSubscriptionAutotranslateDefaultConfig } from '../../../../server/lib/getSubscriptionAutotranslateDefaultConfig'; export const addUserToDefaultChannels = async function (user: IUser, silenced?: boolean): Promise { await callbacks.run('beforeJoinDefaultChannels', user); @@ -11,6 +12,7 @@ export const addUserToDefaultChannels = async function (user: IUser, silenced?: }).toArray(); for await (const room of defaultRooms) { if (!(await Subscriptions.findOneByRoomIdAndUserId(room._id, user._id, { projection: { _id: 1 } }))) { + const autoTranslateConfig = await getSubscriptionAutotranslateDefaultConfig(user); // Add a subscription to this user await Subscriptions.createWithRoomAndUser(room, user, { ts: new Date(), @@ -20,6 +22,7 @@ export const addUserToDefaultChannels = async function (user: IUser, silenced?: userMentions: 1, groupMentions: 0, ...(room.favorite && { f: true }), + ...autoTranslateConfig, }); // Insert user joined message diff --git a/apps/meteor/app/lib/server/functions/addUserToRoom.ts b/apps/meteor/app/lib/server/functions/addUserToRoom.ts index 660af823de9e..41000cda2038 100644 --- a/apps/meteor/app/lib/server/functions/addUserToRoom.ts +++ b/apps/meteor/app/lib/server/functions/addUserToRoom.ts @@ -7,6 +7,7 @@ import { Meteor } from 'meteor/meteor'; import { RoomMemberActions } from '../../../../definition/IRoomTypeConfig'; import { AppEvents, Apps } from '../../../../ee/server/apps'; import { callbacks } from '../../../../lib/callbacks'; +import { getSubscriptionAutotranslateDefaultConfig } from '../../../../server/lib/getSubscriptionAutotranslateDefaultConfig'; import { roomCoordinator } from '../../../../server/lib/rooms/roomCoordinator'; export const addUserToRoom = async function ( @@ -24,7 +25,7 @@ export const addUserToRoom = async function ( }); } - const userToBeAdded = typeof user !== 'string' ? user : await Users.findOneByUsername(user.replace('@', '')); + const userToBeAdded = typeof user === 'string' ? await Users.findOneByUsername(user.replace('@', '')) : await Users.findOneById(user._id); const roomDirectives = roomCoordinator.getRoomDirectives(room.t); if (!userToBeAdded) { @@ -70,6 +71,8 @@ export const addUserToRoom = async function ( await callbacks.run('beforeJoinRoom', userToBeAdded, room); } + const autoTranslateConfig = await getSubscriptionAutotranslateDefaultConfig(userToBeAdded); + await Subscriptions.createWithRoomAndUser(room, userToBeAdded as IUser, { ts: now, open: true, @@ -77,6 +80,7 @@ export const addUserToRoom = async function ( unread: 1, userMentions: 1, groupMentions: 0, + ...autoTranslateConfig, }); if (!userToBeAdded.username) { diff --git a/apps/meteor/app/lib/server/functions/createRoom.ts b/apps/meteor/app/lib/server/functions/createRoom.ts index 192139f96b7c..30cf2a593700 100644 --- a/apps/meteor/app/lib/server/functions/createRoom.ts +++ b/apps/meteor/app/lib/server/functions/createRoom.ts @@ -1,3 +1,4 @@ +/* eslint-disable complexity */ import { AppsEngineException } from '@rocket.chat/apps-engine/definition/exceptions'; import { Message, Team } from '@rocket.chat/core-services'; import type { ICreateRoomParams, ISubscriptionExtraData } from '@rocket.chat/core-services'; @@ -8,6 +9,7 @@ import { Meteor } from 'meteor/meteor'; import { Apps } from '../../../../ee/server/apps/orchestrator'; import { callbacks } from '../../../../lib/callbacks'; import { beforeCreateRoomCallback } from '../../../../lib/callbacks/beforeCreateRoomCallback'; +import { getSubscriptionAutotranslateDefaultConfig } from '../../../../server/lib/getSubscriptionAutotranslateDefaultConfig'; import { addUserRolesAsync } from '../../../../server/lib/roles/addUserRoles'; import { getValidRoomName } from '../../../utils/server/lib/getValidRoomName'; import { createDirectRoom } from './createDirectRoom'; @@ -178,7 +180,9 @@ export const createRoom = async ( extra.ls = now; } - await Subscriptions.createWithRoomAndUser(room, member, extra); + const autoTranslateConfig = await getSubscriptionAutotranslateDefaultConfig(member); + + await Subscriptions.createWithRoomAndUser(room, member, { ...extra, ...autoTranslateConfig }); } } diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 0df90c85bd8e..94ce81c32284 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -715,6 +715,8 @@ "AutoTranslate_DeepL": "DeepL", "AutoTranslate_Enabled": "Enable Auto-Translate", "AutoTranslate_Enabled_Description": "Enabling auto-translation will allow people with the `auto-translate` permission to have all messages automatically translated into their selected language. Fees may apply.", + "AutoTranslate_AutoEnableOnJoinRoom": "Auto-Translate for non-default language members", + "AutoTranslate_AutoEnableOnJoinRoom_Description": "If enabled, whenever a user with a language preference different than the workspace default joins a room, it will be automatically translated for them.", "AutoTranslate_Google": "Google", "AutoTranslate_Microsoft": "Microsoft", "AutoTranslate_Microsoft_API_Key": "Ocp-Apim-Subscription-Key", diff --git a/apps/meteor/server/lib/getSubscriptionAutotranslateDefaultConfig.ts b/apps/meteor/server/lib/getSubscriptionAutotranslateDefaultConfig.ts new file mode 100644 index 000000000000..13540246f0e6 --- /dev/null +++ b/apps/meteor/server/lib/getSubscriptionAutotranslateDefaultConfig.ts @@ -0,0 +1,28 @@ +import type { IUser } from '@rocket.chat/core-typings'; +import { Settings } from '@rocket.chat/models'; + +export const getSubscriptionAutotranslateDefaultConfig = async ( + user: IUser, +): Promise< + | { + autoTranslate: boolean; + autoTranslateLanguage: string; + } + | undefined +> => { + const [autoEnableSetting, languageSetting] = await Promise.all([ + Settings.findOneById('AutoTranslate_AutoEnableOnJoinRoom'), + Settings.findOneById('Language'), + ]); + const { language: userLanguage } = user.settings?.preferences || {}; + + if (!autoEnableSetting?.value) { + return; + } + + if (!userLanguage || userLanguage === 'default' || languageSetting?.value === userLanguage) { + return; + } + + return { autoTranslate: true, autoTranslateLanguage: userLanguage }; +}; diff --git a/apps/meteor/server/methods/addAllUserToRoom.ts b/apps/meteor/server/methods/addAllUserToRoom.ts index cbbafccfe60b..acba1bed406b 100644 --- a/apps/meteor/server/methods/addAllUserToRoom.ts +++ b/apps/meteor/server/methods/addAllUserToRoom.ts @@ -8,6 +8,7 @@ import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../app/authorization/server/functions/hasPermission'; import { settings } from '../../app/settings/server'; import { callbacks } from '../../lib/callbacks'; +import { getSubscriptionAutotranslateDefaultConfig } from '../lib/getSubscriptionAutotranslateDefaultConfig'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -55,6 +56,7 @@ Meteor.methods({ continue; } await callbacks.run('beforeJoinRoom', user, room); + const autoTranslateConfig = await getSubscriptionAutotranslateDefaultConfig(user); await Subscriptions.createWithRoomAndUser(room, user, { ts: now, open: true, @@ -62,6 +64,7 @@ Meteor.methods({ unread: 1, userMentions: 1, groupMentions: 0, + ...autoTranslateConfig, }); await Message.saveSystemMessage('uj', rid, user.username || '', user, { ts: now }); await callbacks.run('afterJoinRoom', user, room); diff --git a/apps/meteor/server/settings/message.ts b/apps/meteor/server/settings/message.ts index b0cda60fe60a..17dd1f7b230d 100644 --- a/apps/meteor/server/settings/message.ts +++ b/apps/meteor/server/settings/message.ts @@ -245,6 +245,14 @@ export const createMessageSettings = () => public: true, }); + await this.add('AutoTranslate_AutoEnableOnJoinRoom', false, { + type: 'boolean', + group: 'Message', + section: 'AutoTranslate', + public: true, + enableQuery: [{ _id: 'AutoTranslate_Enabled', value: true }], + }); + await this.add('AutoTranslate_ServiceProvider', 'google-translate', { type: 'select', group: 'Message', diff --git a/apps/meteor/tests/end-to-end/api/00-autotranslate.js b/apps/meteor/tests/end-to-end/api/00-autotranslate.js index 52adb69f17c7..48bb021ce388 100644 --- a/apps/meteor/tests/end-to-end/api/00-autotranslate.js +++ b/apps/meteor/tests/end-to-end/api/00-autotranslate.js @@ -1,9 +1,12 @@ import { expect } from 'chai'; -import { before, describe, it } from 'mocha'; +import { before, describe, after, it } from 'mocha'; import { getCredentials, api, request, credentials } from '../../data/api-data.js'; import { sendSimpleMessage } from '../../data/chat.helper'; import { updatePermission, updateSetting } from '../../data/permissions.helper'; +import { createRoom } from '../../data/rooms.helper'; +import { password } from '../../data/user'; +import { createUser, login } from '../../data/users.helper.js'; describe('AutoTranslate', function () { this.retries(0); @@ -314,5 +317,130 @@ describe('AutoTranslate', function () { .end(done); }); }); + describe('Autoenable setting', () => { + let userA; + let userB; + let credA; + let credB; + let channel; + + const createChannel = async (members, cred) => + (await createRoom({ type: 'c', members, name: `channel-test-${Date.now()}`, credentials: cred })).body.channel; + + const setLanguagePref = async (language, cred) => { + await request + .post(api('users.setPreferences')) + .set(cred) + .send({ data: { language } }) + .expect(200) + .expect('Content-Type', 'application/json') + .expect((res) => { + expect(res.body).to.have.property('success', true); + }); + }; + + const getSub = async (roomId, cred) => + ( + await request + .get(api('subscriptions.getOne')) + .set(cred) + .query({ + roomId, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('subscription').and.to.be.an('object'); + }) + ).body.subscription; + + before(async () => { + await updateSetting('AutoTranslate_Enabled', true); + await updateSetting('AutoTranslate_AutoEnableOnJoinRoom', true); + await updateSetting('Language', 'pt-BR'); + + channel = await createChannel(); + userA = await createUser(); + userB = await createUser(); + + credA = await login(userA.username, password); + credB = await login(userB.username, password); + + await setLanguagePref('en', credB); + }); + + after(async () => { + await updateSetting('AutoTranslate_AutoEnableOnJoinRoom', false); + await updateSetting('AutoTranslate_Enabled', false); + await updateSetting('Language', ''); + }); + + it("should do nothing if the user hasn't changed his language preference", async () => { + const sub = await getSub(channel._id, credentials); + expect(sub).to.not.have.property('autoTranslate'); + expect(sub).to.not.have.property('autoTranslateLanguage'); + }); + + it("should do nothing if the user changed his language preference to be the same as the server's", async () => { + await setLanguagePref('pt-BR', credA); + + const channel = await createChannel(undefined, credA); + const sub = await getSub(channel._id, credA); + expect(sub).to.not.have.property('autoTranslate'); + expect(sub).to.not.have.property('autoTranslateLanguage'); + }); + + it('should enable autotranslate with the correct language when creating a new room', async () => { + await setLanguagePref('en', credA); + + const channel = await createChannel(undefined, credA); + const sub = await getSub(channel._id, credA); + expect(sub).to.have.property('autoTranslate'); + expect(sub).to.have.property('autoTranslateLanguage').and.to.be.equal('en'); + }); + + it('should enable autotranslate for all the members added to the room upon creation', async () => { + const channel = await createChannel([userA.username, userB.username]); + const subA = await getSub(channel._id, credA); + expect(subA).to.have.property('autoTranslate'); + expect(subA).to.have.property('autoTranslateLanguage').and.to.be.equal('en'); + + const subB = await getSub(channel._id, credB); + expect(subB).to.have.property('autoTranslate'); + expect(subB).to.have.property('autoTranslateLanguage').and.to.be.equal('en'); + }); + + it('should enable autotranslate with the correct language when joining a room', async () => { + await request + .post(api('channels.join')) + .set(credA) + .send({ + roomId: channel._id, + }) + .expect('Content-Type', 'application/json') + .expect(200); + + const sub = await getSub(channel._id, credA); + expect(sub).to.have.property('autoTranslate'); + expect(sub).to.have.property('autoTranslateLanguage').and.to.be.equal('en'); + }); + + it('should enable autotranslate with the correct language when added to a room', async () => { + await request + .post(api('channels.invite')) + .set(credentials) + .send({ + roomId: channel._id, + userId: userB._id, + }) + .expect('Content-Type', 'application/json') + .expect(200); + + const sub = await getSub(channel._id, credB); + expect(sub).to.have.property('autoTranslate'); + expect(sub).to.have.property('autoTranslateLanguage').and.to.be.equal('en'); + }); + }); }); }); From 59f581dcc42f52d5ff29432257f8551979b97596 Mon Sep 17 00:00:00 2001 From: Marcos Spessatto Defendi Date: Fri, 29 Sep 2023 02:04:24 -0300 Subject: [PATCH 213/275] feat: add supported versions + minimum clients versions to the info endpoint (#30178) --- apps/meteor/app/api/server/default/info.ts | 1 - .../app/api/server/lib/getServerInfo.spec.ts | 52 ++++++++ .../app/api/server/lib/getServerInfo.ts | 40 ++++-- .../functions/getUserCloudAccessToken.ts | 113 ---------------- .../functions/getWorkspaceAccessToken.ts | 48 ++++++- .../server/functions/getWorkspaceLicense.ts | 60 ++++----- .../server/functions/reconnectWorkspace.ts | 2 +- .../functions/startRegisterWorkspace.ts | 2 +- .../supportedVersionsChooseLatest.spec.ts | 23 ++++ .../supportedVersionsChooseLatest.ts | 9 ++ .../supportedVersionsToken.ts | 123 ++++++++++++++++++ .../server/functions/syncWorkspace/index.ts | 17 +++ .../syncCloudData.ts} | 63 +++------ apps/meteor/app/cloud/server/methods.ts | 4 +- apps/meteor/client/definitions/info.d.ts | 5 + .../views/admin/cloud/RegisterWorkspace.tsx | 6 +- apps/meteor/package.json | 7 + .../plugin/compile-version.js | 8 +- apps/meteor/server/settings/setup-wizard.ts | 7 + .../tests/end-to-end/api/00-miscellaneous.js | 1 + ee/apps/account-service/Dockerfile | 2 + ee/apps/authorization-service/Dockerfile | 2 + ee/apps/ddp-streamer/Dockerfile | 2 + ee/apps/omnichannel-transcript/Dockerfile | 2 + ee/apps/presence-service/Dockerfile | 2 + ee/apps/queue-worker/Dockerfile | 2 + ee/apps/stream-hub-service/Dockerfile | 2 + ee/packages/license/package.json | 3 +- .../license/src/definition/ILicenseV3.ts | 4 + ee/packages/license/src/index.ts | 8 +- packages/rest-typings/src/default/index.ts | 62 ++++----- .../server-cloud-communication/.eslintrc.json | 4 + .../server-cloud-communication/package.json | 23 ++++ .../src/definitions/index.ts | 40 ++++++ .../server-cloud-communication/src/index.ts | 3 + .../server-cloud-communication/tsconfig.json | 8 ++ yarn.lock | 34 +++++ 37 files changed, 547 insertions(+), 247 deletions(-) create mode 100644 apps/meteor/app/api/server/lib/getServerInfo.spec.ts delete mode 100644 apps/meteor/app/cloud/server/functions/getUserCloudAccessToken.ts create mode 100644 apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsChooseLatest.spec.ts create mode 100644 apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsChooseLatest.ts create mode 100644 apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts create mode 100644 apps/meteor/app/cloud/server/functions/syncWorkspace/index.ts rename apps/meteor/app/cloud/server/functions/{syncWorkspace.ts => syncWorkspace/syncCloudData.ts} (50%) create mode 100644 packages/server-cloud-communication/.eslintrc.json create mode 100644 packages/server-cloud-communication/package.json create mode 100644 packages/server-cloud-communication/src/definitions/index.ts create mode 100644 packages/server-cloud-communication/src/index.ts create mode 100644 packages/server-cloud-communication/tsconfig.json diff --git a/apps/meteor/app/api/server/default/info.ts b/apps/meteor/app/api/server/default/info.ts index b7806ab08f32..8297f90fffd9 100644 --- a/apps/meteor/app/api/server/default/info.ts +++ b/apps/meteor/app/api/server/default/info.ts @@ -8,7 +8,6 @@ API.default.addRoute( { async get() { const user = await getLoggedInUser(this.request); - return API.v1.success(await getServerInfo(user?._id)); }, }, diff --git a/apps/meteor/app/api/server/lib/getServerInfo.spec.ts b/apps/meteor/app/api/server/lib/getServerInfo.spec.ts new file mode 100644 index 000000000000..ca55cfa33e3e --- /dev/null +++ b/apps/meteor/app/api/server/lib/getServerInfo.spec.ts @@ -0,0 +1,52 @@ +import { expect } from 'chai'; +import { describe, it } from 'mocha'; +import proxyquire from 'proxyquire'; +import sinon from 'sinon'; + +const hasAllPermissionAsyncMock = sinon.stub(); +const getCachedSupportedVersionsTokenMock = sinon.stub(); + +const { getServerInfo } = proxyquire.noCallThru().load('./getServerInfo', { + '../../../utils/rocketchat.info': { + Info: { + version: '3.0.1', + }, + }, + '../../../authorization/server/functions/hasPermission': { + hasPermissionAsync: hasAllPermissionAsyncMock, + }, + '../../../cloud/server/functions/supportedVersionsToken/supportedVersionsToken': { + getCachedSupportedVersionsToken: getCachedSupportedVersionsTokenMock, + }, + '../../../settings/server': { + settings: new Map(), + }, +}); +describe('#getServerInfo()', () => { + beforeEach(() => { + hasAllPermissionAsyncMock.reset(); + getCachedSupportedVersionsTokenMock.reset(); + }); + + it('should return only the version (without the patch info) when the user is not present', async () => { + expect(await getServerInfo(undefined)).to.be.eql({ version: '3.0' }); + }); + + it('should return only the version (without the patch info) when the user present but they dont have permission', async () => { + hasAllPermissionAsyncMock.resolves(false); + expect(await getServerInfo('userId')).to.be.eql({ version: '3.0' }); + }); + + it('should return the info object + the supportedVersions from the cloud when the request to the cloud was a success', async () => { + const signedJwt = 'signedJwt'; + hasAllPermissionAsyncMock.resolves(true); + getCachedSupportedVersionsTokenMock.resolves(signedJwt); + expect(await getServerInfo('userId')).to.be.eql({ info: { version: '3.0.1', supportedVersions: signedJwt } }); + }); + + it('should return the info object ONLY from the cloud when the request to the cloud was NOT a success', async () => { + hasAllPermissionAsyncMock.resolves(true); + getCachedSupportedVersionsTokenMock.rejects(); + expect(await getServerInfo('userId')).to.be.eql({ info: { version: '3.0.1' } }); + }); +}); diff --git a/apps/meteor/app/api/server/lib/getServerInfo.ts b/apps/meteor/app/api/server/lib/getServerInfo.ts index 39f4b82b350b..53ba3656babe 100644 --- a/apps/meteor/app/api/server/lib/getServerInfo.ts +++ b/apps/meteor/app/api/server/lib/getServerInfo.ts @@ -1,23 +1,37 @@ import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; -import { Info } from '../../../utils/rocketchat.info'; +import { + getCachedSupportedVersionsToken, + wrapPromise, +} from '../../../cloud/server/functions/supportedVersionsToken/supportedVersionsToken'; +import { Info, minimumClientVersions } from '../../../utils/rocketchat.info'; -type ServerInfo = - | { - info: typeof Info; - } - | { - version: string | undefined; - }; +type ServerInfo = { + info?: typeof Info; + supportedVersions?: { signed: string }; + minimumClientVersions: typeof minimumClientVersions; + version: string; +}; const removePatchInfo = (version: string): string => version.replace(/(\d+\.\d+).*/, '$1'); export async function getServerInfo(userId?: string): Promise { - if (userId && (await hasPermissionAsync(userId, 'get-server-info'))) { - return { - info: Info, - }; - } + const hasPermissionToViewStatistics = userId && (await hasPermissionAsync(userId, 'view-statistics')); + const supportedVersionsToken = await wrapPromise(getCachedSupportedVersionsToken()); + return { version: removePatchInfo(Info.version), + + ...(hasPermissionToViewStatistics && { + info: { + ...Info, + }, + version: Info.version, + }), + + minimumClientVersions, + ...(supportedVersionsToken.success && + supportedVersionsToken.result && { + supportedVersions: { signed: supportedVersionsToken.result }, + }), }; } diff --git a/apps/meteor/app/cloud/server/functions/getUserCloudAccessToken.ts b/apps/meteor/app/cloud/server/functions/getUserCloudAccessToken.ts deleted file mode 100644 index bf39a50b6234..000000000000 --- a/apps/meteor/app/cloud/server/functions/getUserCloudAccessToken.ts +++ /dev/null @@ -1,113 +0,0 @@ -import type { IUser } from '@rocket.chat/core-typings'; -import { Users } from '@rocket.chat/models'; -import { serverFetch as fetch } from '@rocket.chat/server-fetch'; - -import { SystemLogger } from '../../../../server/lib/logger/system'; -import { settings } from '../../../settings/server'; -import { userScopes } from '../oauthScopes'; -import { getRedirectUri } from './getRedirectUri'; -import { removeWorkspaceRegistrationInfo } from './removeWorkspaceRegistrationInfo'; -import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; -import { userLoggedOut } from './userLoggedOut'; - -export async function getUserCloudAccessToken(userId: string, forceNew = false, scope = '', save = true) { - const { workspaceRegistered } = await retrieveRegistrationStatus(); - - if (!workspaceRegistered) { - return ''; - } - - if (!userId) { - return ''; - } - - const user = await Users.findOneById>(userId, { projection: { 'services.cloud': 1 } }); - if (!user?.services?.cloud?.accessToken || !user?.services?.cloud?.refreshToken) { - return ''; - } - - const { accessToken, refreshToken, expiresAt } = user.services.cloud; - - const clientId = settings.get('Cloud_Workspace_Client_Id'); - if (!clientId) { - return ''; - } - - const clientSecret = settings.get('Cloud_Workspace_Client_Secret'); - if (!clientSecret) { - return ''; - } - - const now = new Date(); - - if (now < expiresAt && !forceNew) { - return accessToken; - } - - const cloudUrl = settings.get('Cloud_Url'); - const redirectUri = getRedirectUri(); - - if (scope === '') { - scope = userScopes.join(' '); - } - - let authTokenResult; - try { - const request = await fetch(`${cloudUrl}/api/oauth/token`, { - headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, - method: 'POST', - params: new URLSearchParams({ - client_id: clientId, - client_secret: clientSecret, - refresh_token: refreshToken, - scope, - grant_type: 'refresh_token', - redirect_uri: redirectUri, - }), - }); - - if (!request.ok) { - throw new Error((await request.json()).error); - } - - authTokenResult = await request.json(); - } catch (err: any) { - SystemLogger.error({ - msg: 'Failed to get User AccessToken from Rocket.Chat Cloud', - url: '/api/oauth/token', - err, - }); - - if (err) { - if (err.message.includes('oauth_invalid_client_credentials')) { - SystemLogger.error('Server has been unregistered from cloud'); - await removeWorkspaceRegistrationInfo(); - } - - if (err.message.includes('unauthorized')) { - await userLoggedOut(userId); - } - } - - return ''; - } - - if (save) { - const willExpireAt = new Date(); - willExpireAt.setSeconds(willExpireAt.getSeconds() + authTokenResult.expires_in); - - await Users.updateOne( - { _id: user._id }, - { - $set: { - 'services.cloud': { - accessToken: authTokenResult.access_token, - expiresAt: willExpireAt, - }, - }, - }, - ); - } - - return authTokenResult.access_token; -} diff --git a/apps/meteor/app/cloud/server/functions/getWorkspaceAccessToken.ts b/apps/meteor/app/cloud/server/functions/getWorkspaceAccessToken.ts index 2b731ef82757..b495e3342d4b 100644 --- a/apps/meteor/app/cloud/server/functions/getWorkspaceAccessToken.ts +++ b/apps/meteor/app/cloud/server/functions/getWorkspaceAccessToken.ts @@ -10,7 +10,7 @@ import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; * @param {boolean} save * @returns string */ -export async function getWorkspaceAccessToken(forceNew = false, scope = '', save = true) { +export async function getWorkspaceAccessToken(forceNew = false, scope = '', save = true): Promise { const { workspaceRegistered } = await retrieveRegistrationStatus(); if (!workspaceRegistered) { @@ -22,10 +22,11 @@ export async function getWorkspaceAccessToken(forceNew = false, scope = '', save if (expires === null) { throw new Error('Cloud_Workspace_Access_Token_Expires_At is not set'); } + const now = new Date(); if (expires.value && now < expires.value && !forceNew) { - return settings.get('Cloud_Workspace_Access_Token'); + return settings.get('Cloud_Workspace_Access_Token'); } const accessToken = await getWorkspaceAccessTokenWithScope(scope); @@ -39,3 +40,46 @@ export async function getWorkspaceAccessToken(forceNew = false, scope = '', save return accessToken.token; } + +export class CloudWorkspaceAccessTokenError extends Error { + constructor() { + super('Could not get workspace access token'); + } +} + +export async function getWorkspaceAccessTokenOrThrow(forceNew = false, scope = '', save = true): Promise { + const token = await getWorkspaceAccessToken(forceNew, scope, save); + + if (!token) { + throw new CloudWorkspaceAccessTokenError(); + } + + return token; +} + +export const generateWorkspaceBearerHttpHeaderOrThrow = async ( + forceNew = false, + scope = '', + save = true, +): Promise<{ Authorization: string }> => { + const token = await getWorkspaceAccessTokenOrThrow(forceNew, scope, save); + return { + Authorization: `Bearer ${token}`, + }; +}; + +export const generateWorkspaceBearerHttpHeader = async ( + forceNew = false, + scope = '', + save = true, +): Promise<{ Authorization: string } | undefined> => { + const token = await getWorkspaceAccessToken(forceNew, scope, save); + + if (!token) { + return undefined; + } + + return { + Authorization: `Bearer ${token}`, + }; +}; diff --git a/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts b/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts index 275e646e5343..6be18f86d466 100644 --- a/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts +++ b/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts @@ -5,64 +5,52 @@ import { callbacks } from '../../../../lib/callbacks'; import { SystemLogger } from '../../../../server/lib/logger/system'; import { settings } from '../../../settings/server'; import { LICENSE_VERSION } from '../license'; -import { getWorkspaceAccessToken } from './getWorkspaceAccessToken'; +import { generateWorkspaceBearerHttpHeaderOrThrow } from './getWorkspaceAccessToken'; +import { handleResponse } from './supportedVersionsToken/supportedVersionsToken'; -export async function getWorkspaceLicense(): Promise<{ updated: boolean; license: string }> { - const currentLicense = await Settings.findOne('Cloud_Workspace_License'); - - const cachedLicenseReturn = async () => { - const license = currentLicense?.value as string; - if (license) { - await callbacks.run('workspaceLicenseChanged', license); - } +export async function getWorkspaceLicense() { + const token = await generateWorkspaceBearerHttpHeaderOrThrow(); - return { updated: false, license }; - }; + const currentLicense = await Settings.findOne('Cloud_Workspace_License'); - const token = await getWorkspaceAccessToken(); - if (!token) { - return cachedLicenseReturn(); + // TODO: check if this is the correct way to handle this + // If there is no license, in theory, it should be a new workspace non registered + // in this case the `generateWorkspaceBearerHttpHeaderOrThrow` show throw an error before + // so in theory, this should never happen + if (!currentLicense?._updatedAt) { + throw new Error('Failed to retrieve current license'); } - let licenseResult; - try { - const request = await fetch(`${settings.get('Cloud_Workspace_Registration_Client_Uri')}/license`, { + const request = await handleResponse( + fetch(`${settings.get('Cloud_Workspace_Registration_Client_Uri')}/license`, { headers: { - Authorization: `Bearer ${token}`, + ...token, }, params: { version: LICENSE_VERSION, }, - }); - - if (!request.ok) { - throw new Error((await request.json()).error); - } + }), + ); - licenseResult = await request.json(); - } catch (err: any) { + if (!request.success) { SystemLogger.error({ msg: 'Failed to update license from Rocket.Chat Cloud', url: '/license', - err, + err: request.error, }); - - return cachedLicenseReturn(); + if (currentLicense.value) { + return callbacks.run('workspaceLicenseChanged', currentLicense.value); + } + return; } - const remoteLicense = licenseResult; - - if (!currentLicense || !currentLicense._updatedAt) { - throw new Error('Failed to retrieve current license'); - } + const remoteLicense = request.result as any; if (remoteLicense.updatedAt <= currentLicense._updatedAt) { - return cachedLicenseReturn(); + return callbacks.run('workspaceLicenseChanged', currentLicense.value); } await Settings.updateValueById('Cloud_Workspace_License', remoteLicense.license); await callbacks.run('workspaceLicenseChanged', remoteLicense.license); - - return { updated: true, license: remoteLicense.license }; } diff --git a/apps/meteor/app/cloud/server/functions/reconnectWorkspace.ts b/apps/meteor/app/cloud/server/functions/reconnectWorkspace.ts index db425d2e8a30..7ee02a5e5de4 100644 --- a/apps/meteor/app/cloud/server/functions/reconnectWorkspace.ts +++ b/apps/meteor/app/cloud/server/functions/reconnectWorkspace.ts @@ -11,7 +11,7 @@ export async function reconnectWorkspace() { await Settings.updateValueById('Register_Server', true); - await syncWorkspace(true); + await syncWorkspace(); return true; } diff --git a/apps/meteor/app/cloud/server/functions/startRegisterWorkspace.ts b/apps/meteor/app/cloud/server/functions/startRegisterWorkspace.ts index af74fcd7d211..7f7c78a137e0 100644 --- a/apps/meteor/app/cloud/server/functions/startRegisterWorkspace.ts +++ b/apps/meteor/app/cloud/server/functions/startRegisterWorkspace.ts @@ -10,7 +10,7 @@ import { syncWorkspace } from './syncWorkspace'; export async function startRegisterWorkspace(resend = false) { const { workspaceRegistered } = await retrieveRegistrationStatus(); if (workspaceRegistered || process.env.TEST_MODE) { - await syncWorkspace(true); + await syncWorkspace(); return true; } diff --git a/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsChooseLatest.spec.ts b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsChooseLatest.spec.ts new file mode 100644 index 000000000000..183065fd92a6 --- /dev/null +++ b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsChooseLatest.spec.ts @@ -0,0 +1,23 @@ +import type { SignedSupportedVersions } from '@rocket.chat/server-cloud-communication'; + +import { supportedVersionsChooseLatest } from './supportedVersionsChooseLatest'; + +describe('supportedVersionsChooseLatest', () => { + test('should return the latest version', async () => { + const versionFromLicense: SignedSupportedVersions = { + signed: 'signed____', + timestamp: '2021-08-31T18:00:00.000Z', + versions: [], + }; + + const versionFromCloud: SignedSupportedVersions = { + signed: 'signed_------', + timestamp: '2021-08-31T19:00:00.000Z', + versions: [], + }; + + const result = await supportedVersionsChooseLatest(versionFromLicense, versionFromCloud); + + expect(result.timestamp).toBe(versionFromCloud.timestamp); + }); +}); diff --git a/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsChooseLatest.ts b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsChooseLatest.ts new file mode 100644 index 000000000000..f0683535de6b --- /dev/null +++ b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsChooseLatest.ts @@ -0,0 +1,9 @@ +import type { SignedSupportedVersions } from '@rocket.chat/server-cloud-communication'; + +export const supportedVersionsChooseLatest = async (...tokens: (SignedSupportedVersions | undefined)[]) => { + const [token] = (tokens.filter(Boolean) as SignedSupportedVersions[]).sort((a, b) => { + return new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime(); + }); + + return token; +}; diff --git a/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts new file mode 100644 index 000000000000..3d79ed436e51 --- /dev/null +++ b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts @@ -0,0 +1,123 @@ +import type { SettingValue } from '@rocket.chat/core-typings'; +import { License } from '@rocket.chat/license'; +import { Settings } from '@rocket.chat/models'; +import type { SupportedVersions } from '@rocket.chat/server-cloud-communication'; +import type { Response } from '@rocket.chat/server-fetch'; +import { serverFetch as fetch } from '@rocket.chat/server-fetch'; + +import { SystemLogger } from '../../../../../server/lib/logger/system'; +import { settings } from '../../../../settings/server'; +import { generateWorkspaceBearerHttpHeader } from '../getWorkspaceAccessToken'; +import { supportedVersionsChooseLatest } from './supportedVersionsChooseLatest'; + +/** HELPERS */ + +export const wrapPromise = ( + promise: Promise, +): Promise< + | { + success: true; + result: T; + } + | { + success: false; + error: any; + } +> => + promise + .then((result) => ({ success: true, result } as const)) + .catch((error) => ({ + success: false, + error, + })); + +export const handleResponse = async (promise: Promise) => { + return wrapPromise( + (async () => { + const request = await promise; + if (!request.ok) { + if (request.size > 0) { + throw new Error((await request.json()).error); + } + throw new Error(request.statusText); + } + + return request.json(); + })(), + ); +}; + +const cacheValueInSettings = ( + key: string, + fn: () => Promise, +): (() => Promise) & { + reset: () => Promise; +} => { + const reset = async () => { + const value = await fn(); + + await Settings.updateValueById(key, value); + + return value; + }; + + return Object.assign( + async () => { + const storedValue = settings.get(key); + + if (storedValue) { + return storedValue; + } + + return reset(); + }, + { + reset, + }, + ); +}; + +/** CODE */ + +const getSupportedVersionsFromCloud = async () => { + if (process.env.CLOUD_SUPPORTED_VERSIONS_TOKEN) { + return { + success: true, + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + result: JSON.parse(process.env.CLOUD_SUPPORTED_VERSIONS!), + }; + } + + const headers = await generateWorkspaceBearerHttpHeader(); + + const response = await handleResponse( + fetch('https://releases.rocket.chat/v2/server/supportedVersions', { + headers, + }), + ); + + if (!response.success) { + SystemLogger.error({ + msg: 'Failed to communicate with Rocket.Chat Cloud', + url: 'https://releases.rocket.chat/v2/server/supportedVersions', + err: response.error, + }); + } + + return response; +}; + +const getSupportedVersionsToken = async () => { + /** + * Gets the supported versions from the license + * Gets the supported versions from the cloud + * Gets the latest version + * return the token + */ + + const [versionsFromLicense, response] = await Promise.all([License.supportedVersions(), getSupportedVersionsFromCloud()]); + + return (await supportedVersionsChooseLatest(versionsFromLicense, (response.success && response.result) || undefined))?.signed; +}; + +export const getCachedSupportedVersionsToken = cacheValueInSettings('Cloud_Workspace_Supported_Versions_Token', getSupportedVersionsToken); diff --git a/apps/meteor/app/cloud/server/functions/syncWorkspace/index.ts b/apps/meteor/app/cloud/server/functions/syncWorkspace/index.ts new file mode 100644 index 000000000000..48d5afa9dbc5 --- /dev/null +++ b/apps/meteor/app/cloud/server/functions/syncWorkspace/index.ts @@ -0,0 +1,17 @@ +import { CloudWorkspaceAccessTokenError } from '../getWorkspaceAccessToken'; +import { getWorkspaceLicense } from '../getWorkspaceLicense'; +import { getCachedSupportedVersionsToken } from '../supportedVersionsToken/supportedVersionsToken'; +import { syncCloudData } from './syncCloudData'; + +export async function syncWorkspace() { + try { + await syncCloudData(); + await getWorkspaceLicense(); + } catch (error) { + if (error instanceof CloudWorkspaceAccessTokenError) { + // TODO: Remove License if there is no access token + } + } + + await getCachedSupportedVersionsToken.reset(); +} diff --git a/apps/meteor/app/cloud/server/functions/syncWorkspace.ts b/apps/meteor/app/cloud/server/functions/syncWorkspace/syncCloudData.ts similarity index 50% rename from apps/meteor/app/cloud/server/functions/syncWorkspace.ts rename to apps/meteor/app/cloud/server/functions/syncWorkspace/syncCloudData.ts index c8a323e40f95..0dc56f31c5da 100644 --- a/apps/meteor/app/cloud/server/functions/syncWorkspace.ts +++ b/apps/meteor/app/cloud/server/functions/syncWorkspace/syncCloudData.ts @@ -2,60 +2,37 @@ import { NPS, Banner } from '@rocket.chat/core-services'; import { Settings } from '@rocket.chat/models'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; -import { SystemLogger } from '../../../../server/lib/logger/system'; -import { getAndCreateNpsSurvey } from '../../../../server/services/nps/getAndCreateNpsSurvey'; -import { settings } from '../../../settings/server'; -import { buildWorkspaceRegistrationData } from './buildRegistrationData'; -import { getWorkspaceAccessToken } from './getWorkspaceAccessToken'; -import { getWorkspaceLicense } from './getWorkspaceLicense'; -import { retrieveRegistrationStatus } from './retrieveRegistrationStatus'; - -export async function syncWorkspace(_reconnectCheck = false) { - const { workspaceRegistered } = await retrieveRegistrationStatus(); - if (!workspaceRegistered) { - return false; - } - +import { SystemLogger } from '../../../../../server/lib/logger/system'; +import { getAndCreateNpsSurvey } from '../../../../../server/services/nps/getAndCreateNpsSurvey'; +import { settings } from '../../../../settings/server'; +import { buildWorkspaceRegistrationData } from '../buildRegistrationData'; +import { generateWorkspaceBearerHttpHeaderOrThrow } from '../getWorkspaceAccessToken'; +import { handleResponse } from '../supportedVersionsToken/supportedVersionsToken'; + +export async function syncCloudData() { const info = await buildWorkspaceRegistrationData(undefined); - const workspaceUrl = settings.get('Cloud_Workspace_Registration_Client_Uri'); - - let result; - try { - const headers: Record = {}; - const token = await getWorkspaceAccessToken(true); - - if (token) { - headers.Authorization = `Bearer ${token}`; - } else { - return false; - } + const token = await generateWorkspaceBearerHttpHeaderOrThrow(true); - const request = await fetch(`${workspaceUrl}/client`, { - headers, + const request = await handleResponse( + fetch(`${settings.get('Cloud_Workspace_Registration_Client_Uri')}/client`, { + headers: { + ...token, + }, body: info, method: 'POST', - }); + }), + ); - if (!request.ok) { - throw new Error((await request.json()).error); - } - - result = await request.json(); - } catch (err: any) { - SystemLogger.error({ + if (!request.success) { + return SystemLogger.error({ msg: 'Failed to sync with Rocket.Chat Cloud', url: '/client', - err, + err: request.error, }); - - return false; - } finally { - // aways fetch the license - await getWorkspaceLicense(); } - const data = result; + const data = request.result as any; if (!data) { return true; } diff --git a/apps/meteor/app/cloud/server/methods.ts b/apps/meteor/app/cloud/server/methods.ts index 89e7b99e7146..1d328d0c213e 100644 --- a/apps/meteor/app/cloud/server/methods.ts +++ b/apps/meteor/app/cloud/server/methods.ts @@ -108,7 +108,9 @@ Meteor.methods({ }); } - return syncWorkspace(); + await syncWorkspace(); + + return true; }, async 'cloud:connectWorkspace'(token) { check(token, String); diff --git a/apps/meteor/client/definitions/info.d.ts b/apps/meteor/client/definitions/info.d.ts index 2b66032f484a..43fa1fc53414 100644 --- a/apps/meteor/client/definitions/info.d.ts +++ b/apps/meteor/client/definitions/info.d.ts @@ -23,4 +23,9 @@ declare module '*.info' { tag?: string; branch?: string; }; + + export const minimumClientVersions: { + desktop: string; + mobile: string; + }; } diff --git a/apps/meteor/client/views/admin/cloud/RegisterWorkspace.tsx b/apps/meteor/client/views/admin/cloud/RegisterWorkspace.tsx index e3e1f474cb91..a75e66ec1e4b 100644 --- a/apps/meteor/client/views/admin/cloud/RegisterWorkspace.tsx +++ b/apps/meteor/client/views/admin/cloud/RegisterWorkspace.tsx @@ -57,9 +57,9 @@ const RegisterWorkspace = () => { - - {isWorkspaceRegistered && t('RegisterWorkspace_NotRegistered_Subtitle')} - {!isWorkspaceRegistered && t('RegisterWorkspace_Registered_Description')} + + {!isWorkspaceRegistered && t('RegisterWorkspace_NotRegistered_Subtitle')} + {isWorkspaceRegistered && t('RegisterWorkspace_Registered_Description')} diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 69bd345bc8fb..b59552d1fcc5 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -265,6 +265,7 @@ "@rocket.chat/presence": "workspace:^", "@rocket.chat/random": "workspace:^", "@rocket.chat/rest-typings": "workspace:^", + "@rocket.chat/server-cloud-communication": "workspace:^", "@rocket.chat/server-fetch": "workspace:^", "@rocket.chat/sha256": "workspace:^", "@rocket.chat/string-helpers": "next", @@ -471,5 +472,11 @@ }, "installConfig": { "hoistingLimits": "workspaces" + }, + "rocketchat": { + "minimumClientVersions": { + "desktop": "3.9.6", + "mobile": "4.39.0" + } } } diff --git a/apps/meteor/packages/rocketchat-version/plugin/compile-version.js b/apps/meteor/packages/rocketchat-version/plugin/compile-version.js index c283af960e67..20b26b9cdcf0 100644 --- a/apps/meteor/packages/rocketchat-version/plugin/compile-version.js +++ b/apps/meteor/packages/rocketchat-version/plugin/compile-version.js @@ -1,6 +1,8 @@ import { exec } from 'child_process'; import os from 'os'; import util from 'util'; +import path from 'path'; +import fs from 'fs'; const execAsync = util.promisify(exec); @@ -24,6 +26,9 @@ class VersionCompiler { }; output.marketplaceApiVersion = require('@rocket.chat/apps-engine/package.json').version.replace(/^[^0-9]/g, ''); + const minimumClientVersions = + JSON.parse(fs.readFileSync(path.resolve(process.cwd(), './package.json'), { encoding: 'utf8' }))?.rocketchat + ?.minimumClientVersions || {}; try { const result = await execAsync("git log --pretty=format:'%H%n%ad%n%an%n%s' -n 1"); const data = result.stdout.split('\n'); @@ -55,7 +60,8 @@ class VersionCompiler { // no branch } - output = `exports.Info = ${JSON.stringify(output, null, 4)};`; + output = `exports.Info = ${JSON.stringify(output, null, 4)}; + exports.minimumClientVersions = ${JSON.stringify(minimumClientVersions, null, 4)};`; file.addJavaScript({ data: output, diff --git a/apps/meteor/server/settings/setup-wizard.ts b/apps/meteor/server/settings/setup-wizard.ts index b5cdb4f6a4b1..62da3f1471cf 100644 --- a/apps/meteor/server/settings/setup-wizard.ts +++ b/apps/meteor/server/settings/setup-wizard.ts @@ -1204,6 +1204,13 @@ export const createSetupWSettings = () => secret: true, }); + await this.add('Cloud_Workspace_Supported_Versions_Token', '', { + type: 'string', + hidden: true, + readonly: true, + secret: true, + }); + await this.add('Cloud_Url', 'https://cloud.rocket.chat', { type: 'string', hidden: true, diff --git a/apps/meteor/tests/end-to-end/api/00-miscellaneous.js b/apps/meteor/tests/end-to-end/api/00-miscellaneous.js index 7525fd6ab443..e9fec42e4b66 100644 --- a/apps/meteor/tests/end-to-end/api/00-miscellaneous.js +++ b/apps/meteor/tests/end-to-end/api/00-miscellaneous.js @@ -24,6 +24,7 @@ describe('miscellaneous', function () { .expect('Content-Type', 'application/json') .expect(200) .expect((res) => { + expect(res.body).to.have.property('version').and.to.be.a('string'); expect(res.body.info).to.have.property('version').and.to.be.a('string'); expect(res.body.info).to.have.property('build').and.to.be.an('object'); expect(res.body.info).to.have.property('commit').and.to.be.an('object'); diff --git a/ee/apps/account-service/Dockerfile b/ee/apps/account-service/Dockerfile index dbd8717e8716..d3dff1f3d805 100644 --- a/ee/apps/account-service/Dockerfile +++ b/ee/apps/account-service/Dockerfile @@ -28,6 +28,8 @@ COPY ./packages/models/dist packages/models/dist COPY ./packages/logger/package.json packages/logger/package.json COPY ./packages/logger/dist packages/logger/dist +COPY ./packages/server-cloud-communication/ packages/server-cloud-communication/ + COPY ./ee/packages/license/package.json packages/license/package.json COPY ./ee/packages/license/dist packages/license/dist diff --git a/ee/apps/authorization-service/Dockerfile b/ee/apps/authorization-service/Dockerfile index dbd8717e8716..d3dff1f3d805 100644 --- a/ee/apps/authorization-service/Dockerfile +++ b/ee/apps/authorization-service/Dockerfile @@ -28,6 +28,8 @@ COPY ./packages/models/dist packages/models/dist COPY ./packages/logger/package.json packages/logger/package.json COPY ./packages/logger/dist packages/logger/dist +COPY ./packages/server-cloud-communication/ packages/server-cloud-communication/ + COPY ./ee/packages/license/package.json packages/license/package.json COPY ./ee/packages/license/dist packages/license/dist diff --git a/ee/apps/ddp-streamer/Dockerfile b/ee/apps/ddp-streamer/Dockerfile index 9386aac4f21e..19fef1639db5 100644 --- a/ee/apps/ddp-streamer/Dockerfile +++ b/ee/apps/ddp-streamer/Dockerfile @@ -34,6 +34,8 @@ COPY ./packages/models/dist packages/models/dist COPY ./packages/logger/package.json packages/logger/package.json COPY ./packages/logger/dist packages/logger/dist +COPY ./packages/server-cloud-communication/ packages/server-cloud-communication/ + COPY ./ee/packages/license/package.json packages/license/package.json COPY ./ee/packages/license/dist packages/license/dist diff --git a/ee/apps/omnichannel-transcript/Dockerfile b/ee/apps/omnichannel-transcript/Dockerfile index e6a1aa00fc88..2c3c22a998c3 100644 --- a/ee/apps/omnichannel-transcript/Dockerfile +++ b/ee/apps/omnichannel-transcript/Dockerfile @@ -28,6 +28,8 @@ COPY ./packages/models/dist packages/models/dist COPY ./packages/logger/package.json packages/logger/package.json COPY ./packages/logger/dist packages/logger/dist +COPY ./packages/server-cloud-communication/ packages/server-cloud-communication/ + COPY ./ee/packages/license/package.json packages/license/package.json COPY ./ee/packages/license/dist packages/license/dist diff --git a/ee/apps/presence-service/Dockerfile b/ee/apps/presence-service/Dockerfile index aabf78295b8f..9a056c4fde3d 100644 --- a/ee/apps/presence-service/Dockerfile +++ b/ee/apps/presence-service/Dockerfile @@ -31,6 +31,8 @@ COPY ./packages/models/dist packages/models/dist COPY ./packages/logger/package.json packages/logger/package.json COPY ./packages/logger/dist packages/logger/dist +COPY ./packages/server-cloud-communication/ packages/server-cloud-communication/ + COPY ./ee/packages/license/package.json packages/license/package.json COPY ./ee/packages/license/dist packages/license/dist diff --git a/ee/apps/queue-worker/Dockerfile b/ee/apps/queue-worker/Dockerfile index e6a1aa00fc88..2c3c22a998c3 100644 --- a/ee/apps/queue-worker/Dockerfile +++ b/ee/apps/queue-worker/Dockerfile @@ -28,6 +28,8 @@ COPY ./packages/models/dist packages/models/dist COPY ./packages/logger/package.json packages/logger/package.json COPY ./packages/logger/dist packages/logger/dist +COPY ./packages/server-cloud-communication/ packages/server-cloud-communication/ + COPY ./ee/packages/license/package.json packages/license/package.json COPY ./ee/packages/license/dist packages/license/dist diff --git a/ee/apps/stream-hub-service/Dockerfile b/ee/apps/stream-hub-service/Dockerfile index dbd8717e8716..d3dff1f3d805 100644 --- a/ee/apps/stream-hub-service/Dockerfile +++ b/ee/apps/stream-hub-service/Dockerfile @@ -28,6 +28,8 @@ COPY ./packages/models/dist packages/models/dist COPY ./packages/logger/package.json packages/logger/package.json COPY ./packages/logger/dist packages/logger/dist +COPY ./packages/server-cloud-communication/ packages/server-cloud-communication/ + COPY ./ee/packages/license/package.json packages/license/package.json COPY ./ee/packages/license/dist packages/license/dist diff --git a/ee/packages/license/package.json b/ee/packages/license/package.json index f6a1e7a2b7d5..24ecdc30bc49 100644 --- a/ee/packages/license/package.json +++ b/ee/packages/license/package.json @@ -42,6 +42,7 @@ "dependencies": { "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/jwt": "workspace:^", - "@rocket.chat/logger": "workspace:^" + "@rocket.chat/logger": "workspace:^", + "@rocket.chat/server-cloud-communication": "workspace:^" } } diff --git a/ee/packages/license/src/definition/ILicenseV3.ts b/ee/packages/license/src/definition/ILicenseV3.ts index d3a2d7f572a3..e2a8bd424bb2 100644 --- a/ee/packages/license/src/definition/ILicenseV3.ts +++ b/ee/packages/license/src/definition/ILicenseV3.ts @@ -1,3 +1,5 @@ +import type { SignedSupportedVersions } from '@rocket.chat/server-cloud-communication'; + import type { ILicenseTag } from './ILicenseTag'; import type { LicenseLimit } from './LicenseLimit'; import type { LicenseModule } from './LicenseModule'; @@ -59,6 +61,8 @@ export interface ILicenseV3 { monthlyActiveContacts?: LicenseLimit[]; }; cloudMeta?: Record; + + supportedVersions?: SignedSupportedVersions; } export type LicenseLimitKind = keyof ILicenseV3['limits']; diff --git a/ee/packages/license/src/index.ts b/ee/packages/license/src/index.ts index 9dbd94db53ed..11cf3bbbe4c5 100644 --- a/ee/packages/license/src/index.ts +++ b/ee/packages/license/src/index.ts @@ -1,4 +1,4 @@ -import type { LicenseLimitKind } from './definition/ILicenseV3'; +import type { ILicenseV3, LicenseLimitKind } from './definition/ILicenseV3'; import type { LimitContext } from './definition/LimitContext'; import { getAppsConfig, getMaxActiveUsers, getUnmodifiedLicenseAndModules } from './deprecated'; import { onLicense } from './events/deprecated'; @@ -45,6 +45,8 @@ interface License { onInvalidateLicense: typeof onInvalidateLicense; onLimitReached: typeof onLimitReached; + supportedVersions(): ILicenseV3['supportedVersions']; + // Deprecated: onLicense: typeof onLicense; // Deprecated: @@ -56,6 +58,10 @@ interface License { } export class LicenseImp extends LicenseManager implements License { + supportedVersions() { + return this.getLicense()?.supportedVersions; + } + validateFormat = validateFormat; hasModule = hasModule; diff --git a/packages/rest-typings/src/default/index.ts b/packages/rest-typings/src/default/index.ts index b3aa5d3aa535..0be60fc4413b 100644 --- a/packages/rest-typings/src/default/index.ts +++ b/packages/rest-typings/src/default/index.ts @@ -1,36 +1,38 @@ // eslint-disable-next-line @typescript-eslint/naming-convention export interface DefaultEndpoints { '/info': { - GET: () => - | { - info: { - build: { - arch: string; - cpus: number; - date: string; - freeMemory: number; - nodeVersion: string; - osRelease: string; - platform: string; - totalMemory: number; - }; - commit: { - author?: string; - branch?: string; - date?: string; - hash?: string; - subject?: string; - tag?: string; - }; - marketplaceApiVersion: string; - version: string; - tag?: string; - branch?: string; - }; - } - | { - version: string | undefined; - }; + GET: () => { + info: { + build: { + arch: string; + cpus: number; + date: string; + freeMemory: number; + nodeVersion: string; + osRelease: string; + platform: string; + totalMemory: number; + }; + commit: { + author?: string; + branch?: string; + date?: string; + hash?: string; + subject?: string; + tag?: string; + }; + marketplaceApiVersion: string; + version: string; + tag?: string; + branch?: string; + }; + supportedVersions?: { signed: string }; + minimumClientVersions: { + desktop: string; + mobile: string; + }; + version: string | undefined; + }; }; '/ecdh_proxy/initEncryptedSession': { POST: () => void; diff --git a/packages/server-cloud-communication/.eslintrc.json b/packages/server-cloud-communication/.eslintrc.json new file mode 100644 index 000000000000..a83aeda48e66 --- /dev/null +++ b/packages/server-cloud-communication/.eslintrc.json @@ -0,0 +1,4 @@ +{ + "extends": ["@rocket.chat/eslint-config"], + "ignorePatterns": ["**/dist"] +} diff --git a/packages/server-cloud-communication/package.json b/packages/server-cloud-communication/package.json new file mode 100644 index 000000000000..9b091bbc464f --- /dev/null +++ b/packages/server-cloud-communication/package.json @@ -0,0 +1,23 @@ +{ + "name": "@rocket.chat/server-cloud-communication", + "version": "0.0.1", + "private": true, + "devDependencies": { + "@types/jest": "~29.5.3", + "eslint": "~8.45.0", + "jest": "~29.6.1", + "ts-jest": "~29.0.5", + "typescript": "~5.1.6" + }, + "scripts": { + "lint": "eslint --ext .js,.jsx,.ts,.tsx .", + "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix", + "test": "jest", + "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput" + }, + "main": "./src/index.ts", + "types": "./src/index.ts", + "files": [ + "/dist" + ] +} diff --git a/packages/server-cloud-communication/src/definitions/index.ts b/packages/server-cloud-communication/src/definitions/index.ts new file mode 100644 index 000000000000..d554aa538059 --- /dev/null +++ b/packages/server-cloud-communication/src/definitions/index.ts @@ -0,0 +1,40 @@ +type Dictionary = { [lng: string]: Record }; + +type Message = { + remainingDays: number; + title: 'message_token'; + subtitle: 'message_token'; + description: 'message_token'; + type: 'info' | 'alert' | 'error'; + params: Record & { + instance_ws_name: string; + instance_domain: string; + remaining_days: number; + }; + link: string; +}; + +type Version = { + version: string; + expiration: Date; + messages?: Message[]; +}; + +// eslint-disable-next-line @typescript-eslint/naming-convention +export interface SupportedVersions { + timestamp: string; + messages?: Message[]; + versions: Version[]; + exceptions?: { + domain: string; + uniqueId: string; + messages?: Message[]; + versions: Version[]; + }; + i18n?: Dictionary; +} + +// eslint-disable-next-line @typescript-eslint/naming-convention +export interface SignedSupportedVersions extends SupportedVersions { + signed: string; // SerializedJWT; +} diff --git a/packages/server-cloud-communication/src/index.ts b/packages/server-cloud-communication/src/index.ts new file mode 100644 index 000000000000..a18306b926eb --- /dev/null +++ b/packages/server-cloud-communication/src/index.ts @@ -0,0 +1,3 @@ +import type { SupportedVersions, SignedSupportedVersions } from './definitions'; + +export { SupportedVersions, SignedSupportedVersions }; diff --git a/packages/server-cloud-communication/tsconfig.json b/packages/server-cloud-communication/tsconfig.json new file mode 100644 index 000000000000..e2be47cf5499 --- /dev/null +++ b/packages/server-cloud-communication/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.base.client.json", + "compilerOptions": { + "rootDir": "./src", + "outDir": "./dist" + }, + "include": ["./src/**/*"] +} diff --git a/yarn.lock b/yarn.lock index a3d8d34c8906..368d87e88f05 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8472,6 +8472,7 @@ __metadata: "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/jwt": "workspace:^" "@rocket.chat/logger": "workspace:^" + "@rocket.chat/server-cloud-communication": "workspace:^" "@swc/core": ^1.3.66 "@swc/jest": ^0.2.26 "@types/babel__core": ^7 @@ -8719,6 +8720,7 @@ __metadata: "@rocket.chat/presence": "workspace:^" "@rocket.chat/random": "workspace:^" "@rocket.chat/rest-typings": "workspace:^" + "@rocket.chat/server-cloud-communication": "workspace:^" "@rocket.chat/server-fetch": "workspace:^" "@rocket.chat/sha256": "workspace:^" "@rocket.chat/string-helpers": next @@ -9403,6 +9405,18 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/server-cloud-communication@workspace:^, @rocket.chat/server-cloud-communication@workspace:packages/server-cloud-communication": + version: 0.0.0-use.local + resolution: "@rocket.chat/server-cloud-communication@workspace:packages/server-cloud-communication" + dependencies: + "@types/jest": ~29.5.3 + eslint: ~8.45.0 + jest: ~29.6.1 + ts-jest: ~29.0.5 + typescript: ~5.1.6 + languageName: unknown + linkType: soft + "@rocket.chat/server-fetch@workspace:^, @rocket.chat/server-fetch@workspace:packages/server-fetch": version: 0.0.0-use.local resolution: "@rocket.chat/server-fetch@workspace:packages/server-fetch" @@ -37888,6 +37902,16 @@ __metadata: languageName: node linkType: hard +"typescript@npm:~5.1.6": + version: 5.1.6 + resolution: "typescript@npm:5.1.6" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: b2f2c35096035fe1f5facd1e38922ccb8558996331405eb00a5111cc948b2e733163cc22fab5db46992aba7dd520fff637f2c1df4996ff0e134e77d3249a7350 + languageName: node + linkType: hard + "typescript@patch:typescript@^5.2.2#~builtin, typescript@patch:typescript@~5.2.2#~builtin": version: 5.2.2 resolution: "typescript@patch:typescript@npm%3A5.2.2#~builtin::version=5.2.2&hash=f456af" @@ -37898,6 +37922,16 @@ __metadata: languageName: node linkType: hard +"typescript@patch:typescript@~5.1.6#~builtin": + version: 5.1.6 + resolution: "typescript@patch:typescript@npm%3A5.1.6#~builtin::version=5.1.6&hash=f456af" + bin: + tsc: bin/tsc + tsserver: bin/tsserver + checksum: 21e88b0a0c0226f9cb9fd25b9626fb05b4c0f3fddac521844a13e1f30beb8f14e90bd409a9ac43c812c5946d714d6e0dee12d5d02dfc1c562c5aacfa1f49b606 + languageName: node + linkType: hard + "ua-parser-js@npm:^1.0.35": version: 1.0.35 resolution: "ua-parser-js@npm:1.0.35" From 74934426501c20570a119f22988f547aeb6e84e5 Mon Sep 17 00:00:00 2001 From: Murtaza Patrawala <34130764+murtaza98@users.noreply.github.com> Date: Fri, 29 Sep 2023 18:32:53 +0400 Subject: [PATCH 214/275] chore: Deprecate un-used meteor method for omnichannel analytics (#30421) --- .changeset/thirty-jokes-compete.md | 5 +++++ .../app/livechat/server/methods/getAgentOverviewData.ts | 4 +--- .../app/livechat/server/methods/getAnalyticsOverviewData.ts | 2 ++ 3 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 .changeset/thirty-jokes-compete.md diff --git a/.changeset/thirty-jokes-compete.md b/.changeset/thirty-jokes-compete.md new file mode 100644 index 000000000000..9d4095e7771b --- /dev/null +++ b/.changeset/thirty-jokes-compete.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +chore: Deprecate un-used meteor method for omnichannel analytics diff --git a/apps/meteor/app/livechat/server/methods/getAgentOverviewData.ts b/apps/meteor/app/livechat/server/methods/getAgentOverviewData.ts index 94fae239b74c..9cd5de75a0f3 100644 --- a/apps/meteor/app/livechat/server/methods/getAgentOverviewData.ts +++ b/apps/meteor/app/livechat/server/methods/getAgentOverviewData.ts @@ -18,9 +18,7 @@ declare module '@rocket.chat/ui-contexts' { Meteor.methods({ async 'livechat:getAgentOverviewData'(options) { - methodDeprecationLogger.warn( - 'The method "livechat:getAgentOverviewData" is deprecated and will be removed after version v7.0.0. Use "livechat/analytics/agent-overview" instead.', - ); + methodDeprecationLogger.method('livechat:getAgentOverviewData', '7.0.0', ' Use "livechat/analytics/agent-overview" instead.'); const uid = Meteor.userId(); if (!uid || !(await hasPermissionAsync(uid, 'view-livechat-manager'))) { diff --git a/apps/meteor/app/livechat/server/methods/getAnalyticsOverviewData.ts b/apps/meteor/app/livechat/server/methods/getAnalyticsOverviewData.ts index 48313f1ce67c..76b7f276d671 100644 --- a/apps/meteor/app/livechat/server/methods/getAnalyticsOverviewData.ts +++ b/apps/meteor/app/livechat/server/methods/getAnalyticsOverviewData.ts @@ -3,6 +3,7 @@ import type { ServerMethods, TranslationKey } from '@rocket.chat/ui-contexts'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; +import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; import { settings } from '../../../settings/server'; import { Livechat } from '../lib/Livechat'; @@ -18,6 +19,7 @@ declare module '@rocket.chat/ui-contexts' { Meteor.methods({ async 'livechat:getAnalyticsOverviewData'(options) { + methodDeprecationLogger.method('livechat:getAnalyticsOverviewData', '7.0.0', ' Use "livechat/analytics/overview" instead.'); const uid = Meteor.userId(); if (!uid || !(await hasPermissionAsync(uid, 'view-livechat-manager'))) { throw new Meteor.Error('error-not-allowed', 'Not allowed', { From 430c7be8e1a802fe043e630b406cb0a3484542c8 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Fri, 29 Sep 2023 12:29:39 -0300 Subject: [PATCH 215/275] refactor: Livechat Header -> ts (#30255) Co-authored-by: Aleksander Nicacio da Silva <6494543+aleksandernsilva@users.noreply.github.com> --- packages/livechat/src/components/App/App.tsx | 21 +++- .../components/Header/{index.js => index.tsx} | 49 ++++++-- .../Screen/{Header.js => Header.tsx} | 106 ++++++++++-------- .../livechat/src/components/Tooltip/index.js | 2 +- packages/livechat/src/definitions/agents.d.ts | 13 +++ 5 files changed, 134 insertions(+), 57 deletions(-) rename packages/livechat/src/components/Header/{index.js => index.tsx} (67%) rename packages/livechat/src/components/Screen/{Header.js => Header.tsx} (54%) create mode 100644 packages/livechat/src/definitions/agents.d.ts diff --git a/packages/livechat/src/components/App/App.tsx b/packages/livechat/src/components/App/App.tsx index 0ca3f1b6b366..cfaa52b94999 100644 --- a/packages/livechat/src/components/App/App.tsx +++ b/packages/livechat/src/components/App/App.tsx @@ -75,7 +75,26 @@ type AppState = { poppedOut: boolean; }; -// eslint-disable-next-line react/prefer-stateless-function +export type ScreenPropsType = { + notificationsEnabled: boolean; + minimized: boolean; + expanded: boolean; + windowed: boolean; + sound: unknown; + alerts: unknown; + modal: unknown; + nameDefault: string; + emailDefault: string; + departmentDefault: string; + onEnableNotifications: () => unknown; + onDisableNotifications: () => unknown; + onMinimize: () => unknown; + onRestore: () => unknown; + onOpenWindow: () => unknown; + onDismissAlert: () => unknown; + dismissNotification: () => void; +}; + export class App extends Component { state = { initialized: false, diff --git a/packages/livechat/src/components/Header/index.js b/packages/livechat/src/components/Header/index.tsx similarity index 67% rename from packages/livechat/src/components/Header/index.js rename to packages/livechat/src/components/Header/index.tsx index 669b46571b0e..9764c3c2ce37 100644 --- a/packages/livechat/src/components/Header/index.js +++ b/packages/livechat/src/components/Header/index.tsx @@ -1,12 +1,41 @@ +import type { ComponentChildren, Ref } from 'preact'; import { toChildArray } from 'preact'; +import type { JSXInternal } from 'preact/src/jsx'; import { createClassName } from '../../helpers/createClassName'; import styles from './styles.scss'; -export const Header = ({ children, theme: { color: backgroundColor, fontColor: color } = {}, className, post, large, style, ...props }) => ( +type HeaderProps = { + children?: ComponentChildren; + theme?: { + color?: string; + fontColor?: string; + }; + className?: string; + post?: ComponentChildren; + large?: boolean; + style?: JSXInternal.CSSProperties; + ref?: Ref; + onClick?: JSXInternal.DOMAttributes['onClick']; +}; + +type HeaderComponentProps = { + children?: ComponentChildren; + className?: string; +}; + +export const Header = ({ + children, + theme: { color: backgroundColor, fontColor: color } = {}, + className, + post, + large, + style, + ...props +}: HeaderProps) => (
{children} @@ -14,25 +43,25 @@ export const Header = ({ children, theme: { color: backgroundColor, fontColor: c
); -export const Picture = ({ children, className = undefined, ...props }) => ( +export const Picture = ({ children, className = undefined, ...props }: HeaderComponentProps) => (
{children}
); -export const Content = ({ children, className = undefined, ...props }) => ( +export const Content = ({ children, className = undefined, ...props }: HeaderComponentProps) => (
{children}
); -export const Title = ({ children, className = undefined, ...props }) => ( +export const Title = ({ children, className = undefined, ...props }: HeaderComponentProps) => (
{children}
); -export const SubTitle = ({ children, className = undefined, ...props }) => ( +export const SubTitle = ({ children, className = undefined, ...props }: HeaderComponentProps) => (
(
); -export const Actions = ({ children, className = undefined, ...props }) => ( +export const Actions = ({ children, className = undefined, ...props }: HeaderComponentProps) => ( ); -export const Action = ({ children, className = undefined, ...props }) => ( +export const Action = ({ children, className = undefined, ...props }: HeaderComponentProps & { onClick?: () => void }) => ( ); -export const Post = ({ children, className = undefined, ...props }) => ( +export const Post = ({ children, className = undefined, ...props }: HeaderComponentProps) => (
{children}
); -export const CustomField = ({ children, className = undefined, ...props }) => ( +export const CustomField = ({ children, className = undefined, ...props }: HeaderComponentProps) => (
{children}
diff --git a/packages/livechat/src/components/Screen/Header.js b/packages/livechat/src/components/Screen/Header.tsx similarity index 54% rename from packages/livechat/src/components/Screen/Header.js rename to packages/livechat/src/components/Screen/Header.tsx index 9f9e41810c7b..671a5b343b21 100644 --- a/packages/livechat/src/components/Screen/Header.js +++ b/packages/livechat/src/components/Screen/Header.tsx @@ -1,6 +1,8 @@ -import { Component } from 'preact'; -import { withTranslation } from 'react-i18next'; +import type { ComponentChildren } from 'preact'; +import { useRef } from 'preact/hooks'; +import { useTranslation, withTranslation } from 'react-i18next'; +import type { Agent } from '../../definitions/agents'; import MinimizeIcon from '../../icons/arrowDown.svg'; import RestoreIcon from '../../icons/arrowUp.svg'; import NotificationsEnabledIcon from '../../icons/bell.svg'; @@ -11,70 +13,84 @@ import { Avatar } from '../Avatar'; import Header from '../Header'; import Tooltip from '../Tooltip'; -class ScreenHeader extends Component { - largeHeader = () => { - const { agent } = this.props; - return !!(agent && agent.email && agent.phone); +type screenHeaderProps = { + alerts: { id: string; children: ComponentChildren; [key: string]: unknown }[]; + agent: Agent; + notificationsEnabled: boolean; + minimized: boolean; + expanded: boolean; + windowed: boolean; + onDismissAlert?: (id?: string) => void; + onEnableNotifications: () => unknown; + onDisableNotifications: () => unknown; + onMinimize: () => unknown; + onRestore: () => unknown; + onOpenWindow: () => unknown; + queueInfo: { + spot: number; }; + title: string; +}; - headerTitle = (t) => { - const { agent, queueInfo, title } = this.props; - if (agent && agent.name) { +const ScreenHeader = ({ + alerts, + agent, + notificationsEnabled, + minimized, + expanded, + windowed, + onDismissAlert, + onEnableNotifications, + onDisableNotifications, + onMinimize, + onRestore, + onOpenWindow, + queueInfo, + title, +}: screenHeaderProps) => { + const { t } = useTranslation(); + const headerRef = useRef(null); + + const largeHeader = () => { + return !!(agent?.email && agent.phone); + }; + + const headerTitle = () => { + if (agent?.name) { return agent.name; } - if (queueInfo && queueInfo.spot && queueInfo.spot > 0) { + if (queueInfo?.spot && queueInfo.spot > 0) { return t('waiting_queue'); } return title; }; - render = ({ - alerts, - agent, - notificationsEnabled, - minimized, - expanded, - windowed, - onDismissAlert, - onEnableNotifications, - onDisableNotifications, - onMinimize, - onRestore, - onOpenWindow, - t, - }) => ( + return (
- {alerts && - alerts.map((alert) => ( - - {alert.children} - - ))} + {alerts?.map((alert) => ( + + {alert.children} + + ))} } - large={this.largeHeader()} + large={largeHeader()} > - {agent && agent.avatar && ( + {agent?.avatar && ( - + )} - {this.headerTitle(t)} - {agent && agent.email && {agent.email}} - {agent && agent.phone && {agent.phone}} + {headerTitle()} + {agent?.email && {agent.email}} + {agent?.phone && {agent.phone}} @@ -108,6 +124,6 @@ class ScreenHeader extends Component {
); -} +}; export default withTranslation()(ScreenHeader); diff --git a/packages/livechat/src/components/Tooltip/index.js b/packages/livechat/src/components/Tooltip/index.js index 2f5368d8729c..3b2d36f3609a 100644 --- a/packages/livechat/src/components/Tooltip/index.js +++ b/packages/livechat/src/components/Tooltip/index.js @@ -98,7 +98,7 @@ export class TooltipContainer extends Component { } } -export const TooltipTrigger = ({ children, content, placement }) => ( +export const TooltipTrigger = ({ children, content, placement = '' }) => ( {({ showTooltip, hideTooltip }) => toChildArray(children).map((child, index) => diff --git a/packages/livechat/src/definitions/agents.d.ts b/packages/livechat/src/definitions/agents.d.ts new file mode 100644 index 000000000000..da1b81242574 --- /dev/null +++ b/packages/livechat/src/definitions/agents.d.ts @@ -0,0 +1,13 @@ +// TODO: Fully type agents in livechat +export type Agent = { + name?: string; + status?: string; + email?: string; + phone?: string; + username: string; + avatar?: { + description: string; + src: string; + }; + [key: string]: unknown; +}; From bb5fe783c3eeb15d18ce61ddf88118266cdf91ff Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Fri, 29 Sep 2023 11:44:22 -0600 Subject: [PATCH 216/275] refactor: Omni logs (#30322) --- .../app/api/server/v1/voip/omnichannel.ts | 2 - .../business-hour/BusinessHourManager.ts | 2 - .../livechat/server/business-hour/Helper.ts | 1 - .../livechat/server/business-hour/Single.ts | 2 - .../livechat/server/hooks/afterUserActions.ts | 6 --- .../server/hooks/saveAnalyticsData.ts | 4 -- .../app/livechat/server/lib/Analytics.js | 6 --- .../app/livechat/server/lib/Departments.ts | 5 --- .../app/livechat/server/lib/QueueManager.ts | 9 ----- .../app/livechat/server/lib/RoutingManager.ts | 8 +--- .../app/livechat/server/sendMessageBySMS.ts | 13 ++----- apps/meteor/app/livechat/server/startup.ts | 4 +- .../server/business-hour/Multiple.ts | 38 +------------------ .../hooks/afterForwardChatToDepartment.ts | 3 -- .../server/hooks/afterInquiryQueued.ts | 2 - .../server/hooks/afterOnHold.ts | 2 - .../server/hooks/afterOnHoldChatResumed.ts | 1 - .../server/hooks/afterRemoveDepartment.ts | 1 - .../server/hooks/afterReturnRoomAsInquiry.ts | 2 - .../server/hooks/afterTakeInquiry.ts | 2 - .../hooks/applyDepartmentRestrictions.ts | 1 - .../server/hooks/applyRoomRestrictions.ts | 2 - .../applySimultaneousChatsRestrictions.ts | 4 -- .../hooks/beforeForwardRoomToDepartment.ts | 5 --- .../server/hooks/beforeNewInquiry.ts | 3 -- .../server/hooks/beforeRoutingChat.ts | 12 +----- .../hooks/checkAgentBeforeTakeInquiry.ts | 11 ++---- .../server/hooks/onAgentAssignmentFailed.ts | 5 --- .../server/hooks/onCloseLivechat.ts | 6 --- .../onLoadForwardDepartmentRestrictions.ts | 6 +-- .../server/hooks/onSaveVisitorInfo.ts | 7 ---- .../server/hooks/onTransferFailure.ts | 5 +-- .../server/hooks/scheduleAutoTransfer.ts | 6 +-- .../server/lib/AutoCloseOnHoldScheduler.ts | 4 +- .../server/lib/AutoTransferChatScheduler.ts | 4 +- .../livechat-enterprise/server/lib/Helper.ts | 5 +-- .../server/lib/QueueInactivityMonitor.ts | 8 ++-- .../server/lib/VisitorInactivityMonitor.ts | 24 +++--------- .../services/omnichannel.internalService.ts | 13 +------ .../ee/server/models/raw/LivechatRooms.ts | 23 ++--------- .../ee/server/models/raw/LivechatUnit.ts | 4 -- .../EmailInbox/EmailInbox_Incoming.ts | 30 ++------------- .../EmailInbox/EmailInbox_Outgoing.ts | 4 +- .../services/omnichannel-voip/service.ts | 21 ++-------- .../server/services/omnichannel/queue.ts | 9 ++--- .../src/OmnichannelTranscript.ts | 4 +- 46 files changed, 44 insertions(+), 295 deletions(-) diff --git a/apps/meteor/app/api/server/v1/voip/omnichannel.ts b/apps/meteor/app/api/server/v1/voip/omnichannel.ts index 6ffd0005c764..e1ee82d72478 100644 --- a/apps/meteor/app/api/server/v1/voip/omnichannel.ts +++ b/apps/meteor/app/api/server/v1/voip/omnichannel.ts @@ -78,7 +78,6 @@ API.v1.addRoute( } try { - logger.debug(`Setting extension ${extension} for agent with id ${user._id}`); await Users.setExtension(user._id, extension); return API.v1.success(); } catch (e) { @@ -146,7 +145,6 @@ API.v1.addRoute( return API.v1.notFound(); } if (!user.extension) { - logger.debug(`User ${user._id} is not associated with any extension. Skipping`); return API.v1.success(); } diff --git a/apps/meteor/app/livechat/server/business-hour/BusinessHourManager.ts b/apps/meteor/app/livechat/server/business-hour/BusinessHourManager.ts index 52ccd0441e24..c541e5f7b2c3 100644 --- a/apps/meteor/app/livechat/server/business-hour/BusinessHourManager.ts +++ b/apps/meteor/app/livechat/server/business-hour/BusinessHourManager.ts @@ -7,7 +7,6 @@ import moment from 'moment'; import { closeBusinessHour } from '../../../../ee/app/livechat-enterprise/server/business-hour/Helper'; import { callbacks } from '../../../../lib/callbacks'; import { settings } from '../../../settings/server'; -import { businessHourLogger } from '../lib/logger'; import type { IBusinessHourBehavior, IBusinessHourType } from './AbstractBusinessHour'; export class BusinessHourManager { @@ -27,7 +26,6 @@ export class BusinessHourManager { async startManager(): Promise { await this.createCronJobsForWorkHours(); - businessHourLogger.debug('Cron jobs created, setting up callbacks'); this.setupCallbacks(); await this.cleanupDisabledDepartmentReferences(); await this.behavior.onStartBusinessHours(); diff --git a/apps/meteor/app/livechat/server/business-hour/Helper.ts b/apps/meteor/app/livechat/server/business-hour/Helper.ts index e61bb1621765..e96ccb4c7b89 100644 --- a/apps/meteor/app/livechat/server/business-hour/Helper.ts +++ b/apps/meteor/app/livechat/server/business-hour/Helper.ts @@ -59,7 +59,6 @@ export const openBusinessHourDefault = async (): Promise => { await Users.makeAgentsWithinBusinessHourAvailable(); } await Users.updateLivechatStatusBasedOnBusinessHours(); - businessHourLogger.debug('Done opening default business hours'); }; export const createDefaultBusinessHourIfNotExists = async (): Promise => { diff --git a/apps/meteor/app/livechat/server/business-hour/Single.ts b/apps/meteor/app/livechat/server/business-hour/Single.ts index d899f2717376..5d2730dba9a1 100644 --- a/apps/meteor/app/livechat/server/business-hour/Single.ts +++ b/apps/meteor/app/livechat/server/business-hour/Single.ts @@ -8,7 +8,6 @@ import { filterBusinessHoursThatMustBeOpened, openBusinessHourDefault } from './ export class SingleBusinessHourBehavior extends AbstractBusinessHourBehavior implements IBusinessHourBehavior { async openBusinessHoursByDayAndHour(): Promise { - businessHourLogger.debug('opening single business hour'); return openBusinessHourDefault(); } @@ -23,7 +22,6 @@ export class SingleBusinessHourBehavior extends AbstractBusinessHourBehavior imp } async onStartBusinessHours(): Promise { - businessHourLogger.debug('Starting Single Business Hours'); return openBusinessHourDefault(); } diff --git a/apps/meteor/app/livechat/server/hooks/afterUserActions.ts b/apps/meteor/app/livechat/server/hooks/afterUserActions.ts index 30900481c4e2..0419f1d02a1d 100644 --- a/apps/meteor/app/livechat/server/hooks/afterUserActions.ts +++ b/apps/meteor/app/livechat/server/hooks/afterUserActions.ts @@ -3,7 +3,6 @@ import { Users } from '@rocket.chat/models'; import { callbacks } from '../../../../lib/callbacks'; import { Livechat } from '../lib/Livechat'; -import { callbackLogger } from '../lib/logger'; type IAfterSaveUserProps = { user: IUser; @@ -34,17 +33,12 @@ const handleAgentCreated = async (user: IUser) => { const handleDeactivateUser = async (user: IUser) => { if (wasAgent(user)) { - callbackLogger.debug({ - msg: 'Removing agent extension & making agent unavailable', - userId: user._id, - }); await Users.makeAgentUnavailableAndUnsetExtension(user._id); } }; const handleActivateUser = async (user: IUser) => { if (isAgent(user)) { - callbackLogger.debug('Adding agent', user._id); await Livechat.addAgent(user.username); } }; diff --git a/apps/meteor/app/livechat/server/hooks/saveAnalyticsData.ts b/apps/meteor/app/livechat/server/hooks/saveAnalyticsData.ts index ec584ec001d6..e92e6b4d940b 100644 --- a/apps/meteor/app/livechat/server/hooks/saveAnalyticsData.ts +++ b/apps/meteor/app/livechat/server/hooks/saveAnalyticsData.ts @@ -3,7 +3,6 @@ import { LivechatRooms } from '@rocket.chat/models'; import { callbacks } from '../../../../lib/callbacks'; import { normalizeMessageFileUpload } from '../../../utils/server/functions/normalizeMessageFileUpload'; -import { callbackLogger } from '../lib/logger'; callbacks.add( 'afterSaveMessage', @@ -13,7 +12,6 @@ callbacks.add( return message; } - callbackLogger.debug(`Calculating Omnichannel metrics for room ${room._id}`); // skips this callback if the message was edited if (!message || isEditedMessage(message)) { return message; @@ -43,7 +41,6 @@ callbacks.add( const isResponseTotal = room.metrics?.response?.total; if (agentLastReply === room.ts) { - callbackLogger.debug('Calculating: first message from agent'); // first response const firstResponseDate = now; const firstResponseTime = (now.getTime() - new Date(visitorLastQuery).getTime()) / 1000; @@ -66,7 +63,6 @@ callbacks.add( reactionTime, }; } else if (visitorLastQuery > agentLastReply) { - callbackLogger.debug('Calculating: visitor sent a message after agent'); // response, not first const responseTime = (now.getTime() - new Date(visitorLastQuery).getTime()) / 1000; const avgResponseTime = diff --git a/apps/meteor/app/livechat/server/lib/Analytics.js b/apps/meteor/app/livechat/server/lib/Analytics.js index 5f6e3469501e..28bed221afbf 100644 --- a/apps/meteor/app/livechat/server/lib/Analytics.js +++ b/apps/meteor/app/livechat/server/lib/Analytics.js @@ -43,8 +43,6 @@ export const Analytics = { const from = moment.tz(fDate, 'YYYY-MM-DD', timezone).startOf('day').utc(); const to = moment.tz(tDate, 'YYYY-MM-DD', timezone).endOf('day').utc(); - logger.debug(`getAgentOverviewData[${name}] -> Using timezone ${timezone} with date range ${from} - ${to}`); - if (!(moment(from).isValid() && moment(to).isValid())) { logger.error('livechat:getAgentOverviewData => Invalid dates'); return; @@ -79,8 +77,6 @@ export const Analytics = { const to = moment.tz(tDate, 'YYYY-MM-DD', timezone).endOf('day').utc(); const isSameDay = from.diff(to, 'days') === 0; - logger.debug(`getAnalyticsChartData[${name}] -> Using timezone ${timezone} with date range ${from} - ${to}`); - if (!(moment(from).isValid() && moment(to).isValid())) { logger.error('livechat:getAnalyticsChartData => Invalid dates'); return; @@ -133,8 +129,6 @@ export const Analytics = { const from = moment.tz(fDate, 'YYYY-MM-DD', timezone).startOf('day').utc(); const to = moment.tz(tDate, 'YYYY-MM-DD', timezone).endOf('day').utc(); - logger.debug(`getAnalyticsOverviewData[${name}] -> Using timezone ${timezone} with date range ${from} - ${to}`); - if (!(moment(from).isValid() && moment(to).isValid())) { logger.error('livechat:getAnalyticsOverviewData => Invalid dates'); return; diff --git a/apps/meteor/app/livechat/server/lib/Departments.ts b/apps/meteor/app/livechat/server/lib/Departments.ts index 0dd48a328fd1..f17015e52e79 100644 --- a/apps/meteor/app/livechat/server/lib/Departments.ts +++ b/apps/meteor/app/livechat/server/lib/Departments.ts @@ -12,7 +12,6 @@ class DepartmentHelperClass { const department = await LivechatDepartment.findOneById(departmentId); if (!department) { - this.logger.debug(`Department not found: ${departmentId}`); throw new Error('error-department-not-found'); } @@ -20,10 +19,8 @@ class DepartmentHelperClass { const ret = await LivechatDepartment.removeById(_id); if (ret.acknowledged !== true) { - this.logger.error(`Department record not removed: ${_id}. Result from db: ${ret}`); throw new Error('error-failed-to-delete-department'); } - this.logger.debug(`Department record removed: ${_id}`); const agentsIds: string[] = await LivechatDepartmentAgents.findAgentsByDepartmentId>( department._id, @@ -47,8 +44,6 @@ class DepartmentHelperClass { } }); - this.logger.debug(`Post-department-removal actions completed: ${_id}. Notifying callbacks with department and agentsIds`); - setImmediate(() => { void callbacks.run('livechat.afterRemoveDepartment', { department, agentsIds }); }); diff --git a/apps/meteor/app/livechat/server/lib/QueueManager.ts b/apps/meteor/app/livechat/server/lib/QueueManager.ts index 597f38b71ec0..aed0061e808e 100644 --- a/apps/meteor/app/livechat/server/lib/QueueManager.ts +++ b/apps/meteor/app/livechat/server/lib/QueueManager.ts @@ -23,7 +23,6 @@ export const queueInquiry = async (inquiry: ILivechatInquiryRecord, defaultAgent const dbInquiry = await LivechatInquiry.findOneById(inquiry._id); if (!dbInquiry) { - logger.error(`Inquiry with id ${inquiry._id} not found`); throw new Error('inquiry-not-found'); } @@ -68,7 +67,6 @@ export const QueueManager: queueManager = { ); if (!(await checkServiceStatus({ guest, agent }))) { - logger.debug(`Cannot create room for visitor ${guest._id}. No online agents`); throw new Meteor.Error('no-agent-online', 'Sorry, no online agents'); } @@ -96,8 +94,6 @@ export const QueueManager: queueManager = { throw new Error('inquiry-not-found'); } - logger.debug(`Generated inquiry for visitor ${guest._id} with id ${inquiry._id} [Not queued]`); - await LivechatRooms.updateRoomCount(); await queueInquiry(inquiry, agent); @@ -114,7 +110,6 @@ export const QueueManager: queueManager = { async unarchiveRoom(archivedRoom) { if (!archivedRoom) { - logger.error('No room to unarchive'); throw new Error('no-room-to-unarchive'); } @@ -145,17 +140,13 @@ export const QueueManager: queueManager = { await LivechatRooms.unarchiveOneById(rid); const room = await LivechatRooms.findOneById(rid); if (!room) { - logger.debug(`Room with id ${rid} not found`); throw new Error('room-not-found'); } const inquiry = await LivechatInquiry.findOneById(await createLivechatInquiry({ rid, name, guest, message, extraData: { source } })); if (!inquiry) { - logger.error(`Inquiry for visitor ${guest._id} not found`); throw new Error('inquiry-not-found'); } - logger.debug(`Generated inquiry for visitor ${v._id} with id ${inquiry._id} [Not queued]`); - await queueInquiry(inquiry, defaultAgent); logger.debug(`Inquiry ${inquiry._id} queued`); diff --git a/apps/meteor/app/livechat/server/lib/RoutingManager.ts b/apps/meteor/app/livechat/server/lib/RoutingManager.ts index 0e975ca06763..f2fd7010eb12 100644 --- a/apps/meteor/app/livechat/server/lib/RoutingManager.ts +++ b/apps/meteor/app/livechat/server/lib/RoutingManager.ts @@ -74,7 +74,7 @@ export const RoutingManager: Routing = { }, async setMethodNameAndStartQueue(name) { - logger.debug(`Changing default routing method from ${this.methodName} to ${name}`); + logger.info(`Changing default routing method from ${this.methodName} to ${name}`); if (!this.methods[name]) { logger.warn(`Cannot change routing method to ${name}. Selected Routing method does not exists. Defaulting to Manual_Selection`); this.methodName = 'Manual_Selection'; @@ -87,7 +87,6 @@ export const RoutingManager: Routing = { // eslint-disable-next-line @typescript-eslint/naming-convention registerMethod(name, Method) { - logger.debug(`Registering new routing method with name ${name}`); this.methods[name] = new Method(); }, @@ -188,7 +187,6 @@ export const RoutingManager: Routing = { const { servedBy } = room; if (servedBy) { - logger.debug(`Unassigning current agent for inquiry ${inquiry._id}`); await LivechatRooms.removeAgentByRoomId(rid); await this.removeAllRoomSubscriptions(room); await dispatchAgentDelegated(rid); @@ -254,7 +252,7 @@ export const RoutingManager: Routing = { await LivechatInquiry.takeInquiry(_id); const inq = await this.assignAgent(inquiry as InquiryWithAgentInfo, agent); - logger.debug(`Inquiry ${inquiry._id} taken by agent ${agent.agentId}`); + logger.info(`Inquiry ${inquiry._id} taken by agent ${agent.agentId}`); callbacks.runAsync('livechat.afterTakeInquiry', inq, agent); @@ -262,7 +260,6 @@ export const RoutingManager: Routing = { }, async transferRoom(room, guest, transferData) { - logger.debug(`Transfering room ${room._id} by ${transferData.transferredBy._id}`); if (transferData.departmentId) { logger.debug(`Transfering room ${room._id} to department ${transferData.departmentId}`); return forwardRoomToDepartment(room, guest, transferData); @@ -278,7 +275,6 @@ export const RoutingManager: Routing = { }, async delegateAgent(agent, inquiry) { - logger.debug(`Delegating Inquiry ${inquiry._id}`); const defaultAgent = await callbacks.run('livechat.beforeDelegateAgent', agent, { department: inquiry?.department, }); diff --git a/apps/meteor/app/livechat/server/sendMessageBySMS.ts b/apps/meteor/app/livechat/server/sendMessageBySMS.ts index ea220b24d149..2557fcdeb83d 100644 --- a/apps/meteor/app/livechat/server/sendMessageBySMS.ts +++ b/apps/meteor/app/livechat/server/sendMessageBySMS.ts @@ -10,33 +10,27 @@ import { callbackLogger } from './lib/logger'; callbacks.add( 'afterSaveMessage', async (message, room) => { - callbackLogger.debug('Attempting to send SMS message'); // skips this callback if the message was edited if (isEditedMessage(message)) { - callbackLogger.debug('Message was edited, skipping SMS send'); return message; } if (!settings.get('SMS_Enabled')) { - callbackLogger.debug('SMS is not enabled, skipping SMS send'); return message; } // only send the sms by SMS if it is a livechat room with SMS set to true if (!(isOmnichannelRoom(room) && room.sms && room.v && room.v.token)) { - callbackLogger.debug('Room is not a livechat room, skipping SMS send'); return message; } // if the message has a token, it was sent from the visitor, so ignore it if (message.token) { - callbackLogger.debug('Message was sent from the visitor, skipping SMS send'); return message; } // if the message has a type means it is a special message (like the closing comment), so skips if (message.t) { - callbackLogger.debug('Message is a special message, skipping SMS send'); return message; } @@ -52,8 +46,9 @@ callbacks.add( const { location } = message; extraData = Object.assign({}, extraData, { location }); } + const service = settings.get('SMS_Service'); - const SMSService = await OmnichannelIntegration.getSmsService(settings.get('SMS_Service')); + const SMSService = await OmnichannelIntegration.getSmsService(service); if (!SMSService) { callbackLogger.debug('SMS Service is not configured, skipping SMS send'); @@ -63,14 +58,12 @@ callbacks.add( const visitor = await LivechatVisitors.getVisitorByToken(room.v.token, { projection: { phone: 1 } }); if (!visitor?.phone || visitor.phone.length === 0) { - callbackLogger.debug('Visitor does not have a phone number, skipping SMS send'); return message; } try { - callbackLogger.debug(`Message will be sent to ${visitor.phone[0].phoneNumber} through service ${settings.get('SMS_Service')}`); await SMSService.send(room.sms.from, visitor.phone[0].phoneNumber, message.msg, extraData); - callbackLogger.debug(`SMS message sent to ${visitor.phone[0].phoneNumber}`); + callbackLogger.debug(`SMS message sent to ${visitor.phone[0].phoneNumber} via ${service}`); } catch (e) { callbackLogger.error(e); } diff --git a/apps/meteor/app/livechat/server/startup.ts b/apps/meteor/app/livechat/server/startup.ts index f24f88975b22..f9fce509e39a 100644 --- a/apps/meteor/app/livechat/server/startup.ts +++ b/apps/meteor/app/livechat/server/startup.ts @@ -62,14 +62,12 @@ Meteor.startup(async () => { await createDefaultBusinessHourIfNotExists(); settings.watch('Livechat_enable_business_hours', async (value) => { - Livechat.logger.debug(`Changing business hour type to ${value}`); + Livechat.logger.info(`Changing business hour type to ${value}`); if (value) { await businessHourManager.startManager(); - Livechat.logger.debug(`Business hour manager started`); return; } await businessHourManager.stopManager(); - Livechat.logger.debug(`Business hour manager stopped`); }); settings.watch('Livechat_Routing_Method', (value) => { diff --git a/apps/meteor/ee/app/livechat-enterprise/server/business-hour/Multiple.ts b/apps/meteor/ee/app/livechat-enterprise/server/business-hour/Multiple.ts index 22379e27698d..6c4aac024ab0 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/business-hour/Multiple.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/business-hour/Multiple.ts @@ -44,7 +44,7 @@ export class MultipleBusinessHoursBehavior extends AbstractBusinessHourBehavior }, }); const businessHoursToOpen = await filterBusinessHoursThatMustBeOpened(activeBusinessHours); - bhLogger.debug({ + bhLogger.info({ msg: 'Starting Multiple Business Hours', totalBusinessHoursToOpen: businessHoursToOpen.length, top10BusinessHoursToOpen: businessHoursToOpen.slice(0, 10), @@ -153,7 +153,6 @@ export class MultipleBusinessHoursBehavior extends AbstractBusinessHourBehavior } async onRemoveDepartment(options: { department: ILivechatDepartment; agentsIds: string[] }): Promise { - bhLogger.debug(`onRemoveDepartment: department ${options.department._id} removed`); const { department, agentsIds } = options; if (!department || !agentsIds?.length) { return options; @@ -163,10 +162,6 @@ export class MultipleBusinessHoursBehavior extends AbstractBusinessHourBehavior async onDepartmentDisabled(department: ILivechatDepartment): Promise { if (!department.businessHourId) { - bhLogger.debug({ - msg: 'onDepartmentDisabled: department has no business hour', - departmentId: department._id, - }); return; } @@ -186,7 +181,6 @@ export class MultipleBusinessHoursBehavior extends AbstractBusinessHourBehavior // cleanup user's cache for default business hour and this business hour const defaultBH = await this.BusinessHourRepository.findOneDefaultBusinessHour(); if (!defaultBH) { - bhLogger.error('onDepartmentDisabled: default business hour not found'); throw new Error('Default business hour not found'); } await this.UsersRepository.closeAgentsBusinessHoursByBusinessHourIds([businessHour._id, defaultBH._id]); @@ -203,37 +197,22 @@ export class MultipleBusinessHoursBehavior extends AbstractBusinessHourBehavior businessHour = await this.BusinessHourRepository.findOneById(department.businessHourId); if (!businessHour) { - bhLogger.error({ - msg: 'onDepartmentDisabled: business hour not found', - businessHourId: department.businessHourId, - }); - throw new Error(`Business hour ${department.businessHourId} not found`); } } // start default business hour and this BH if needed if (!settings.get('Livechat_enable_business_hours')) { - bhLogger.debug(`onDepartmentDisabled: business hours are disabled. skipping`); return; } const businessHourToOpen = await filterBusinessHoursThatMustBeOpened([businessHour, defaultBH]); for await (const bh of businessHourToOpen) { - bhLogger.debug({ - msg: 'onDepartmentDisabled: opening business hour', - businessHourId: bh._id, - }); await openBusinessHour(bh, false); } await Users.updateLivechatStatusBasedOnBusinessHours(); await businessHourManager.restartCronJobsIfNecessary(); - - bhLogger.debug({ - msg: 'onDepartmentDisabled: successfully processed department disabled event', - departmentId: department._id, - }); } async onDepartmentArchived(department: Pick): Promise { @@ -253,11 +232,6 @@ export class MultipleBusinessHoursBehavior extends AbstractBusinessHourBehavior } async onNewAgentCreated(agentId: string): Promise { - bhLogger.debug({ - msg: 'Executing onNewAgentCreated for agent', - agentId, - }); - await this.applyAnyOpenBusinessHourToAgent(agentId); await Users.updateLivechatStatusBasedOnBusinessHours([agentId]); @@ -293,11 +267,6 @@ export class MultipleBusinessHoursBehavior extends AbstractBusinessHourBehavior const isDefaultBHActive = openedBusinessHours.find(({ type }) => type === LivechatBusinessHourTypes.DEFAULT); if (isDefaultBHActive?._id) { await Users.openAgentBusinessHoursByBusinessHourIdsAndAgentId([isDefaultBHActive._id], agentId); - - bhLogger.debug({ - msg: 'Business hour status check passed for agent. Found default business hour to be active', - agentId, - }); return; } @@ -330,11 +299,6 @@ export class MultipleBusinessHoursBehavior extends AbstractBusinessHourBehavior const isDefaultBHActive = openedBusinessHours.find(({ type }) => type === LivechatBusinessHourTypes.DEFAULT); if (isDefaultBHActive?._id) { await Users.openAgentBusinessHoursByBusinessHourIdsAndAgentId([isDefaultBHActive._id], agentId); - - bhLogger.debug({ - msg: 'Business hour status check passed for agentId. Found default business hour to be active and agent has no departments with non-default business hours', - agentId, - }); return; } } diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterForwardChatToDepartment.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterForwardChatToDepartment.ts index 8babfec041c7..903fb8fd6928 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterForwardChatToDepartment.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterForwardChatToDepartment.ts @@ -13,7 +13,6 @@ callbacks.add( projection: { departmentAncestors: 1 }, }); if (!room) { - cbLogger.debug('Skipping callback. No room found'); return options; } await LivechatRooms.unsetPredictedVisitorAbandonmentByRoomId(room._id); @@ -22,14 +21,12 @@ callbacks.add( projection: { ancestors: 1 }, }); if (!department) { - cbLogger.debug('Skipping callback. No department found'); return options; } const { departmentAncestors } = room; const { ancestors } = department; if (!ancestors && !departmentAncestors) { - cbLogger.debug('Skipping callback. No ancestors found for department'); return options; } diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterInquiryQueued.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterInquiryQueued.ts index d8f5878f01bb..cb6993b38aec 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterInquiryQueued.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterInquiryQueued.ts @@ -9,12 +9,10 @@ let timer = 0; const scheduleInquiry = async (inquiry: any): Promise => { if (!inquiry?._id) { - cbLogger.debug('Skipping callback. No inquiry provided'); return; } if (!inquiry?._updatedAt || !inquiry?._createdAt) { - cbLogger.debug('Skipping callback. Inquiry doesnt have timestamps'); return; } diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterOnHold.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterOnHold.ts index 99e69acd8ffe..11a9593b0c37 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterOnHold.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterOnHold.ts @@ -11,12 +11,10 @@ let autoCloseOnHoldChatTimeout = 0; const handleAfterOnHold = async (room: Pick): Promise => { const { _id: rid } = room; if (!rid) { - cbLogger.debug('Skipping callback. No room provided'); return; } if (!autoCloseOnHoldChatTimeout || autoCloseOnHoldChatTimeout <= 0) { - cbLogger.debug('Skipping callback. Autoclose on hold disabled by setting'); return; } diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterOnHoldChatResumed.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterOnHoldChatResumed.ts index c631656a2a07..0263efa5fe39 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterOnHoldChatResumed.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterOnHoldChatResumed.ts @@ -8,7 +8,6 @@ type IRoom = Pick; const handleAfterOnHoldChatResumed = async (room: IRoom): Promise => { if (!room?._id) { - cbLogger.debug('Skipping callback. No room provided'); return room; } diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterRemoveDepartment.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterRemoveDepartment.ts index be732be66297..26e176b03eb5 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterRemoveDepartment.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterRemoveDepartment.ts @@ -5,7 +5,6 @@ import { callbacks } from '../../../../../lib/callbacks'; import { cbLogger } from '../lib/logger'; const afterRemoveDepartment = async (options: { department: ILivechatDepartmentRecord; agentsId: ILivechatAgent['_id'][] }) => { - cbLogger.debug(`Performing post-department-removal actions in EE: ${options?.department?._id}. Removing department from forward list`); if (!options?.department) { cbLogger.warn('No department found in options', options); return options; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterReturnRoomAsInquiry.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterReturnRoomAsInquiry.ts index 1035a2f03286..cecf6b5e7f4a 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterReturnRoomAsInquiry.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterReturnRoomAsInquiry.ts @@ -3,7 +3,6 @@ import { LivechatRooms } from '@rocket.chat/models'; import { settings } from '../../../../../app/settings/server'; import { callbacks } from '../../../../../lib/callbacks'; -import { cbLogger } from '../lib/logger'; settings.watch('Livechat_abandoned_rooms_action', (value) => { if (!value || value === 'none') { @@ -14,7 +13,6 @@ settings.watch('Livechat_abandoned_rooms_action', (value) => { 'livechat:afterReturnRoomAsInquiry', ({ room }: { room: IOmnichannelRoom }) => { if (!room?._id || !room?.omnichannel?.predictedVisitorAbandonmentAt) { - cbLogger.debug('Skipping callback. No room or no visitor abandonment info'); return; } diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterTakeInquiry.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterTakeInquiry.ts index ee83facae6d4..c5e55e030b65 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterTakeInquiry.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/afterTakeInquiry.ts @@ -7,12 +7,10 @@ callbacks.add( 'livechat.afterTakeInquiry', async (inquiry) => { if (!settings.get('Livechat_waiting_queue')) { - cbLogger.debug('Skipping callback. Waiting queue disabled by setting'); return inquiry; } if (!inquiry) { - cbLogger.debug('Skipping callback. No inquiry provided'); return null; } diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/applyDepartmentRestrictions.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/applyDepartmentRestrictions.ts index ef3261b83482..3c96cad39b72 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/applyDepartmentRestrictions.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/applyDepartmentRestrictions.ts @@ -21,7 +21,6 @@ callbacks.add( 'livechat.applyDepartmentRestrictions', async (originalQuery: FilterOperators = {}, { userId }: { userId?: string | null } = { userId: null }) => { if (!userId || !(await hasRoleAsync(userId, 'livechat-monitor'))) { - cbLogger.debug('Skipping callback. No user id provided or user is not a monitor'); return originalQuery; } diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/applyRoomRestrictions.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/applyRoomRestrictions.ts index bde3b6d9e31a..1a18b92dc94d 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/applyRoomRestrictions.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/applyRoomRestrictions.ts @@ -3,7 +3,6 @@ import { LivechatDepartment } from '@rocket.chat/models'; import type { FilterOperators } from 'mongodb'; import { callbacks } from '../../../../../lib/callbacks'; -import { cbLogger } from '../lib/logger'; import { getUnitsFromUser } from '../lib/units'; export const restrictQuery = async (originalQuery: FilterOperators = {}) => { @@ -27,7 +26,6 @@ export const restrictQuery = async (originalQuery: FilterOperators = {}) => { - cbLogger.debug('Applying room query restrictions'); return restrictQuery(originalQuery); }, callbacks.priority.HIGH, diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/applySimultaneousChatsRestrictions.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/applySimultaneousChatsRestrictions.ts index 4dd7a032e717..6d0c05fd39ed 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/applySimultaneousChatsRestrictions.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/applySimultaneousChatsRestrictions.ts @@ -3,7 +3,6 @@ import { LivechatDepartment } from '@rocket.chat/models'; import { settings } from '../../../../../app/settings/server'; import { callbacks } from '../../../../../lib/callbacks'; -import { cbLogger } from '../lib/logger'; callbacks.add( 'livechat.applySimultaneousChatRestrictions', @@ -16,7 +15,6 @@ callbacks.add( }) )?.maxNumberSimultaneousChat || 0; if (departmentLimit > 0) { - cbLogger.debug(`Applying department filters. Max chats per department ${departmentLimit}`); return { $match: { 'queueInfo.chats': { $gte: Number(departmentLimit) } } }; } } @@ -49,8 +47,6 @@ callbacks.add( : // dummy filter meaning: don't match anything { _id: '' }; - cbLogger.debug(`Applying agent & global filters. Max number of chats allowed to all agents by setting: ${maxChatsPerSetting}`); - return { $match: { $or: [agentFilter, globalFilter] } }; }, callbacks.priority.HIGH, diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/beforeForwardRoomToDepartment.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/beforeForwardRoomToDepartment.ts index 2503411d46c4..5a16b7014bd6 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/beforeForwardRoomToDepartment.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/beforeForwardRoomToDepartment.ts @@ -3,19 +3,16 @@ import { LivechatDepartment } from '@rocket.chat/models'; import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../../../lib/callbacks'; -import { cbLogger } from '../lib/logger'; callbacks.add( 'livechat.beforeForwardRoomToDepartment', async (options) => { const { room, transferData } = options; if (!room || !transferData) { - cbLogger.debug('Skipping callback. No room provided'); return options; } const { departmentId } = room; if (!departmentId) { - cbLogger.debug('Skipping callback. No department provided'); return options; } const { department: departmentToTransfer } = transferData; @@ -23,7 +20,6 @@ callbacks.add( projection: { departmentsAllowedToForward: 1 }, }); if (!currentDepartment) { - cbLogger.debug('Skipping callback. Current department does not exists'); return options; } const { departmentsAllowedToForward } = currentDepartment; @@ -31,7 +27,6 @@ callbacks.add( !departmentsAllowedToForward?.length || (Array.isArray(departmentsAllowedToForward) && departmentsAllowedToForward.includes(departmentToTransfer._id)); if (isAllowedToTransfer) { - cbLogger.debug(`Callback success. Room ${room._id} can be forwarded to department ${departmentToTransfer._id}`); return options; } throw new Meteor.Error('error-forwarding-department-target-not-allowed', 'The forwarding to the target department is not allowed.'); diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/beforeNewInquiry.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/beforeNewInquiry.ts index 21c38793734c..e6d68df1aa96 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/beforeNewInquiry.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/beforeNewInquiry.ts @@ -3,7 +3,6 @@ import { LivechatPriority, OmnichannelServiceLevelAgreements } from '@rocket.cha import { Meteor } from 'meteor/meteor'; import { callbacks } from '../../../../../lib/callbacks'; -import { cbLogger } from '../lib/logger'; type Props = { sla?: string; @@ -14,7 +13,6 @@ type Props = { const beforeNewInquiry = async (extraData: Props) => { const { sla: slaSearchTerm, priority: prioritySearchTerm, ...props } = extraData; if (!slaSearchTerm && !prioritySearchTerm) { - cbLogger.debug('Skipping callback. No sla or priority provided'); return extraData; } @@ -54,7 +52,6 @@ const beforeNewInquiry = async (extraData: Props) => { changes.priorityId = priority._id; changes.priorityWeight = priority.sortItem; } - cbLogger.debug('Callback success. Queue timing properties added to inquiry', changes); return { ...props, ...changes }; }; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/beforeRoutingChat.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/beforeRoutingChat.ts index 6d2071406260..69c3914cb4d8 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/beforeRoutingChat.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/beforeRoutingChat.ts @@ -16,7 +16,6 @@ callbacks.add( async (inquiry, agent) => { // check here if department has fallback before queueing if (inquiry?.department && !(await online(inquiry.department, true, true))) { - cbLogger.debug('No agents online on selected department. Inquiry will use fallback department'); const department = await LivechatDepartment.findOneById>( inquiry.department, { @@ -25,11 +24,10 @@ callbacks.add( ); if (!department) { - cbLogger.debug('No department found. Skipping'); return inquiry; } if (department.fallbackForwardDepartment) { - cbLogger.debug( + cbLogger.info( `Inquiry ${inquiry._id} will be moved from department ${department._id} to fallback department ${department.fallbackForwardDepartment}`, ); // update visitor @@ -41,31 +39,24 @@ callbacks.add( inquiry = (await LivechatInquiry.setDepartmentByInquiryId(inquiry._id, department.fallbackForwardDepartment)) ?? inquiry; // update room await LivechatRooms.setDepartmentByRoomId(inquiry.rid, department.fallbackForwardDepartment); - cbLogger.debug(`Inquiry ${inquiry._id} moved. Continue normal queue process`); - } else { - cbLogger.debug('No fallback department configured. Skipping'); } } if (!settings.get('Livechat_waiting_queue')) { - cbLogger.debug('Skipping callback. Waiting queue disabled by setting'); return inquiry; } if (!inquiry) { - cbLogger.debug('Skipping callback. No inquiry provided'); return inquiry; } const { _id, status, department } = inquiry; if (status !== 'ready') { - cbLogger.debug(`Skipping callback. Inquiry ${_id} is not ready`); return inquiry; } if (agent && (await allowAgentSkipQueue(agent))) { - cbLogger.debug(`Skipping callback. Agent ${agent.agentId} can skip queue`); return inquiry; } @@ -79,7 +70,6 @@ callbacks.add( }); if (inq) { await dispatchInquiryPosition(inq); - cbLogger.debug(`Callback success. Inquiry ${_id} position has been notified`); } } diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/checkAgentBeforeTakeInquiry.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/checkAgentBeforeTakeInquiry.ts index 7f566260cf04..55adb05cbd1c 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/checkAgentBeforeTakeInquiry.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/checkAgentBeforeTakeInquiry.ts @@ -27,23 +27,20 @@ const validateMaxChats = async ({ }; }) => { if (!inquiry?._id || !agent?.agentId) { - cbLogger.debug('Callback with error. No inquiry or agent provided'); throw new Error('No inquiry or agent provided'); } const { agentId } = agent; if (!(await Livechat.checkOnlineAgents(undefined, agent))) { - cbLogger.debug('Callback with error. provided agent is not online'); throw new Error('Provided agent is not online'); } if (!settings.get('Livechat_waiting_queue')) { - cbLogger.debug('Skipping callback. Disabled by setting'); return agent; } if (await allowAgentSkipQueue(agent)) { - cbLogger.debug(`Callback success. Agent ${agent.agentId} can skip queue`); + cbLogger.info(`Chat can be taken by Agent ${agentId}: agent can skip queue`); return agent; } @@ -55,25 +52,23 @@ const validateMaxChats = async ({ }); if (maxNumberSimultaneousChat === 0) { - cbLogger.debug(`Callback success. Agent ${agentId} max number simultaneous chats on range`); + cbLogger.debug(`Chat can be taken by Agent ${agentId}: max number simultaneous chats on range`); return agent; } const user = await Users.getAgentAndAmountOngoingChats(agentId); if (!user) { - cbLogger.debug('Callback with error. No valid agent found'); throw new Error('No valid agent found'); } const { queueInfo: { chats = 0 } = {} } = user; const maxChats = typeof maxNumberSimultaneousChat === 'number' ? maxNumberSimultaneousChat : parseInt(maxNumberSimultaneousChat, 10); if (maxChats <= chats) { - cbLogger.debug('Callback with error. Agent reached max amount of simultaneous chats'); await callbacks.run('livechat.onMaxNumberSimultaneousChatsReached', inquiry); throw new Error('error-max-number-simultaneous-chats-reached'); } - cbLogger.debug(`Callback success. Agent ${agentId} can take inquiry ${inquiry._id}`); + cbLogger.debug(`Agent ${agentId} can take inquiry ${inquiry._id}`); return agent; }; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/onAgentAssignmentFailed.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/onAgentAssignmentFailed.ts index f11d3b9514d6..d27f317d3b18 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/onAgentAssignmentFailed.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/onAgentAssignmentFailed.ts @@ -2,7 +2,6 @@ import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; import { settings } from '../../../../../app/settings/server'; import { callbacks } from '../../../../../lib/callbacks'; -import { cbLogger } from '../lib/logger'; const handleOnAgentAssignmentFailed = async ( room: IOmnichannelRoom, @@ -18,25 +17,21 @@ const handleOnAgentAssignmentFailed = async ( }, ) => { if (!inquiry || !room) { - cbLogger.debug('Skipping callback. No inquiry or room provided'); return; } if (!settings.get('Livechat_waiting_queue')) { - cbLogger.debug('Skipping callback. Queue disabled by setting'); return; } const { forwardingToDepartment: { oldDepartmentId } = {}, forwardingToDepartment } = options; if (!forwardingToDepartment) { - cbLogger.debug('Skipping callback. Room not being forwarded to department'); return; } const { department: newDepartmentId } = inquiry; if (!newDepartmentId || !oldDepartmentId || newDepartmentId === oldDepartmentId) { - cbLogger.debug('Skipping callback. New and old departments are the same'); return; } diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/onCloseLivechat.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/onCloseLivechat.ts index e68148ee825d..4e76f396617b 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/onCloseLivechat.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/onCloseLivechat.ts @@ -1,7 +1,6 @@ import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; import { LivechatRooms, Subscriptions } from '@rocket.chat/models'; -import { callbackLogger } from '../../../../../app/livechat/server/lib/logger'; import { settings } from '../../../../../app/settings/server'; import { callbacks } from '../../../../../lib/callbacks'; import { AutoCloseOnHoldScheduler } from '../lib/AutoCloseOnHoldScheduler'; @@ -17,22 +16,17 @@ const onCloseLivechat = async (params: LivechatCloseCallbackParams) => { room: { _id: roomId }, } = params; - callbackLogger.debug(`[onCloseLivechat] clearing onHold related data for room ${roomId}`); - await Promise.all([ LivechatRooms.unsetOnHoldByRoomId(roomId), Subscriptions.unsetOnHoldByRoomId(roomId), AutoCloseOnHoldScheduler.unscheduleRoom(roomId), ]); - callbackLogger.debug(`[onCloseLivechat] clearing onHold related data for room ${roomId} completed`); - if (!settings.get('Livechat_waiting_queue')) { return params; } const { departmentId } = room || {}; - callbackLogger.debug(`[onCloseLivechat] dispatching waiting queue status for department ${departmentId}`); debouncedDispatchWaitingQueueStatus(departmentId); return params; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/onLoadForwardDepartmentRestrictions.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/onLoadForwardDepartmentRestrictions.ts index 2d4dc52f9a32..ef252c820ee4 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/onLoadForwardDepartmentRestrictions.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/onLoadForwardDepartmentRestrictions.ts @@ -1,26 +1,22 @@ import { LivechatDepartment } from '@rocket.chat/models'; import { callbacks } from '../../../../../lib/callbacks'; -import { cbLogger } from '../lib/logger'; callbacks.add( 'livechat.onLoadForwardDepartmentRestrictions', async (options) => { const { departmentId } = options; if (!departmentId) { - cbLogger.debug('Skipping callback. No departmentId provided'); return options; } const department = await LivechatDepartment.findOneById(departmentId, { projection: { departmentsAllowedToForward: 1 }, }); if (!department) { - cbLogger.debug('Skipping callback. Invalid department provided'); return options; } - const { departmentsAllowedToForward, _id } = department; + const { departmentsAllowedToForward } = department; if (!departmentsAllowedToForward) { - cbLogger.debug(`Skipping callback. Department ${_id} doesnt allow forwarding to other departments`); return options; } return Object.assign({ restrictions: { _id: { $in: departmentsAllowedToForward } } }, options); diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/onSaveVisitorInfo.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/onSaveVisitorInfo.ts index 2e1b879458f8..9b3f79f6ce3f 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/onSaveVisitorInfo.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/onSaveVisitorInfo.ts @@ -4,7 +4,6 @@ import { OmnichannelServiceLevelAgreements } from '@rocket.chat/models'; import { callbacks } from '../../../../../lib/callbacks'; import { removePriorityFromRoom, updateRoomPriority } from '../api/lib/priorities'; import { removeRoomSLA, updateRoomSLA } from '../api/lib/sla'; -import { cbLogger } from '../lib/logger'; const updateSLA = async (room: IOmnichannelRoom, user: Required>, slaId?: string) => { if (!slaId) { @@ -37,19 +36,13 @@ callbacks.add( const { slaId: newSlaId, priorityId: newPriorityId } = room; if (oldSlaId === newSlaId && oldPriorityId === newPriorityId) { - cbLogger.debug('No changes in SLA or Priority'); return room; } if (oldSlaId === newSlaId && oldPriorityId !== newPriorityId) { - cbLogger.debug(`Updating Priority for room ${room._id}, from ${oldPriorityId} to ${newPriorityId}`); await updatePriority(room, user, newPriorityId); } else if (oldSlaId !== newSlaId && oldPriorityId === newPriorityId) { - cbLogger.debug(`Updating SLA for room ${room._id}, from ${oldSlaId} to ${newSlaId}`); await updateSLA(room, user, newSlaId); } else { - cbLogger.debug( - `Updating SLA and Priority for room ${room._id}, from ${oldSlaId} to ${newSlaId} and from ${oldPriorityId} to ${newPriorityId}`, - ); await Promise.all([updateSLA(room, user, newSlaId), updatePriority(room, user, newPriorityId)]); } diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/onTransferFailure.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/onTransferFailure.ts index bd33cfe12bbd..a667d4524926 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/onTransferFailure.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/onTransferFailure.ts @@ -21,10 +21,8 @@ const onTransferFailure = async ( return false; } - cbLogger.debug(`Attempting to transfer room ${room._id} using fallback departments`); const { departmentId } = transferData; if (!departmentId) { - cbLogger.debug(`No departmentId found in transferData`); return false; } @@ -39,14 +37,12 @@ const onTransferFailure = async ( return false; } - cbLogger.debug(`Fallback department ${department.fallbackForwardDepartment} found for department ${department._id}. Redirecting`); // TODO: find enabled not archived here const fallbackDepartment = await LivechatDepartment.findOneById(department.fallbackForwardDepartment, { projection: { name: 1, _id: 1 }, }); if (!fallbackDepartment) { - cbLogger.debug(`Fallback department ${department.fallbackForwardDepartment} not found`); return false; } @@ -80,6 +76,7 @@ const onTransferFailure = async ( ); } + cbLogger.info(`Fallback department ${department.fallbackForwardDepartment} found for department ${department._id}. Chat transfered`); return forwardSuccess; }; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/scheduleAutoTransfer.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/scheduleAutoTransfer.ts index 4a16316cb93e..4039754a609c 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/scheduleAutoTransfer.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/scheduleAutoTransfer.ts @@ -18,27 +18,23 @@ let autoTransferTimeout = 0; const handleAfterTakeInquiryCallback = async (inquiry: any = {}): Promise => { const { rid } = inquiry; if (!rid?.trim()) { - cbLogger.debug('Skipping callback. Invalid room id'); return; } if (!autoTransferTimeout || autoTransferTimeout <= 0) { - cbLogger.debug('Skipping callback. No auto transfer timeout or invalid value from setting'); return inquiry; } const room = await LivechatRooms.findOneById(rid, { projection: { _id: 1, autoTransferredAt: 1, autoTransferOngoing: 1 } }); if (!room) { - cbLogger.debug(`Skipping callback. Room ${rid} not found`); return inquiry; } if (room.autoTransferredAt || room.autoTransferOngoing) { - cbLogger.debug(`Skipping callback. Room ${room._id} already being transfered or not found`); return inquiry; } - cbLogger.debug(`Callback success. Room ${room._id} will be scheduled to be auto transfered after ${autoTransferTimeout} seconds`); + cbLogger.info(`Room ${room._id} will be scheduled to be auto transfered after ${autoTransferTimeout} seconds`); await AutoTransferChatScheduler.scheduleRoom(rid, autoTransferTimeout as number); return inquiry; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/lib/AutoCloseOnHoldScheduler.ts b/apps/meteor/ee/app/livechat-enterprise/server/lib/AutoCloseOnHoldScheduler.ts index 0efda85e25a4..c59c27282501 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/lib/AutoCloseOnHoldScheduler.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/lib/AutoCloseOnHoldScheduler.ts @@ -26,7 +26,6 @@ class AutoCloseOnHoldSchedulerClass { public async init(): Promise { if (this.running) { - this.logger.debug('Already running'); return; } @@ -38,7 +37,7 @@ class AutoCloseOnHoldSchedulerClass { await this.scheduler.start(); this.running = true; - this.logger.debug('Started'); + this.logger.info('Service started'); } public async scheduleRoom(roomId: string, timeout: number, comment: string): Promise { @@ -75,7 +74,6 @@ class AutoCloseOnHoldSchedulerClass { comment, }; - this.logger.debug(`Closing room ${roomId}`); await Livechat.closeRoom(payload); } diff --git a/apps/meteor/ee/app/livechat-enterprise/server/lib/AutoTransferChatScheduler.ts b/apps/meteor/ee/app/livechat-enterprise/server/lib/AutoTransferChatScheduler.ts index 7e52cc266c04..9d4590836ac9 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/lib/AutoTransferChatScheduler.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/lib/AutoTransferChatScheduler.ts @@ -28,7 +28,6 @@ class AutoTransferChatSchedulerClass { public async init(): Promise { if (this.running) { - this.logger.debug('Already running'); return; } @@ -40,7 +39,7 @@ class AutoTransferChatSchedulerClass { await this.scheduler.start(); this.running = true; - this.logger.debug('Started'); + this.logger.info('Service started'); } private async getSchedulerUser(): Promise { @@ -58,7 +57,6 @@ class AutoTransferChatSchedulerClass { this.scheduler.define(jobName, this.executeJob.bind(this)); await this.scheduler.schedule(when, jobName, { roomId }); await LivechatRooms.setAutoTransferOngoingById(roomId); - this.logger.debug(`Scheduled room ${roomId} to be transferred in ${timeout} seconds`); } public async unscheduleRoom(roomId: string): Promise { diff --git a/apps/meteor/ee/app/livechat-enterprise/server/lib/Helper.ts b/apps/meteor/ee/app/livechat-enterprise/server/lib/Helper.ts index af517312348d..08ea48910f02 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/lib/Helper.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/lib/Helper.ts @@ -17,7 +17,7 @@ import { callbacks } from '../../../../../lib/callbacks'; import { OmnichannelQueueInactivityMonitor } from './QueueInactivityMonitor'; import { updateInquiryQueueSla } from './SlaHelper'; import { memoizeDebounce } from './debounceByParams'; -import { logger, helperLogger } from './logger'; +import { logger } from './logger'; type QueueInfo = { message: { @@ -124,7 +124,6 @@ const dispatchWaitingQueueStatus = async (department?: string) => { return; } - helperLogger.debug(`Updating statuses for queue ${department || 'Public'}`); const queue = await LivechatInquiry.getCurrentSortedQueueAsync({ department, queueSortBy: getInquirySortMechanismSetting(), @@ -186,12 +185,10 @@ export const updatePredictedVisitorAbandonment = async () => { export const updateQueueInactivityTimeout = async () => { const queueTimeout = settings.get('Livechat_max_queue_wait_time'); if (queueTimeout <= 0) { - logger.debug('QueueInactivityTimer: Disabling scheduled closing'); await OmnichannelQueueInactivityMonitor.stop(); return; } - logger.debug('QueueInactivityTimer: Updating estimated inactivity time for queued items'); await LivechatInquiry.getQueuedInquiries({ projection: { _updatedAt: 1 } }).forEach((inq) => { const aggregatedDate = moment(inq._updatedAt).add(queueTimeout, 'minutes'); try { diff --git a/apps/meteor/ee/app/livechat-enterprise/server/lib/QueueInactivityMonitor.ts b/apps/meteor/ee/app/livechat-enterprise/server/lib/QueueInactivityMonitor.ts index d7ad14251d3f..df975a3690be 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/lib/QueueInactivityMonitor.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/lib/QueueInactivityMonitor.ts @@ -69,6 +69,7 @@ class OmnichannelQueueInactivityMonitorClass { } await this.scheduler.start(); + this.logger.info('Service started'); this.running = true; } @@ -108,21 +109,18 @@ class OmnichannelQueueInactivityMonitorClass { async closeRoom({ attrs: { data } }: any = {}): Promise { const { inquiryId } = data; const inquiry = await LivechatInquiryRaw.findOneById(inquiryId); - this.logger.debug(`Processing inquiry item ${inquiryId}`); if (!inquiry || inquiry.status !== 'queued') { - this.logger.debug(`Skipping inquiry ${inquiryId}. Invalid or not queued anymore`); return; } const room = await LivechatRooms.findOneById(inquiry.rid); if (!room) { - this.logger.error(`Error: unable to find room ${inquiry.rid} for inquiry ${inquiryId} to close in queue inactivity monitor`); + this.logger.error(`Unable to find room ${inquiry.rid} for inquiry ${inquiryId} to close in queue inactivity monitor`); return; } await Promise.all([this.closeRoomAction(room), this.stopInquiry(inquiryId)]); - - this.logger.debug(`Running successful. Closed inquiry ${inquiry._id} because of inactivity`); + this.logger.info(`Closed room ${inquiry.rid} for inquiry ${inquiryId} due to inactivity`); } } diff --git a/apps/meteor/ee/app/livechat-enterprise/server/lib/VisitorInactivityMonitor.ts b/apps/meteor/ee/app/livechat-enterprise/server/lib/VisitorInactivityMonitor.ts index 8947ecf62081..824296d1e673 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/lib/VisitorInactivityMonitor.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/lib/VisitorInactivityMonitor.ts @@ -33,7 +33,6 @@ export class VisitorInactivityMonitor { } async start() { - this.logger.debug('Starting'); await this._startMonitoring(); this._initializeMessageCache(); const cat = await Users.findOneById('rocket.cat'); @@ -50,18 +49,17 @@ export class VisitorInactivityMonitor { const everyMinute = '* * * * *'; await this.scheduler.add(this._name, everyMinute, async () => this.handleAbandonedRooms()); this._started = true; - this.logger.debug('Started'); + this.logger.info('Service started'); } async stop() { if (!this.isRunning()) { - this.logger.debug('Not running'); return; } await this.scheduler.remove(this._name); this._started = false; - this.logger.debug('Stopped'); + this.logger.info('Service stopped'); } isRunning() { @@ -73,9 +71,7 @@ export class VisitorInactivityMonitor { } async _getDepartmentAbandonedCustomMessage(departmentId: string) { - this.logger.debug(`Getting department abandoned custom message for department ${departmentId}`); if (this.messageCache.has(departmentId)) { - this.logger.debug(`Using cached department abandoned custom message for department ${departmentId}`); return this.messageCache.get(departmentId); } const department = await LivechatDepartment.findOneById>( @@ -83,16 +79,14 @@ export class VisitorInactivityMonitor { { projection: { _id: 1, abandonedRoomsCloseCustomMessage: 1 } }, ); if (!department) { - this.logger.debug(`Department ${departmentId} not found`); + this.logger.error(`Department ${departmentId} not found`); return; } - this.logger.debug(`Setting department abandoned custom message for department ${departmentId}`); this.messageCache.set(department._id, department.abandonedRoomsCloseCustomMessage); return department.abandonedRoomsCloseCustomMessage; } async closeRooms(room: IOmnichannelRoom) { - this.logger.debug(`Closing room ${room._id}`); let comment = await this.getDefaultAbandonedCustomMessage('close', room.v._id); if (room.departmentId) { comment = (await this._getDepartmentAbandonedCustomMessage(room.departmentId)) || comment; @@ -102,29 +96,24 @@ export class VisitorInactivityMonitor { room, user: this.user, }); - this.logger.debug(`Room ${room._id} closed`); + this.logger.info(`Room ${room._id} closed`); } async placeRoomOnHold(room: IOmnichannelRoom) { - this.logger.debug(`Placing room ${room._id} on hold`); - const comment = await this.getDefaultAbandonedCustomMessage('on-hold', room.v._id); const result = await Promise.allSettled([ OmnichannelEEService.placeRoomOnHold(room, comment, this.user), LivechatRooms.unsetPredictedVisitorAbandonmentByRoomId(room._id), ]); - this.logger.debug(`Room ${room._id} placed on hold`); const rejected = result.filter(isPromiseRejectedResult).map((r) => r.reason); if (rejected.length) { this.logger.error({ msg: 'Error placing room on hold', error: rejected }); - throw new Error('Error placing room on hold. Please check logs for more details.'); } } async handleAbandonedRooms() { - this.logger.debug('Handling abandoned rooms'); const action = settings.get('Livechat_abandoned_rooms_action'); if (!action || action === 'none') { return; @@ -135,12 +124,12 @@ export class VisitorInactivityMonitor { await LivechatRooms.findAbandonedOpenRooms(new Date(), extraQuery).forEach((room) => { switch (action) { case 'close': { - this.logger.debug(`Closing room ${room._id}`); + this.logger.info(`Closing room ${room._id}`); promises.push(this.closeRooms(room)); break; } case 'on-hold': { - this.logger.debug(`Placing room ${room._id} on hold`); + this.logger.info(`Placing room ${room._id} on hold`); promises.push(this.placeRoomOnHold(room)); break; } @@ -153,7 +142,6 @@ export class VisitorInactivityMonitor { if (errors.length) { this.logger.error({ msg: `Error while removing priority from ${errors.length} rooms`, reason: errors[0] }); - this.logger.debug({ msg: 'Rejection results', errors }); } this._initializeMessageCache(); diff --git a/apps/meteor/ee/app/livechat-enterprise/server/services/omnichannel.internalService.ts b/apps/meteor/ee/app/livechat-enterprise/server/services/omnichannel.internalService.ts index e9911ffe246c..3ef9633267c8 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/services/omnichannel.internalService.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/services/omnichannel.internalService.ts @@ -54,8 +54,6 @@ export class OmnichannelEE extends ServiceClassInternal implements IOmnichannelE ]); await callbacks.run('livechat:afterOnHold', room); - - this.logger.debug(`Room ${room._id} set on hold successfully`); } async resumeRoomOnHold( @@ -105,8 +103,6 @@ export class OmnichannelEE extends ServiceClassInternal implements IOmnichannelE ]); await callbacks.run('livechat:afterOnHoldChatResumed', room); - - this.logger.debug(`Room ${room._id} resumed successfully`); } private async attemptToAssignRoomToServingAgentElseQueueIt({ @@ -134,7 +130,7 @@ export class OmnichannelEE extends ServiceClassInternal implements IOmnichannelE return; } catch (e) { - this.logger.debug(`Agent ${servingAgent._id} is not available to take the inquiry ${inquiry._id}`, e); + this.logger.error(`Agent ${servingAgent._id} is not available to take the inquiry ${inquiry._id}`, e); if (clientAction) { // if the action was triggered by the client, we should throw the error // so the client can handle it and show the error message to the user @@ -142,20 +138,15 @@ export class OmnichannelEE extends ServiceClassInternal implements IOmnichannelE } } - this.logger.debug(`Attempting to queue inquiry ${inquiry._id}`); - await this.removeCurrentAgentFromRoom({ room, inquiry }); const { _id: inquiryId } = inquiry; const newInquiry = await LivechatInquiry.findOneById(inquiryId); if (!newInquiry) { - this.logger.error(`No inquiry found for id ${inquiryId}`); throw new Error('error-invalid-inquiry'); } await queueInquiry(newInquiry); - - this.logger.debug('Room queued successfully'); } private async removeCurrentAgentFromRoom({ @@ -178,7 +169,5 @@ export class OmnichannelEE extends ServiceClassInternal implements IOmnichannelE ]); await dispatchAgentDelegated(roomId); - - this.logger.debug(`Current agent removed from room ${room._id} successfully`); } } diff --git a/apps/meteor/ee/server/models/raw/LivechatRooms.ts b/apps/meteor/ee/server/models/raw/LivechatRooms.ts index 5c3bbb1296e0..b39e3d9eacfa 100644 --- a/apps/meteor/ee/server/models/raw/LivechatRooms.ts +++ b/apps/meteor/ee/server/models/raw/LivechatRooms.ts @@ -11,7 +11,6 @@ import type { FindCursor, UpdateResult, Document, FindOptions, Db, Collection, F import { readSecondaryPreferred } from '../../../../server/database/readSecondaryPreferred'; import { LivechatRoomsRaw } from '../../../../server/models/raw/LivechatRooms'; -import { queriesLogger } from '../../../app/livechat-enterprise/server/lib/logger'; import { addQueryRestrictionsToRoomsModel } from '../../../app/livechat-enterprise/server/lib/query.helper'; declare module '@rocket.chat/model-typings' { @@ -271,25 +270,14 @@ export class LivechatRoomsRawEE extends LivechatRoomsRaw implements ILivechatRoo ], }; const update = { $set: { departmentAncestors: [unitId] } }; - queriesLogger.debug({ msg: `LivechatRoomsRawEE.associateRoomsWithDepartmentToUnit - association step`, query, update }); - const associationResult = await this.updateMany(query, update); - queriesLogger.debug({ msg: `LivechatRoomsRawEE.associateRoomsWithDepartmentToUnit - association step`, result: associationResult }); + await this.updateMany(query, update); const queryToDisassociateOldRoomsConnectedToUnit = { departmentAncestors: unitId, departmentId: { $nin: departments }, }; const updateToDisassociateRooms = { $unset: { departmentAncestors: 1 } }; - queriesLogger.debug({ - msg: `LivechatRoomsRawEE.associateRoomsWithDepartmentToUnit - disassociation step`, - query: queryToDisassociateOldRoomsConnectedToUnit, - update: updateToDisassociateRooms, - }); - const disassociationResult = await this.updateMany(queryToDisassociateOldRoomsConnectedToUnit, updateToDisassociateRooms); - queriesLogger.debug({ - msg: `LivechatRoomsRawEE.associateRoomsWithDepartmentToUnit - disassociation step`, - result: disassociationResult, - }); + await this.updateMany(queryToDisassociateOldRoomsConnectedToUnit, updateToDisassociateRooms); } async removeUnitAssociationFromRooms(unitId: string): Promise { @@ -297,9 +285,7 @@ export class LivechatRoomsRawEE extends LivechatRoomsRaw implements ILivechatRoo departmentAncestors: unitId, }; const update = { $unset: { departmentAncestors: 1 } }; - queriesLogger.debug({ msg: `LivechatRoomsRawEE.removeUnitAssociationFromRooms`, query, update }); - const result = await this.updateMany(query, update); - queriesLogger.debug({ msg: `LivechatRoomsRawEE.removeUnitAssociationFromRooms`, result }); + await this.updateMany(query, update); } async updateDepartmentAncestorsById(rid: string, departmentAncestors?: string[]) { @@ -314,7 +300,6 @@ export class LivechatRoomsRawEE extends LivechatRoomsRaw implements ILivechatRoo async update(...args: Parameters) { const [query, ...restArgs] = args; const restrictedQuery = await addQueryRestrictionsToRoomsModel(query); - queriesLogger.debug({ msg: 'LivechatRoomsRawEE.update', query: restrictedQuery }); return super.update(restrictedQuery, ...restArgs); } @@ -328,14 +313,12 @@ export class LivechatRoomsRawEE extends LivechatRoomsRaw implements ILivechatRoo return super.updateOne(query, update, opts); } const restrictedQuery = await addQueryRestrictionsToRoomsModel(query); - queriesLogger.debug({ msg: 'LivechatRoomsRawEE.updateOne', query: restrictedQuery }); return super.updateOne(restrictedQuery, update, opts); } async updateMany(...args: Parameters) { const [query, ...restArgs] = args; const restrictedQuery = await addQueryRestrictionsToRoomsModel(query); - queriesLogger.debug({ msg: 'LivechatRoomsRawEE.updateMany', query: restrictedQuery }); return super.updateMany(restrictedQuery, ...restArgs); } diff --git a/apps/meteor/ee/server/models/raw/LivechatUnit.ts b/apps/meteor/ee/server/models/raw/LivechatUnit.ts index b49cbb959df1..180b145e4352 100644 --- a/apps/meteor/ee/server/models/raw/LivechatUnit.ts +++ b/apps/meteor/ee/server/models/raw/LivechatUnit.ts @@ -4,7 +4,6 @@ import { LivechatUnitMonitors, LivechatDepartment, LivechatRooms } from '@rocket import type { FindOptions, Filter, FindCursor, Db, FilterOperators, UpdateResult, DeleteResult, Document, UpdateFilter } from 'mongodb'; import { BaseRaw } from '../../../../server/models/raw/BaseRaw'; -import { queriesLogger } from '../../../app/livechat-enterprise/server/lib/logger'; import { getUnitsFromUser } from '../../../app/livechat-enterprise/server/lib/units'; const addQueryRestrictions = async (originalQuery: Filter = {}) => { @@ -40,7 +39,6 @@ export class LivechatUnitRaw extends BaseRaw implement options: FindOptions, ): Promise> { const query = await addQueryRestrictions(originalQuery); - queriesLogger.debug({ msg: 'LivechatUnit.find', query }); return this.col.find(query, options) as FindCursor; } @@ -50,7 +48,6 @@ export class LivechatUnitRaw extends BaseRaw implement options: FindOptions, ): Promise { const query = await addQueryRestrictions(originalQuery); - queriesLogger.debug({ msg: 'LivechatUnit.findOne', query }); return this.col.findOne(query, options); } @@ -60,7 +57,6 @@ export class LivechatUnitRaw extends BaseRaw implement options: FindOptions, ): Promise { const query = await addQueryRestrictions(originalQuery); - queriesLogger.debug({ msg: 'LivechatUnit.update', query }); return this.col.updateOne(query, update, options); } diff --git a/apps/meteor/server/features/EmailInbox/EmailInbox_Incoming.ts b/apps/meteor/server/features/EmailInbox/EmailInbox_Incoming.ts index 44302ae9ff91..d71190cb0b6d 100644 --- a/apps/meteor/server/features/EmailInbox/EmailInbox_Incoming.ts +++ b/apps/meteor/server/features/EmailInbox/EmailInbox_Incoming.ts @@ -25,18 +25,10 @@ const language = settings.get('Language') || 'en'; const t = (s: string): string => i18n.t(s, { lng: language }); async function getGuestByEmail(email: string, name: string, department = ''): Promise { - logger.debug(`Attempt to register a guest for ${email} on department: ${department}`); const guest = await LivechatVisitors.findOneGuestByEmailAddress(email); if (guest) { - logger.debug(`Guest with email ${email} found with id ${guest._id}`); if (guest.department !== department) { - logger.debug({ - msg: 'Switching departments for guest', - guest, - previousDepartment: guest.department, - newDepartment: department, - }); if (!department) { await LivechatVisitors.removeDepartmentById(guest._id); delete guest.department; @@ -48,10 +40,6 @@ async function getGuestByEmail(email: string, name: string, department = ''): Pr return guest; } - logger.debug({ - msg: 'Creating a new Omnichannel guest for visitor with email', - email, - }); const userId = await LivechatTyped.registerGuest({ token: Random.id(), name: name || email, @@ -60,7 +48,6 @@ async function getGuestByEmail(email: string, name: string, department = ''): Pr }); const newGuest = await LivechatVisitors.findOneById(userId); - logger.debug(`Guest ${userId} for visitor ${email} created`); if (newGuest) { return newGuest; } @@ -111,7 +98,7 @@ async function uploadAttachment(attachmentParam: Attachment, rid: string, visito } export async function onEmailReceived(email: ParsedMail, inbox: string, department = ''): Promise { - logger.debug(`New email conversation received on inbox ${inbox}. Will be assigned to department ${department}`); + logger.info(`New email conversation received on inbox ${inbox}. Will be assigned to department ${department}`); if (!email.from?.value?.[0]?.address) { return; } @@ -119,19 +106,13 @@ export async function onEmailReceived(email: ParsedMail, inbox: string, departme const references = typeof email.references === 'string' ? [email.references] : email.references; const initialRef = [email.messageId, email.inReplyTo].filter(Boolean) as string[]; const thread = (references?.length ? references : []).flatMap((t: string) => t.split(',')).concat(initialRef); - - logger.debug(`Received new email conversation with thread ${thread} on inbox ${inbox} from ${email.from.value[0].address}`); - - logger.debug(`Fetching guest for visitor ${email.from.value[0].address}`); const guest = await getGuestByEmail(email.from.value[0].address, email.from.value[0].name, department); if (!guest) { - logger.debug(`No visitor found for ${email.from.value[0].address}`); + logger.error(`No visitor found for ${email.from.value[0].address}`); return; } - logger.debug(`Guest ${guest._id} obtained. Attempting to find or create a room on department ${department}`); - let room: IOmnichannelRoom | null = await LivechatRooms.findOneByVisitorTokenAndEmailThreadAndDepartment( guest.token, thread, @@ -146,7 +127,6 @@ export async function onEmailReceived(email: ParsedMail, inbox: string, departme }); if (room?.closedAt) { - logger.debug(`Room ${room?._id} is closed. Reopening`); room = await QueueManager.unarchiveRoom(room); } @@ -166,8 +146,6 @@ export async function onEmailReceived(email: ParsedMail, inbox: string, departme const rid = room?._id ?? Random.id(); const msgId = Random.id(); - logger.debug(`Sending email message to room ${rid} for visitor ${guest._id}. Conversation assigned to department ${department}`); - Livechat.sendMessage({ guest, message: { @@ -242,7 +220,7 @@ export async function onEmailReceived(email: ParsedMail, inbox: string, departme try { attachments.push(await uploadAttachment(attachment, rid, guest.token)); } catch (err) { - Livechat.logger.error({ msg: 'Error uploading attachment from email', err }); + logger.error({ msg: 'Error uploading attachment from email', err }); } } @@ -259,7 +237,7 @@ export async function onEmailReceived(email: ParsedMail, inbox: string, departme room && (await LivechatRooms.updateEmailThreadByRoomId(room._id, thread)); }) .catch((err) => { - Livechat.logger.error({ + logger.error({ msg: 'Error receiving email', err, }); diff --git a/apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts b/apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts index dccf8315acd3..61ca75aa65d4 100644 --- a/apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts +++ b/apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts @@ -75,7 +75,7 @@ async function sendEmail(inbox: Inbox, mail: Mail.Options, options?: any): Promi ...mail, }) .then((info) => { - logger.info('Message sent: %s', info.messageId); + logger.info({ msg: 'Message sent', info }); return info; }) .catch(async (err) => { @@ -92,7 +92,6 @@ async function sendEmail(inbox: Inbox, mail: Mail.Options, options?: any): Promi slashCommands.add({ command: 'sendEmailAttachment', callback: async ({ command, params }: SlashCommandCallbackParams<'sendEmailAttachment'>) => { - logger.debug('sendEmailAttachment command: ', command, params); if (command !== 'sendEmailAttachment' || !Match.test(params, String)) { return; } @@ -318,7 +317,6 @@ export async function sendTestEmailToInbox(emailInboxRecord: IEmailInbox, user: throw new Error('user-without-verified-email'); } - logger.info(`Sending testing email to ${address}`); void sendEmail(inbox, { to: address, subject: 'Test of inbox configuration', diff --git a/apps/meteor/server/services/omnichannel-voip/service.ts b/apps/meteor/server/services/omnichannel-voip/service.ts index 532bb5d245e9..3e492a4d6514 100644 --- a/apps/meteor/server/services/omnichannel-voip/service.ts +++ b/apps/meteor/server/services/omnichannel-voip/service.ts @@ -32,10 +32,8 @@ export class OmnichannelVoipService extends ServiceClassInternal implements IOmn // handle agent disconnections this.onEvent('watch.pbxevents', async ({ data }) => { - this.logger.debug(`Get event watch.pbxevents on service`); const extension = data.agentExtension; if (!extension) { - this.logger.debug(`No agent extension associated with the event. Skipping`); return; } switch (data.event) { @@ -53,12 +51,12 @@ export class OmnichannelVoipService extends ServiceClassInternal implements IOmn this.logger.info(`Processing hangup event for call with agent on extension ${extension}`); const agent = await Users.findOneByExtension(extension); if (!agent) { - this.logger.debug(`No agent found with extension ${extension}. Event won't proceed`); + this.logger.error(`No agent found with extension ${extension}. Event won't proceed`); return; } const currentRoom = await VoipRoom.findOneByAgentId(agent._id); if (!currentRoom) { - this.logger.debug(`No active call found for agent ${agent._id}`); + this.logger.error(`No active call found for agent ${agent._id}`); return; } this.logger.debug(`Notifying agent ${agent._id} of hangup on room ${currentRoom._id}`); @@ -69,7 +67,7 @@ export class OmnichannelVoipService extends ServiceClassInternal implements IOmn this.logger.info(`Processing disconnection event for agent with extension ${extension}`); const agent = await Users.findOneByExtension(extension); if (!agent) { - this.logger.debug(`No agent found with extension ${extension}. Event won't proceed`); + this.logger.error(`No agent found with extension ${extension}. Event won't proceed`); // this should not even be possible, but just in case return; } @@ -96,8 +94,6 @@ export class OmnichannelVoipService extends ServiceClassInternal implements IOmn const { _id, department: departmentId } = guest; const newRoomAt = new Date(); - this.logger.debug(`Creating Voip room for visitor ${_id}`); - /** * This is a peculiar case for outbound. In case of outbound, * the room is created as soon as the remote use accepts a call. @@ -182,7 +178,6 @@ export class OmnichannelVoipService extends ServiceClassInternal implements IOmn _updatedAt: newRoomAt, }; - this.logger.debug(`Room created for visitor ${_id}`); return (await VoipRoom.insertOne(room)).insertedId; } @@ -234,11 +229,9 @@ export class OmnichannelVoipService extends ServiceClassInternal implements IOmn direction: IVoipRoom['direction'], options: FindOptions = {}, ): Promise { - this.logger.debug(`Attempting to find or create a room for visitor ${guest._id}`); let room = await VoipRoom.findOneById(rid, options); let newRoom = false; if (room && !room.open) { - this.logger.debug(`Last room for visitor ${guest._id} closed. Creating new one`); room = null; } if (room == null) { @@ -246,10 +239,8 @@ export class OmnichannelVoipService extends ServiceClassInternal implements IOmn const roomId = await this.createVoipRoom(rid, name, agent, guest, direction); room = await VoipRoom.findOneVoipRoomById(roomId); newRoom = true; - this.logger.debug(`Room obtained for visitor ${guest._id} -> ${room?._id}`); } if (!room) { - this.logger.debug(`Visitor ${guest._id} trying to access another visitor's room`); throw new Error('cannot-access-room'); } return { @@ -281,7 +272,6 @@ export class OmnichannelVoipService extends ServiceClassInternal implements IOmn sysMessageId: 'voip-call-wrapup' | 'voip-call-ended-unexpectedly' = 'voip-call-wrapup', options?: { comment?: string; tags?: string[] }, ): Promise { - this.logger.debug(`Attempting to close room ${room._id}`); if (!room || room.t !== 'v' || !room.open) { return false; } @@ -298,8 +288,6 @@ export class OmnichannelVoipService extends ServiceClassInternal implements IOmn // For now, this data will be appended as a metric on room closing await this.setCallWaitingQueueTimers(room); - this.logger.debug(`Room ${room._id} closed and timers set`); - this.logger.debug(`Room ${room._id} was closed at ${closeInfo.closedAt} (duration ${closeInfo.callDuration})`); await VoipRoom.closeByRoomId(room._id, closeInfo); return true; @@ -452,8 +440,6 @@ export class OmnichannelVoipService extends ServiceClassInternal implements IOmn }, }; - this.logger.debug(`Handling event ${event} on room ${room._id}`); - if ( isVoipRoom(room) && room.open && @@ -461,7 +447,6 @@ export class OmnichannelVoipService extends ServiceClassInternal implements IOmn // Check if call exists by looking if we have pbx events of it (await PbxEvents.findOneByUniqueId(room.callUniqueId)) ) { - this.logger.debug(`Room is valid. Sending event ${event}`); await sendMessage(user, message, room); } else { this.logger.warn({ msg: 'Invalid room type or event type', type: room.t, event }); diff --git a/apps/meteor/server/services/omnichannel/queue.ts b/apps/meteor/server/services/omnichannel/queue.ts index 684c10161a94..cbedf1cdcdec 100644 --- a/apps/meteor/server/services/omnichannel/queue.ts +++ b/apps/meteor/server/services/omnichannel/queue.ts @@ -20,24 +20,23 @@ export class OmnichannelQueue implements IOmnichannelQueue { } async start() { - queueLogger.debug('Starting queue'); if (this.running) { - queueLogger.debug('Queue already running'); return; } const activeQueues = await this.getActiveQueues(); queueLogger.debug(`Active queues: ${activeQueues.length}`); - this.running = true; + + queueLogger.info('Service started'); return this.execute(); } async stop() { - queueLogger.debug('Stopping queue'); await LivechatInquiry.unlockAll(); this.running = false; + queueLogger.info('Service stopped'); } private async getActiveQueues() { @@ -62,7 +61,7 @@ export class OmnichannelQueue implements IOmnichannelQueue { const queue = await this.nextQueue(); const queueDelayTimeout = this.delay(); - queueLogger.debug(`Executing queue ${queue || 'Public'} with timeout of ${queueDelayTimeout}`); + queueLogger.info(`Executing queue ${queue || 'Public'} with timeout of ${queueDelayTimeout}`); setTimeout(this.checkQueue.bind(this, queue), queueDelayTimeout); } diff --git a/ee/packages/omnichannel-services/src/OmnichannelTranscript.ts b/ee/packages/omnichannel-services/src/OmnichannelTranscript.ts index 899d298fb445..ce21e963911b 100644 --- a/ee/packages/omnichannel-services/src/OmnichannelTranscript.ts +++ b/ee/packages/omnichannel-services/src/OmnichannelTranscript.ts @@ -222,7 +222,7 @@ export class OmnichannelTranscript extends ServiceClass implements IOmnichannelT } let file = message.files?.map((v) => ({ _id: v._id, name: v.name })).find((file) => file.name === attachment.title); if (!file) { - this.log.debug(`File ${attachment.title} not found in room ${message.rid}!`); + this.log.warn(`File ${attachment.title} not found in room ${message.rid}!`); // For some reason, when an image is uploaded from clipboard, it doesn't have a file :( // So, we'll try to get the FILE_ID from the `title_link` prop which has the format `/file-upload/FILE_ID/FILE_NAME` using a regex const fileId = attachment.title_link?.match(/\/file-upload\/(.*)\/.*/)?.[1]; @@ -236,7 +236,7 @@ export class OmnichannelTranscript extends ServiceClass implements IOmnichannelT } if (!file) { - this.log.error(`File ${attachment.title} not found in room ${message.rid}!`); + this.log.warn(`File ${attachment.title} not found in room ${message.rid}!`); // ignore attachments without file files.push({ name: attachment.title, buffer: null }); continue; From 05f613f4354fe2a74b3d6b315da2523c395b97c6 Mon Sep 17 00:00:00 2001 From: Tasso Evangelista Date: Fri, 29 Sep 2023 18:21:07 -0300 Subject: [PATCH 217/275] chore: refactor cloud sync (#30401) --- .../server/functions/buildRegistrationData.ts | 24 +- .../server/functions/connectWorkspace.ts | 85 ++++-- .../functions/finishOAuthAuthorization.ts | 22 +- .../server/functions/getConfirmationPoll.ts | 18 +- .../getWorkspaceAccessTokenWithScope.ts | 12 +- .../server/functions/getWorkspaceLicense.ts | 112 +++++--- .../registerPreIntentWorkspaceWizard.ts | 10 +- .../functions/startRegisterWorkspace.ts | 17 +- .../startRegisterWorkspaceSetupWizard.ts | 16 +- .../functions/syncWorkspace/syncCloudData.ts | 267 ++++++++++++++---- .../app/cloud/server/functions/userLogout.ts | 3 +- .../app/statistics/server/lib/statistics.ts | 34 ++- .../lib/errors/CloudWorkspaceAccessError.ts | 8 + .../errors/CloudWorkspaceConnectionError.ts | 8 + apps/meteor/lib/errors/CloudWorkspaceError.ts | 6 + .../lib/errors/CloudWorkspaceLicenseError.ts | 8 + .../errors/CloudWorkspaceRegistrationError.ts | 8 + apps/meteor/package.json | 3 +- .../server/models/CloudAnnouncements.ts | 6 + .../server/models/raw/CloudAnnouncements.ts | 11 + apps/meteor/server/models/startup.ts | 1 + apps/meteor/server/services/banner/service.ts | 2 +- package.json | 2 +- .../core-services/src/types/IBannerService.ts | 2 +- packages/core-typings/.eslintrc.json | 5 +- packages/core-typings/package.json | 15 +- packages/core-typings/src/IStats.ts | 10 +- .../core-typings/src/cloud/Announcement.ts | 28 ++ .../src/cloud/NpsSurveyAnnouncement.ts | 7 + .../src/cloud/WorkspaceLicensePayload.ts | 10 + .../src/cloud/WorkspaceSyncPayload.ts | 33 +++ packages/core-typings/src/cloud/index.ts | 4 + packages/core-typings/src/index.ts | 2 + packages/model-typings/src/index.ts | 1 + .../model-typings/src/models/IBannersModel.ts | 4 +- .../src/models/ICloudAnnouncementsModel.ts | 6 + packages/models/src/index.ts | 2 + .../AutotranslateSaveSettingsParamsPOST.ts | 2 +- .../FederationVerifyMatrixIdProps.ts | 2 +- .../src/v1/moderation/ReportHistoryProps.ts | 1 + packages/rest-typings/src/v1/omnichannel.ts | 18 +- yarn.lock | 187 +++++++++--- 42 files changed, 757 insertions(+), 265 deletions(-) create mode 100644 apps/meteor/lib/errors/CloudWorkspaceAccessError.ts create mode 100644 apps/meteor/lib/errors/CloudWorkspaceConnectionError.ts create mode 100644 apps/meteor/lib/errors/CloudWorkspaceError.ts create mode 100644 apps/meteor/lib/errors/CloudWorkspaceLicenseError.ts create mode 100644 apps/meteor/lib/errors/CloudWorkspaceRegistrationError.ts create mode 100644 apps/meteor/server/models/CloudAnnouncements.ts create mode 100644 apps/meteor/server/models/raw/CloudAnnouncements.ts create mode 100644 packages/core-typings/src/cloud/Announcement.ts create mode 100644 packages/core-typings/src/cloud/NpsSurveyAnnouncement.ts create mode 100644 packages/core-typings/src/cloud/WorkspaceLicensePayload.ts create mode 100644 packages/core-typings/src/cloud/WorkspaceSyncPayload.ts create mode 100644 packages/core-typings/src/cloud/index.ts create mode 100644 packages/model-typings/src/models/ICloudAnnouncementsModel.ts diff --git a/apps/meteor/app/cloud/server/functions/buildRegistrationData.ts b/apps/meteor/app/cloud/server/functions/buildRegistrationData.ts index d65897b72094..10e0d7f7f7ee 100644 --- a/apps/meteor/app/cloud/server/functions/buildRegistrationData.ts +++ b/apps/meteor/app/cloud/server/functions/buildRegistrationData.ts @@ -5,7 +5,7 @@ import { settings } from '../../../settings/server'; import { statistics } from '../../../statistics/server'; import { LICENSE_VERSION } from '../license'; -type WorkspaceRegistrationData = { +export type WorkspaceRegistrationData = { uniqueId: string; workspaceId: SettingValue; address: SettingValue; @@ -14,11 +14,11 @@ type WorkspaceRegistrationData = { seats: number; allowMarketing: SettingValue; accountName: SettingValue; - organizationType: unknown; - industry: unknown; - orgSize: unknown; - country: unknown; - language: unknown; + organizationType: string; + industry: string; + orgSize: string; + country: string; + language: string; agreePrivacyTerms: SettingValue; website: SettingValue; siteName: SettingValue; @@ -61,15 +61,15 @@ export async function buildWorkspaceRegistrationData { + const cloudUrl = settings.get('Cloud_Url'); + const response = await fetch(`${cloudUrl}/api/oauth/clients`, { + method: 'POST', + headers: { + Authorization: `Bearer ${token}`, + }, + body, + }); + + if (!response.ok) { + try { + const { error } = await response.json(); + throw new CloudWorkspaceConnectionError(`Failed to connect to Rocket.Chat Cloud: ${error}`); + } catch (error) { + throw new CloudWorkspaceConnectionError(`Failed to connect to Rocket.Chat Cloud: ${response.statusText}`); + } + } + + const payload = await response.json(); + + if (!payload) { + return undefined; + } + + return payload; +}; + export async function connectWorkspace(token: string) { - // shouldn't get here due to checking this on the method - // but this is just to double check if (!token) { - return new Error('Invalid token; the registration token is required.'); + throw new CloudWorkspaceConnectionError('Invalid registration token'); } - const redirectUri = getRedirectUri(); + try { + const redirectUri = getRedirectUri(); - const regInfo = { - email: settings.get('Organization_Email'), - client_name: settings.get('Site_Name'), - redirect_uris: [redirectUri], - }; + const body = { + email: settings.get('Organization_Email'), + client_name: settings.get('Site_Name'), + redirect_uris: [redirectUri], + }; - const cloudUrl = settings.get('Cloud_Url'); - let result; - try { - const request = await fetch(`${cloudUrl}/api/oauth/clients`, { - method: 'POST', - headers: { - Authorization: `Bearer ${token}`, - }, - body: regInfo, - }); + const payload = await fetchRegistrationDataPayload({ token, body }); - if (!request.ok) { - throw new Error((await request.json()).error); + if (!payload) { + return false; } - result = await request.json(); - } catch (err: any) { + await saveRegistrationData(payload); + + return true; + } catch (err) { SystemLogger.error({ msg: 'Failed to Connect with Rocket.Chat Cloud', url: '/api/oauth/clients', @@ -45,12 +76,4 @@ export async function connectWorkspace(token: string) { return false; } - - if (!result) { - return false; - } - - await saveRegistrationData(result); - - return true; } diff --git a/apps/meteor/app/cloud/server/functions/finishOAuthAuthorization.ts b/apps/meteor/app/cloud/server/functions/finishOAuthAuthorization.ts index 780aa5c67a99..61b3a77966e7 100644 --- a/apps/meteor/app/cloud/server/functions/finishOAuthAuthorization.ts +++ b/apps/meteor/app/cloud/server/functions/finishOAuthAuthorization.ts @@ -14,15 +14,15 @@ export async function finishOAuthAuthorization(code: string, state: string) { }); } - const cloudUrl = settings.get('Cloud_Url'); const clientId = settings.get('Cloud_Workspace_Client_Id'); const clientSecret = settings.get('Cloud_Workspace_Client_Secret'); const scope = userScopes.join(' '); - let result; + let payload; try { - const request = await fetch(`${cloudUrl}/api/oauth/token`, { + const cloudUrl = settings.get('Cloud_Url'); + const response = await fetch(`${cloudUrl}/api/oauth/token`, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, params: new URLSearchParams({ @@ -35,11 +35,11 @@ export async function finishOAuthAuthorization(code: string, state: string) { }), }); - if (!request.ok) { - throw new Error((await request.json()).error); + if (!response.ok) { + throw new Error((await response.json()).error); } - result = await request.json(); + payload = await response.json(); } catch (err) { SystemLogger.error({ msg: 'Failed to finish OAuth authorization with Rocket.Chat Cloud', @@ -51,7 +51,7 @@ export async function finishOAuthAuthorization(code: string, state: string) { } const expiresAt = new Date(); - expiresAt.setSeconds(expiresAt.getSeconds() + result.expires_in); + expiresAt.setSeconds(expiresAt.getSeconds() + payload.expires_in); const uid = Meteor.userId(); if (!uid) { @@ -65,11 +65,11 @@ export async function finishOAuthAuthorization(code: string, state: string) { { $set: { 'services.cloud': { - accessToken: result.access_token, + accessToken: payload.access_token, expiresAt, - scope: result.scope, - tokenType: result.token_type, - refreshToken: result.refresh_token, + scope: payload.scope, + tokenType: payload.token_type, + refreshToken: payload.refresh_token, }, }, }, diff --git a/apps/meteor/app/cloud/server/functions/getConfirmationPoll.ts b/apps/meteor/app/cloud/server/functions/getConfirmationPoll.ts index 4a35c9834ba5..2c5d9dec77dc 100644 --- a/apps/meteor/app/cloud/server/functions/getConfirmationPoll.ts +++ b/apps/meteor/app/cloud/server/functions/getConfirmationPoll.ts @@ -5,16 +5,16 @@ import { SystemLogger } from '../../../../server/lib/logger/system'; import { settings } from '../../../settings/server'; export async function getConfirmationPoll(deviceCode: string): Promise { - const cloudUrl = settings.get('Cloud_Url'); - - let result; + let payload; try { - const request = await fetch(`${cloudUrl}/api/v2/register/workspace/poll`, { params: { token: deviceCode } }); - if (!request.ok) { - throw new Error((await request.json()).error); + const cloudUrl = settings.get('Cloud_Url'); + const response = await fetch(`${cloudUrl}/api/v2/register/workspace/poll`, { params: { token: deviceCode } }); + + if (!response.ok) { + throw new Error((await response.json()).error); } - result = await request.json(); + payload = await response.json(); } catch (err: any) { SystemLogger.error({ msg: 'Failed to get confirmation poll from Rocket.Chat Cloud', @@ -25,9 +25,9 @@ export async function getConfirmationPoll(deviceCode: string): Promise('Cloud_Url'); // eslint-disable-next-line @typescript-eslint/naming-convention const client_secret = settings.get('Cloud_Workspace_Client_Secret'); const redirectUri = getRedirectUri(); - let authTokenResult; + let payload; try { const body = new URLSearchParams(); body.append('client_id', client_id); @@ -40,12 +39,13 @@ export async function getWorkspaceAccessTokenWithScope(scope = '') { body.append('grant_type', 'client_credentials'); body.append('redirect_uri', redirectUri); - const result = await fetch(`${cloudUrl}/api/oauth/token`, { + const cloudUrl = settings.get('Cloud_Url'); + const response = await fetch(`${cloudUrl}/api/oauth/token`, { headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, method: 'POST', body, }); - authTokenResult = await result.json(); + payload = await response.json(); } catch (err: any) { SystemLogger.error({ msg: 'Failed to get Workspace AccessToken from Rocket.Chat Cloud', @@ -64,10 +64,10 @@ export async function getWorkspaceAccessTokenWithScope(scope = '') { } const expiresAt = new Date(); - expiresAt.setSeconds(expiresAt.getSeconds() + authTokenResult.expires_in); + expiresAt.setSeconds(expiresAt.getSeconds() + payload.expires_in); tokenResponse.expiresAt = expiresAt; - tokenResponse.token = authTokenResult.access_token; + tokenResponse.token = payload.access_token; return tokenResponse; } diff --git a/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts b/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts index 6be18f86d466..504de297791f 100644 --- a/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts +++ b/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts @@ -1,56 +1,94 @@ +import type { Cloud, Serialized } from '@rocket.chat/core-typings'; import { Settings } from '@rocket.chat/models'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; +import { v, compile } from 'suretype'; import { callbacks } from '../../../../lib/callbacks'; +import { CloudWorkspaceConnectionError } from '../../../../lib/errors/CloudWorkspaceConnectionError'; +import { CloudWorkspaceLicenseError } from '../../../../lib/errors/CloudWorkspaceLicenseError'; import { SystemLogger } from '../../../../server/lib/logger/system'; import { settings } from '../../../settings/server'; import { LICENSE_VERSION } from '../license'; -import { generateWorkspaceBearerHttpHeaderOrThrow } from './getWorkspaceAccessToken'; -import { handleResponse } from './supportedVersionsToken/supportedVersionsToken'; +import { getWorkspaceAccessToken } from './getWorkspaceAccessToken'; -export async function getWorkspaceLicense() { - const token = await generateWorkspaceBearerHttpHeaderOrThrow(); +const workspaceLicensePayloadSchema = v.object({ + version: v.number().required(), + address: v.string().required(), + license: v.string().required(), + updatedAt: v.string().format('date-time').required(), + modules: v.string().required(), + expireAt: v.string().format('date-time').required(), +}); - const currentLicense = await Settings.findOne('Cloud_Workspace_License'); +const assertWorkspaceLicensePayload = compile(workspaceLicensePayloadSchema); + +const fetchCloudWorkspaceLicensePayload = async ({ token }: { token: string }): Promise> => { + const workspaceRegistrationClientUri = settings.get('Cloud_Workspace_Registration_Client_Uri'); + const response = await fetch(`${workspaceRegistrationClientUri}/license`, { + headers: { + Authorization: `Bearer ${token}`, + }, + params: { + version: LICENSE_VERSION, + }, + }); - // TODO: check if this is the correct way to handle this - // If there is no license, in theory, it should be a new workspace non registered - // in this case the `generateWorkspaceBearerHttpHeaderOrThrow` show throw an error before - // so in theory, this should never happen - if (!currentLicense?._updatedAt) { - throw new Error('Failed to retrieve current license'); + if (!response.ok) { + try { + const { error } = await response.json(); + throw new CloudWorkspaceConnectionError(`Failed to connect to Rocket.Chat Cloud: ${error}`); + } catch (error) { + throw new CloudWorkspaceConnectionError(`Failed to connect to Rocket.Chat Cloud: ${response.statusText}`); + } } - const request = await handleResponse( - fetch(`${settings.get('Cloud_Workspace_Registration_Client_Uri')}/license`, { - headers: { - ...token, - }, - params: { - version: LICENSE_VERSION, - }, - }), - ); - - if (!request.success) { + const payload = await response.json(); + + assertWorkspaceLicensePayload(payload); + + return payload; +}; + +export async function getWorkspaceLicense(): Promise<{ updated: boolean; license: string }> { + const currentLicense = await Settings.findOne('Cloud_Workspace_License'); + + const fromCurrentLicense = async () => { + const license = currentLicense?.value as string | undefined; + if (license) { + callbacks.run('workspaceLicenseChanged', license); + } + + return { updated: false, license: license ?? '' }; + }; + + try { + const token = await getWorkspaceAccessToken(); + if (!token) { + return fromCurrentLicense(); + } + + if (!currentLicense?._updatedAt) { + throw new CloudWorkspaceLicenseError('Failed to retrieve current license'); + } + + const payload = await fetchCloudWorkspaceLicensePayload({ token }); + + if (Date.parse(payload.updatedAt) <= currentLicense._updatedAt.getTime()) { + return fromCurrentLicense(); + } + + await Settings.updateValueById('Cloud_Workspace_License', payload.license); + + await callbacks.run('workspaceLicenseChanged', payload.license); + + return { updated: true, license: payload.license }; + } catch (err) { SystemLogger.error({ msg: 'Failed to update license from Rocket.Chat Cloud', url: '/license', - err: request.error, + err, }); - if (currentLicense.value) { - return callbacks.run('workspaceLicenseChanged', currentLicense.value); - } - return; - } - const remoteLicense = request.result as any; - - if (remoteLicense.updatedAt <= currentLicense._updatedAt) { - return callbacks.run('workspaceLicenseChanged', currentLicense.value); + return fromCurrentLicense(); } - - await Settings.updateValueById('Cloud_Workspace_License', remoteLicense.license); - - await callbacks.run('workspaceLicenseChanged', remoteLicense.license); } diff --git a/apps/meteor/app/cloud/server/functions/registerPreIntentWorkspaceWizard.ts b/apps/meteor/app/cloud/server/functions/registerPreIntentWorkspaceWizard.ts index 2a04aa54cfe7..ce415d2aa983 100644 --- a/apps/meteor/app/cloud/server/functions/registerPreIntentWorkspaceWizard.ts +++ b/apps/meteor/app/cloud/server/functions/registerPreIntentWorkspaceWizard.ts @@ -15,16 +15,16 @@ export async function registerPreIntentWorkspaceWizard(): Promise { } const regInfo = await buildWorkspaceRegistrationData(email); - const cloudUrl = settings.get('Cloud_Url'); try { - const request = await fetch(`${cloudUrl}/api/v2/register/workspace/pre-intent`, { + const cloudUrl = settings.get('Cloud_Url'); + const response = await fetch(`${cloudUrl}/api/v2/register/workspace/pre-intent`, { + method: 'POST', body: regInfo, timeout: 10 * 1000, - method: 'POST', }); - if (!request.ok) { - throw new Error((await request.json()).error); + if (!response.ok) { + throw new Error((await response.json()).error); } return true; diff --git a/apps/meteor/app/cloud/server/functions/startRegisterWorkspace.ts b/apps/meteor/app/cloud/server/functions/startRegisterWorkspace.ts index 7f7c78a137e0..5f5df80d0d3d 100644 --- a/apps/meteor/app/cloud/server/functions/startRegisterWorkspace.ts +++ b/apps/meteor/app/cloud/server/functions/startRegisterWorkspace.ts @@ -19,22 +19,21 @@ export async function startRegisterWorkspace(resend = false) { const regInfo = await buildWorkspaceRegistrationData(undefined); - const cloudUrl = settings.get('Cloud_Url'); - - let result; + let payload; try { - const request = await fetch(`${cloudUrl}/api/v2/register/workspace`, { + const cloudUrl = settings.get('Cloud_Url'); + const response = await fetch(`${cloudUrl}/api/v2/register/workspace`, { method: 'POST', body: regInfo, params: { resend, }, }); - if (!request.ok) { - throw new Error((await request.json()).error); + if (!response.ok) { + throw new Error((await response.json()).error); } - result = await request.json(); + payload = await response.json(); } catch (err: any) { SystemLogger.error({ msg: 'Failed to register with Rocket.Chat Cloud', @@ -44,11 +43,11 @@ export async function startRegisterWorkspace(resend = false) { return false; } - if (!result) { + if (!payload) { return false; } - await Settings.updateValueById('Cloud_Workspace_Id', result.id); + await Settings.updateValueById('Cloud_Workspace_Id', payload.id); return true; } diff --git a/apps/meteor/app/cloud/server/functions/startRegisterWorkspaceSetupWizard.ts b/apps/meteor/app/cloud/server/functions/startRegisterWorkspaceSetupWizard.ts index 3afe84c409ec..382478db61c7 100644 --- a/apps/meteor/app/cloud/server/functions/startRegisterWorkspaceSetupWizard.ts +++ b/apps/meteor/app/cloud/server/functions/startRegisterWorkspaceSetupWizard.ts @@ -7,22 +7,22 @@ import { buildWorkspaceRegistrationData } from './buildRegistrationData'; export async function startRegisterWorkspaceSetupWizard(resend = false, email: string): Promise { const regInfo = await buildWorkspaceRegistrationData(email); - const cloudUrl = settings.get('Cloud_Url'); - let result; + let payload; try { - const request = await fetch(`${cloudUrl}/api/v2/register/workspace/intent`, { + const cloudUrl = settings.get('Cloud_Url'); + const response = await fetch(`${cloudUrl}/api/v2/register/workspace/intent`, { body: regInfo, method: 'POST', params: { resent: resend, }, }); - if (!request.ok) { - throw new Error((await request.json()).error); + if (!response.ok) { + throw new Error((await response.json()).error); } - result = await request.json(); + payload = await response.json(); } catch (err: any) { SystemLogger.error({ msg: 'Failed to register workspace intent with Rocket.Chat Cloud', @@ -33,9 +33,9 @@ export async function startRegisterWorkspaceSetupWizard(resend = false, email: s throw err; } - if (!result) { + if (!payload) { throw new Error('Failed to fetch registration intent endpoint'); } - return result; + return payload; } diff --git a/apps/meteor/app/cloud/server/functions/syncWorkspace/syncCloudData.ts b/apps/meteor/app/cloud/server/functions/syncWorkspace/syncCloudData.ts index 0dc56f31c5da..df63dda6d563 100644 --- a/apps/meteor/app/cloud/server/functions/syncWorkspace/syncCloudData.ts +++ b/apps/meteor/app/cloud/server/functions/syncWorkspace/syncCloudData.ts @@ -1,85 +1,242 @@ import { NPS, Banner } from '@rocket.chat/core-services'; -import { Settings } from '@rocket.chat/models'; +import { type Cloud, type Serialized } from '@rocket.chat/core-typings'; +import { CloudAnnouncements, Settings } from '@rocket.chat/models'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; +import { v, compile } from 'suretype'; +import { CloudWorkspaceAccessError } from '../../../../../lib/errors/CloudWorkspaceAccessError'; +import { CloudWorkspaceConnectionError } from '../../../../../lib/errors/CloudWorkspaceConnectionError'; +import { CloudWorkspaceRegistrationError } from '../../../../../lib/errors/CloudWorkspaceRegistrationError'; import { SystemLogger } from '../../../../../server/lib/logger/system'; import { getAndCreateNpsSurvey } from '../../../../../server/services/nps/getAndCreateNpsSurvey'; import { settings } from '../../../../settings/server'; +import type { WorkspaceRegistrationData } from '../buildRegistrationData'; import { buildWorkspaceRegistrationData } from '../buildRegistrationData'; -import { generateWorkspaceBearerHttpHeaderOrThrow } from '../getWorkspaceAccessToken'; -import { handleResponse } from '../supportedVersionsToken/supportedVersionsToken'; +import { getWorkspaceAccessToken } from '../getWorkspaceAccessToken'; +import { getWorkspaceLicense } from '../getWorkspaceLicense'; +import { retrieveRegistrationStatus } from '../retrieveRegistrationStatus'; + +const workspaceSyncPayloadSchema = v.object({ + workspaceId: v.string().required(), + publicKey: v.string(), + trial: v.object({ + trialing: v.boolean().required(), + trialID: v.string().required(), + endDate: v.string().format('date-time').required(), + marketing: v + .object({ + utmContent: v.string().required(), + utmMedium: v.string().required(), + utmSource: v.string().required(), + utmCampaign: v.string().required(), + }) + .required(), + DowngradesToPlan: v + .object({ + id: v.string().required(), + }) + .required(), + trialRequested: v.boolean().required(), + }), + nps: v.object({ + id: v.string().required(), + startAt: v.string().format('date-time').required(), + expireAt: v.string().format('date-time').required(), + }), + banners: v.array( + v.object({ + _id: v.string().required(), + _updatedAt: v.string().format('date-time').required(), + platform: v.array(v.string()).required(), + expireAt: v.string().format('date-time').required(), + startAt: v.string().format('date-time').required(), + roles: v.array(v.string()), + createdBy: v.object({ + _id: v.string().required(), + username: v.string(), + }), + createdAt: v.string().format('date-time').required(), + view: v.any(), + active: v.boolean(), + inactivedAt: v.string().format('date-time'), + snapshot: v.string(), + }), + ), + announcements: v.object({ + create: v.array( + v.object({ + _id: v.string().required(), + _updatedAt: v.string().format('date-time').required(), + selector: v.object({ + roles: v.array(v.string()), + }), + platform: v.array(v.string().enum('web', 'mobile')).required(), + expireAt: v.string().format('date-time').required(), + startAt: v.string().format('date-time').required(), + createdBy: v.string().enum('cloud', 'system').required(), + createdAt: v.string().format('date-time').required(), + dictionary: v.object({}).additional(v.object({}).additional(v.string())), + view: v.any(), + surface: v.string().enum('banner', 'modal').required(), + }), + ), + delete: v.array(v.string()), + }), +}); + +const assertWorkspaceSyncPayload = compile(workspaceSyncPayloadSchema); + +const fetchWorkspaceSyncPayload = async ({ + token, + workspaceRegistrationData, +}: { + token: string; + workspaceRegistrationData: WorkspaceRegistrationData; +}): Promise | undefined> => { + const workspaceRegistrationClientUri = settings.get('Cloud_Workspace_Registration_Client_Uri'); + const response = await fetch(`${workspaceRegistrationClientUri}/client`, { + method: 'POST', + headers: { + Authorization: `Bearer ${token}`, + }, + body: workspaceRegistrationData, + }); + + if (!response.ok) { + try { + const { error } = await response.json(); + throw new CloudWorkspaceConnectionError(`Failed to connect to Rocket.Chat Cloud: ${error}`); + } catch (error) { + throw new CloudWorkspaceConnectionError(`Failed to connect to Rocket.Chat Cloud: ${response.statusText}`); + } + } -export async function syncCloudData() { - const info = await buildWorkspaceRegistrationData(undefined); + const payload = await response.json(); + + if (!payload) { + return undefined; + } - const token = await generateWorkspaceBearerHttpHeaderOrThrow(true); + assertWorkspaceSyncPayload(payload); - const request = await handleResponse( - fetch(`${settings.get('Cloud_Workspace_Registration_Client_Uri')}/client`, { - headers: { - ...token, - }, - body: info, - method: 'POST', - }), - ); + return payload; +}; - if (!request.success) { - return SystemLogger.error({ - msg: 'Failed to sync with Rocket.Chat Cloud', - url: '/client', - err: request.error, +const handleNpsOnWorkspaceSync = async (nps: Exclude['nps'], undefined>) => { + const { id: npsId, expireAt } = nps; + + const startAt = new Date(nps.startAt); + + await NPS.create({ + npsId, + startAt, + expireAt: new Date(expireAt), + createdBy: { + _id: 'rocket.cat', + username: 'rocket.cat', + }, + }); + + const now = new Date(); + + if (startAt.getFullYear() === now.getFullYear() && startAt.getMonth() === now.getMonth() && startAt.getDate() === now.getDate()) { + await getAndCreateNpsSurvey(npsId); + } +}; + +const handleBannerOnWorkspaceSync = async (banners: Exclude['banners'], undefined>) => { + for await (const banner of banners) { + const { createdAt, expireAt, startAt, inactivedAt, _updatedAt, ...rest } = banner; + + await Banner.create({ + ...rest, + createdAt: new Date(createdAt), + expireAt: new Date(expireAt), + startAt: new Date(startAt), + ...(inactivedAt && { inactivedAt: new Date(inactivedAt) }), }); } +}; + +const deserializeAnnouncement = (announcement: Serialized): Cloud.Announcement => ({ + ...announcement, + _updatedAt: new Date(announcement._updatedAt), + expireAt: new Date(announcement.expireAt), + startAt: new Date(announcement.startAt), + createdAt: new Date(announcement.createdAt), +}); + +const handleAnnouncementsOnWorkspaceSync = async ( + announcements: Exclude['announcements'], undefined>, +) => { + const { create, delete: deleteIds } = announcements; + + if (deleteIds) { + await CloudAnnouncements.deleteMany({ _id: { $in: deleteIds } }); + } - const data = request.result as any; - if (!data) { - return true; + for await (const announcement of create.map(deserializeAnnouncement)) { + const { _id, ...rest } = announcement; + + await CloudAnnouncements.updateOne({ _id }, { $set: rest }, { upsert: true }); } +}; - if (data.publicKey) { - await Settings.updateValueById('Cloud_Workspace_PublicKey', data.publicKey); +const consumeWorkspaceSyncPayload = async (result: Serialized) => { + if (result.publicKey) { + await Settings.updateValueById('Cloud_Workspace_PublicKey', result.publicKey); } - if (data.trial?.trialId) { + if (result.trial?.trialID) { await Settings.updateValueById('Cloud_Workspace_Had_Trial', true); } - if (data.nps) { - const { id: npsId, expireAt } = data.nps; + if (result.nps) { + await handleNpsOnWorkspaceSync(result.nps); + } - const startAt = new Date(data.nps.startAt); + // add banners + if (result.banners) { + await handleBannerOnWorkspaceSync(result.banners); + } - await NPS.create({ - npsId, - startAt, - expireAt: new Date(expireAt), - createdBy: { - _id: 'rocket.cat', - username: 'rocket.cat', - }, - }); + if (result.announcements) { + await handleAnnouncementsOnWorkspaceSync(result.announcements); + } +}; - const now = new Date(); +export async function syncCloudData() { + try { + const { workspaceRegistered } = await retrieveRegistrationStatus(); + if (!workspaceRegistered) { + throw new CloudWorkspaceRegistrationError('Workspace is not registered'); + } - if (startAt.getFullYear() === now.getFullYear() && startAt.getMonth() === now.getMonth() && startAt.getDate() === now.getDate()) { - await getAndCreateNpsSurvey(npsId); + const token = await getWorkspaceAccessToken(true); + if (!token) { + throw new CloudWorkspaceAccessError('Workspace does not have a valid access token'); } - } - // add banners - if (data.banners) { - for await (const banner of data.banners) { - const { createdAt, expireAt, startAt } = banner; - - await Banner.create({ - ...banner, - createdAt: new Date(createdAt), - expireAt: new Date(expireAt), - startAt: new Date(startAt), - }); + const workspaceRegistrationData = await buildWorkspaceRegistrationData(undefined); + + const payload = await fetchWorkspaceSyncPayload({ token, workspaceRegistrationData }); + + if (!payload) { + return true; } - } - return true; + await consumeWorkspaceSyncPayload(payload); + + return true; + } catch (err) { + SystemLogger.error({ + msg: 'Failed to sync with Rocket.Chat Cloud', + url: '/client', + err, + }); + + return false; + } finally { + await getWorkspaceLicense(); + } } diff --git a/apps/meteor/app/cloud/server/functions/userLogout.ts b/apps/meteor/app/cloud/server/functions/userLogout.ts index 7dd4aa094535..386137ced604 100644 --- a/apps/meteor/app/cloud/server/functions/userLogout.ts +++ b/apps/meteor/app/cloud/server/functions/userLogout.ts @@ -26,10 +26,11 @@ export async function userLogout(userId: string): Promise { return ''; } - const cloudUrl = settings.get('Cloud_Url'); const clientSecret = settings.get('Cloud_Workspace_Client_Secret'); const { refreshToken } = user.services.cloud; + + const cloudUrl = settings.get('Cloud_Url'); await fetch(`${cloudUrl}/api/oauth/revoke`, { method: 'POST', headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, diff --git a/apps/meteor/app/statistics/server/lib/statistics.ts b/apps/meteor/app/statistics/server/lib/statistics.ts index 54470a209196..b6b983d92fce 100644 --- a/apps/meteor/app/statistics/server/lib/statistics.ts +++ b/apps/meteor/app/statistics/server/lib/statistics.ts @@ -41,8 +41,6 @@ import { getAppsStatistics } from './getAppsStatistics'; import { getImporterStatistics } from './getImporterStatistics'; import { getServicesStatistics } from './getServicesStatistics'; -const wizardFields = ['Organization_Type', 'Industry', 'Size', 'Country', 'Language', 'Server_Type', 'Register_Server']; - const getUserLanguages = async (totalUsers: number): Promise<{ [key: string]: number }> => { const result = await Users.getUserLanguages(); @@ -70,17 +68,29 @@ export const statistics = { const statistics = {} as IStats; const statsPms = []; + const fetchWizardSettingValue = async (settingName: string): Promise => { + return ((await Settings.findOne(settingName))?.value as T | undefined) ?? undefined; + }; + // Setup Wizard - statistics.wizard = {}; - await Promise.all( - wizardFields.map(async (field) => { - const record = await Settings.findOne(field); - if (record) { - const wizardField = field.replace(/_/g, '').replace(field[0], field[0].toLowerCase()); - statistics.wizard[wizardField] = record.value; - } - }), - ); + const [organizationType, industry, size, country, language, serverType, registerServer] = await Promise.all([ + fetchWizardSettingValue('Organization_Type'), + fetchWizardSettingValue('Industry'), + fetchWizardSettingValue('Size'), + fetchWizardSettingValue('Country'), + fetchWizardSettingValue('Language'), + fetchWizardSettingValue('Server_Type'), + fetchWizardSettingValue('Register_Server'), + ]); + statistics.wizard = { + organizationType, + industry, + size, + country, + language, + serverType, + registerServer, + }; // Version const uniqueID = await Settings.findOne('uniqueID'); diff --git a/apps/meteor/lib/errors/CloudWorkspaceAccessError.ts b/apps/meteor/lib/errors/CloudWorkspaceAccessError.ts new file mode 100644 index 000000000000..4cea63a01f09 --- /dev/null +++ b/apps/meteor/lib/errors/CloudWorkspaceAccessError.ts @@ -0,0 +1,8 @@ +import { CloudWorkspaceError } from './CloudWorkspaceError'; + +export class CloudWorkspaceAccessError extends CloudWorkspaceError { + constructor(message: string) { + super(message); + this.name = CloudWorkspaceAccessError.name; + } +} diff --git a/apps/meteor/lib/errors/CloudWorkspaceConnectionError.ts b/apps/meteor/lib/errors/CloudWorkspaceConnectionError.ts new file mode 100644 index 000000000000..8b4edcf8f588 --- /dev/null +++ b/apps/meteor/lib/errors/CloudWorkspaceConnectionError.ts @@ -0,0 +1,8 @@ +import { CloudWorkspaceError } from './CloudWorkspaceError'; + +export class CloudWorkspaceConnectionError extends CloudWorkspaceError { + constructor(message: string) { + super(message); + this.name = CloudWorkspaceConnectionError.name; + } +} diff --git a/apps/meteor/lib/errors/CloudWorkspaceError.ts b/apps/meteor/lib/errors/CloudWorkspaceError.ts new file mode 100644 index 000000000000..d843c42ea520 --- /dev/null +++ b/apps/meteor/lib/errors/CloudWorkspaceError.ts @@ -0,0 +1,6 @@ +export class CloudWorkspaceError extends Error { + constructor(message: string) { + super(message); + this.name = CloudWorkspaceError.name; + } +} diff --git a/apps/meteor/lib/errors/CloudWorkspaceLicenseError.ts b/apps/meteor/lib/errors/CloudWorkspaceLicenseError.ts new file mode 100644 index 000000000000..96c9a28be82c --- /dev/null +++ b/apps/meteor/lib/errors/CloudWorkspaceLicenseError.ts @@ -0,0 +1,8 @@ +import { CloudWorkspaceError } from './CloudWorkspaceError'; + +export class CloudWorkspaceLicenseError extends CloudWorkspaceError { + constructor(message: string) { + super(message); + this.name = CloudWorkspaceLicenseError.name; + } +} diff --git a/apps/meteor/lib/errors/CloudWorkspaceRegistrationError.ts b/apps/meteor/lib/errors/CloudWorkspaceRegistrationError.ts new file mode 100644 index 000000000000..aecec757acee --- /dev/null +++ b/apps/meteor/lib/errors/CloudWorkspaceRegistrationError.ts @@ -0,0 +1,8 @@ +import { CloudWorkspaceError } from './CloudWorkspaceError'; + +export class CloudWorkspaceRegistrationError extends CloudWorkspaceError { + constructor(message: string) { + super(message); + this.name = CloudWorkspaceRegistrationError.name; + } +} diff --git a/apps/meteor/package.json b/apps/meteor/package.json index b59552d1fcc5..8bf3e3fe886a 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -289,7 +289,7 @@ "@xmldom/xmldom": "^0.8.8", "adm-zip": "0.5.10", "ajv": "^8.11.0", - "ajv-formats": "^2.1.1", + "ajv-formats": "~2.1.1", "apn": "2.2.0", "archiver": "^3.1.1", "asterisk-manager": "^0.2.0", @@ -417,6 +417,7 @@ "stream-buffers": "^3.0.2", "strict-uri-encode": "^2.0.0", "string-strip-html": "^7.0.3", + "suretype": "~2.4.1", "tar-stream": "^1.6.2", "textarea-caret": "^3.1.0", "tinykeys": "^1.4.0", diff --git a/apps/meteor/server/models/CloudAnnouncements.ts b/apps/meteor/server/models/CloudAnnouncements.ts new file mode 100644 index 000000000000..4f6692d67fc9 --- /dev/null +++ b/apps/meteor/server/models/CloudAnnouncements.ts @@ -0,0 +1,6 @@ +import { registerModel } from '@rocket.chat/models'; + +import { db } from '../database/utils'; +import { CloudAnnouncementsRaw } from './raw/CloudAnnouncements'; + +registerModel('ICloudAnnouncementsModel', new CloudAnnouncementsRaw(db)); diff --git a/apps/meteor/server/models/raw/CloudAnnouncements.ts b/apps/meteor/server/models/raw/CloudAnnouncements.ts new file mode 100644 index 000000000000..21b4304b2bd5 --- /dev/null +++ b/apps/meteor/server/models/raw/CloudAnnouncements.ts @@ -0,0 +1,11 @@ +import type { Cloud } from '@rocket.chat/core-typings'; +import type { ICloudAnnouncementsModel } from '@rocket.chat/model-typings'; +import type { Db } from 'mongodb'; + +import { BaseRaw } from './BaseRaw'; + +export class CloudAnnouncementsRaw extends BaseRaw implements ICloudAnnouncementsModel { + constructor(db: Db) { + super(db, 'cloud_announcements'); + } +} diff --git a/apps/meteor/server/models/startup.ts b/apps/meteor/server/models/startup.ts index 14b26e0f188f..d355d1febd16 100644 --- a/apps/meteor/server/models/startup.ts +++ b/apps/meteor/server/models/startup.ts @@ -68,3 +68,4 @@ import './Imports'; import './AppsTokens'; import './CronHistory'; import './Migrations'; +import './CloudAnnouncements'; diff --git a/apps/meteor/server/services/banner/service.ts b/apps/meteor/server/services/banner/service.ts index 4dc0dbbec494..d20b9e780875 100644 --- a/apps/meteor/server/services/banner/service.ts +++ b/apps/meteor/server/services/banner/service.ts @@ -26,7 +26,7 @@ export class BannerService extends ServiceClassInternal implements IBannerServic return true; } - async create(doc: Optional): Promise { + async create(doc: Optional): Promise { const bannerId = doc._id || uuidv4(); doc.view.appId = 'banner-core'; diff --git a/package.json b/package.json index f9029efb8b66..962e42d48c6e 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@types/chart.js": "^2.9.37", "@types/js-yaml": "^4.0.5", "husky": "^7.0.4", - "turbo": "^1.10.13" + "turbo": "~1.10.14" }, "workspaces": [ "apps/*", diff --git a/packages/core-services/src/types/IBannerService.ts b/packages/core-services/src/types/IBannerService.ts index 1035bdd59510..50b8ab08275c 100644 --- a/packages/core-services/src/types/IBannerService.ts +++ b/packages/core-services/src/types/IBannerService.ts @@ -2,7 +2,7 @@ import type { BannerPlatform, IBanner, Optional } from '@rocket.chat/core-typing export interface IBannerService { getBannersForUser(userId: string, platform: BannerPlatform, bannerId?: string): Promise; - create(banner: Optional): Promise; + create(banner: Optional): Promise; dismiss(userId: string, bannerId: string): Promise; discardDismissal(bannerId: string): Promise; getById(bannerId: string): Promise; diff --git a/packages/core-typings/.eslintrc.json b/packages/core-typings/.eslintrc.json index 56a6f6602e33..44d74e043bc4 100644 --- a/packages/core-typings/.eslintrc.json +++ b/packages/core-typings/.eslintrc.json @@ -8,5 +8,8 @@ } } ], - "ignorePatterns": ["**/dist"] + "ignorePatterns": ["**/dist"], + "rules": { + "@typescript-eslint/no-empty-interface": "off" + } } diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 2d0b0d734897..2b673be0f857 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -1,13 +1,7 @@ { + "$schema": "https://json.schemastore.org/package", "name": "@rocket.chat/core-typings", "version": "6.4.0-rc.4", - "devDependencies": { - "@rocket.chat/eslint-config": "workspace:^", - "eslint": "~8.45.0", - "mongodb": "^4.17.1", - "prettier": "~2.8.8", - "typescript": "~5.2.2" - }, "scripts": { "lint": "eslint --ext .js,.jsx,.ts,.tsx .", "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix", @@ -26,6 +20,13 @@ "@rocket.chat/message-parser": "next", "@rocket.chat/ui-kit": "^0.32.1" }, + "devDependencies": { + "@rocket.chat/eslint-config": "workspace:^", + "eslint": "~8.45.0", + "mongodb": "^4.17.1", + "prettier": "~2.8.8", + "typescript": "~5.2.2" + }, "volta": { "extends": "../../package.json" } diff --git a/packages/core-typings/src/IStats.ts b/packages/core-typings/src/IStats.ts index 2ea8115a727c..cd8aeb9f1762 100644 --- a/packages/core-typings/src/IStats.ts +++ b/packages/core-typings/src/IStats.ts @@ -6,7 +6,15 @@ import type { ITeamStats } from './ITeam'; export interface IStats { _id: string; - wizard: Record; + wizard: { + organizationType?: string; + industry?: string; + size?: string; + country?: string; + language?: string; + serverType?: string; + registerServer?: boolean; + }; uniqueId: string; installedAt?: string; version?: string; diff --git a/packages/core-typings/src/cloud/Announcement.ts b/packages/core-typings/src/cloud/Announcement.ts new file mode 100644 index 000000000000..3d891daf132f --- /dev/null +++ b/packages/core-typings/src/cloud/Announcement.ts @@ -0,0 +1,28 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + +import type { IRocketChatRecord } from '../IRocketChatRecord'; +import { type UiKitPayload } from '../UIKit'; + +type TargetPlatform = 'web' | 'mobile'; + +type Dictionary = { + [lng: string]: { + [key: string]: string; + }; +}; + +type Creator = 'cloud' | 'system'; + +export interface Announcement extends IRocketChatRecord { + selector?: { + roles?: string[]; + }; + platform: TargetPlatform[]; + expireAt: Date; + startAt: Date; + createdBy: Creator; + createdAt: Date; + dictionary?: Dictionary; + view: UiKitPayload; + surface: 'banner' | 'modal'; +} diff --git a/packages/core-typings/src/cloud/NpsSurveyAnnouncement.ts b/packages/core-typings/src/cloud/NpsSurveyAnnouncement.ts new file mode 100644 index 000000000000..fff1db8f1b99 --- /dev/null +++ b/packages/core-typings/src/cloud/NpsSurveyAnnouncement.ts @@ -0,0 +1,7 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + +export interface NpsSurveyAnnouncement { + id: string; + startAt: Date; + expireAt: Date; +} diff --git a/packages/core-typings/src/cloud/WorkspaceLicensePayload.ts b/packages/core-typings/src/cloud/WorkspaceLicensePayload.ts new file mode 100644 index 000000000000..7e81e1b47599 --- /dev/null +++ b/packages/core-typings/src/cloud/WorkspaceLicensePayload.ts @@ -0,0 +1,10 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + +export interface WorkspaceLicensePayload { + version: number; + address: string; + license: string; + updatedAt: Date; + modules: string; + expireAt: Date; +} diff --git a/packages/core-typings/src/cloud/WorkspaceSyncPayload.ts b/packages/core-typings/src/cloud/WorkspaceSyncPayload.ts new file mode 100644 index 000000000000..964cb42571b2 --- /dev/null +++ b/packages/core-typings/src/cloud/WorkspaceSyncPayload.ts @@ -0,0 +1,33 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + +import type { IBanner } from '../IBanner'; +import type { Announcement } from './Announcement'; +import type { NpsSurveyAnnouncement } from './NpsSurveyAnnouncement'; + +export interface WorkspaceSyncPayload { + workspaceId: string; + publicKey?: string; + announcements?: { + create: Announcement[]; + delete: Announcement['_id'][]; + }; + trial?: { + trialing: boolean; + trialID: string; + endDate: Date; + marketing: { + utmContent: string; + utmMedium: string; + utmSource: string; + utmCampaign: string; + }; + DowngradesToPlan: { + id: string; + }; + trialRequested: boolean; + }; + /** @deprecated */ + nps?: NpsSurveyAnnouncement; + /** @deprecated */ + banners?: IBanner[]; +} diff --git a/packages/core-typings/src/cloud/index.ts b/packages/core-typings/src/cloud/index.ts new file mode 100644 index 000000000000..b9c044b054e3 --- /dev/null +++ b/packages/core-typings/src/cloud/index.ts @@ -0,0 +1,4 @@ +export { Announcement } from './Announcement'; +export { NpsSurveyAnnouncement } from './NpsSurveyAnnouncement'; +export { WorkspaceLicensePayload } from './WorkspaceLicensePayload'; +export { WorkspaceSyncPayload } from './WorkspaceSyncPayload'; diff --git a/packages/core-typings/src/index.ts b/packages/core-typings/src/index.ts index 459e5680900b..de36606e7f90 100644 --- a/packages/core-typings/src/index.ts +++ b/packages/core-typings/src/index.ts @@ -134,3 +134,5 @@ export * from './ICustomOAuthConfig'; export * from './IModerationReport'; export * from './CustomFieldMetadata'; + +export * as Cloud from './cloud'; diff --git a/packages/model-typings/src/index.ts b/packages/model-typings/src/index.ts index 23e77ff1de29..a1874b144347 100644 --- a/packages/model-typings/src/index.ts +++ b/packages/model-typings/src/index.ts @@ -79,3 +79,4 @@ export * from './models/IAuditLogModel'; export * from './models/ICronHistoryModel'; export * from './models/IMigrationsModel'; export * from './models/IModerationReportsModel'; +export * from './models/ICloudAnnouncementsModel'; diff --git a/packages/model-typings/src/models/IBannersModel.ts b/packages/model-typings/src/models/IBannersModel.ts index 62f33ef5d3b2..4fe496bb954c 100644 --- a/packages/model-typings/src/models/IBannersModel.ts +++ b/packages/model-typings/src/models/IBannersModel.ts @@ -1,10 +1,10 @@ -import type { BannerPlatform, IBanner } from '@rocket.chat/core-typings'; +import type { BannerPlatform, IBanner, Optional } from '@rocket.chat/core-typings'; import type { Document, FindCursor, FindOptions, UpdateResult, InsertOneResult } from 'mongodb'; import type { IBaseModel } from './IBaseModel'; export interface IBannersModel extends IBaseModel { - create(doc: IBanner): Promise>; + create(doc: Optional): Promise>; findActiveByRoleOrId(roles: string[], platform: BannerPlatform, bannerId?: string, options?: FindOptions): FindCursor; diff --git a/packages/model-typings/src/models/ICloudAnnouncementsModel.ts b/packages/model-typings/src/models/ICloudAnnouncementsModel.ts new file mode 100644 index 000000000000..672ff8c316a0 --- /dev/null +++ b/packages/model-typings/src/models/ICloudAnnouncementsModel.ts @@ -0,0 +1,6 @@ +import type { Cloud } from '@rocket.chat/core-typings'; + +import type { IBaseModel } from './IBaseModel'; + +// eslint-disable-next-line @typescript-eslint/no-empty-interface +export interface ICloudAnnouncementsModel extends IBaseModel {} diff --git a/packages/models/src/index.ts b/packages/models/src/index.ts index e1cf91f1b0ee..1e83fe72b93e 100644 --- a/packages/models/src/index.ts +++ b/packages/models/src/index.ts @@ -78,6 +78,7 @@ import type { ICronHistoryModel, IMigrationsModel, IModerationReportsModel, + ICloudAnnouncementsModel, } from '@rocket.chat/model-typings'; import { proxify } from './proxify'; @@ -170,3 +171,4 @@ export const AuditLog = proxify('IAuditLogModel'); export const CronHistory = proxify('ICronHistoryModel'); export const Migrations = proxify('IMigrationsModel'); export const ModerationReports = proxify('IModerationReportsModel'); +export const CloudAnnouncements = proxify('ICloudAnnouncementsModel'); diff --git a/packages/rest-typings/src/v1/autotranslate/AutotranslateSaveSettingsParamsPOST.ts b/packages/rest-typings/src/v1/autotranslate/AutotranslateSaveSettingsParamsPOST.ts index 3690d0672ce2..914739d000a0 100644 --- a/packages/rest-typings/src/v1/autotranslate/AutotranslateSaveSettingsParamsPOST.ts +++ b/packages/rest-typings/src/v1/autotranslate/AutotranslateSaveSettingsParamsPOST.ts @@ -21,7 +21,7 @@ const AutotranslateSaveSettingsParamsPostSchema = { enum: ['autoTranslate', 'autoTranslateLanguage'], }, value: { - type: ['boolean', 'string'], + anyOf: [{ type: 'boolean' }, { type: 'string' }], }, defaultLanguage: { type: 'string', diff --git a/packages/rest-typings/src/v1/federation/FederationVerifyMatrixIdProps.ts b/packages/rest-typings/src/v1/federation/FederationVerifyMatrixIdProps.ts index a63d37da07ba..a6009fe20d85 100644 --- a/packages/rest-typings/src/v1/federation/FederationVerifyMatrixIdProps.ts +++ b/packages/rest-typings/src/v1/federation/FederationVerifyMatrixIdProps.ts @@ -11,7 +11,7 @@ const FederationVerifyMatrixIdPropsSchema = { properties: { matrixIds: { type: 'array', - items: [{ type: 'string' }], + items: { type: 'string' }, uniqueItems: true, }, }, diff --git a/packages/rest-typings/src/v1/moderation/ReportHistoryProps.ts b/packages/rest-typings/src/v1/moderation/ReportHistoryProps.ts index 69b1d85f22a5..48b859a7899b 100644 --- a/packages/rest-typings/src/v1/moderation/ReportHistoryProps.ts +++ b/packages/rest-typings/src/v1/moderation/ReportHistoryProps.ts @@ -10,6 +10,7 @@ type ReportHistoryProps = { export type ReportHistoryPropsGET = PaginatedRequest; const reportHistoryPropsSchema = { + type: 'object', properties: { latest: { type: 'string', diff --git a/packages/rest-typings/src/v1/omnichannel.ts b/packages/rest-typings/src/v1/omnichannel.ts index 60f6ed7ace08..31d004ba39c4 100644 --- a/packages/rest-typings/src/v1/omnichannel.ts +++ b/packages/rest-typings/src/v1/omnichannel.ts @@ -2550,6 +2550,10 @@ const GETLivechatRoomsParamsSchema = { type: 'string', nullable: true, }, + query: { + type: 'string', + nullable: true, + }, fields: { type: 'string', nullable: true, @@ -2582,12 +2586,16 @@ const GETLivechatRoomsParamsSchema = { nullable: true, }, open: { - type: ['string', 'boolean'], - nullable: true, + anyOf: [ + { type: 'string', nullable: true }, + { type: 'boolean', nullable: true }, + ], }, onhold: { - type: ['string', 'boolean'], - nullable: true, + anyOf: [ + { type: 'string', nullable: true }, + { type: 'boolean', nullable: true }, + ], }, tags: { type: 'array', @@ -3112,7 +3120,7 @@ const POSTLivechatAppearanceParamsSchema = { type: 'string', }, value: { - type: ['string', 'boolean', 'number'], + anyOf: [{ type: 'string' }, { type: 'boolean' }, { type: 'number' }], }, }, required: ['_id', 'value'], diff --git a/yarn.lock b/yarn.lock index 368d87e88f05..265f9c7ab0d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8008,7 +8008,7 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/css-in-js@npm:next, @rocket.chat/css-in-js@npm:~0.31.26-dev.19": +"@rocket.chat/css-in-js@npm:next": version: 0.31.26-dev.19 resolution: "@rocket.chat/css-in-js@npm:0.31.26-dev.19" dependencies: @@ -8021,6 +8021,15 @@ __metadata: languageName: node linkType: hard +"@rocket.chat/css-in-js@npm:~0.31.26-dev.19": + version: 0.31.26-dev.23 + resolution: "@rocket.chat/css-in-js@npm:0.31.26-dev.23" + dependencies: + "@rocket.chat/memo": ^0.31.25 + checksum: 6d71bd0f232c8ea3fc2711347064ddd14925b1c2b8713f6d7649b98679455029a53ee41d08b98d010da3ea4789afa21a15901a92efef61dee7b32d6965157445 + languageName: node + linkType: hard + "@rocket.chat/css-supports@npm:^0.31.25": version: 0.31.25 resolution: "@rocket.chat/css-supports@npm:0.31.25" @@ -8030,12 +8039,12 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/css-supports@npm:~0.31.26-dev.19": - version: 0.31.26-dev.19 - resolution: "@rocket.chat/css-supports@npm:0.31.26-dev.19" +"@rocket.chat/css-supports@npm:~0.31.26-dev.19, @rocket.chat/css-supports@npm:~0.31.26-dev.23": + version: 0.31.26-dev.23 + resolution: "@rocket.chat/css-supports@npm:0.31.26-dev.23" dependencies: - "@rocket.chat/memo": ~0.31.26-dev.19 - checksum: c689ccca04901b128c8993e7475d89ca1e49d01efac9bb9641a0a35bba4237d36da48204cd26b39e92b8d98f24ff85df40e516fd0e421beaaf7c10a8308536ea + "@rocket.chat/memo": ~0.31.26-dev.23 + checksum: a4f25562df67214b1c92c85a1cd16eb03fc2aea385f48cdde42ad0053b9e03a92ca9e3486d1387c7a31cf68f47fa888825f31acae8f4700ee2b9f03495286a12 languageName: node linkType: hard @@ -8632,13 +8641,20 @@ __metadata: languageName: node linkType: hard -"@rocket.chat/memo@npm:next, @rocket.chat/memo@npm:~0.31.26-dev.19": +"@rocket.chat/memo@npm:next": version: 0.31.26-dev.19 resolution: "@rocket.chat/memo@npm:0.31.26-dev.19" checksum: 387c29643c0d725b2e2d3b79eeebf2ed3ac2fa518178d2836913dddf48f2aa72e80b277d54c77ac0498c144324cdfd3449bae883895c316fbb43c7dbbfcb3993 languageName: node linkType: hard +"@rocket.chat/memo@npm:~0.31.26-dev.19, @rocket.chat/memo@npm:~0.31.26-dev.23": + version: 0.31.26-dev.23 + resolution: "@rocket.chat/memo@npm:0.31.26-dev.23" + checksum: 68301161d87ba25347f1d2ab85c139ba86c5fdd1101f41678808c19ba461772814f4bff048a30e4aefd08978fe2feb952c541bddc0beb6bc3cd190bd7852393b + languageName: node + linkType: hard + "@rocket.chat/message-parser@npm:next": version: 0.32.0-dev.377 resolution: "@rocket.chat/message-parser@npm:0.32.0-dev.377" @@ -8826,7 +8842,7 @@ __metadata: "@xmldom/xmldom": ^0.8.8 adm-zip: 0.5.10 ajv: ^8.11.0 - ajv-formats: ^2.1.1 + ajv-formats: ~2.1.1 apn: 2.2.0 archiver: ^3.1.1 asterisk-manager: ^0.2.0 @@ -9001,6 +9017,7 @@ __metadata: stylelint: ^14.9.1 stylelint-order: ^5.0.0 supertest: ^6.2.3 + suretype: ~2.4.1 tar-stream: ^1.6.2 template-file: ^6.0.1 textarea-caret: ^3.1.0 @@ -9521,13 +9538,13 @@ __metadata: linkType: hard "@rocket.chat/stylis-logical-props-middleware@npm:~0.31.26-dev.19": - version: 0.31.26-dev.19 - resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.26-dev.19" + version: 0.31.26-dev.23 + resolution: "@rocket.chat/stylis-logical-props-middleware@npm:0.31.26-dev.23" dependencies: - "@rocket.chat/css-supports": ~0.31.26-dev.19 + "@rocket.chat/css-supports": ~0.31.26-dev.23 peerDependencies: stylis: 4.0.10 - checksum: 893bd48b6cc320ee7a970cda019e08b00c299c51562cf74f14e925bd4f613fc0c9448de876c3aa6b651bfc060a42097ccdd5a2dee0769a9a05cfe32eaff684f3 + checksum: b2fbfad3b2f4dedd9023b30d4cdc51e76ae76faeeca5819cf697e896c02fd4bb2dde5bbc428b377d77f32011fd8cc82c6d98a84d66b93056ef981c13aee1dc67 languageName: node linkType: hard @@ -14241,7 +14258,7 @@ __metadata: languageName: node linkType: hard -"ajv-formats@npm:^2.1.1": +"ajv-formats@npm:^2.1.1, ajv-formats@npm:~2.1.1": version: 2.1.1 resolution: "ajv-formats@npm:2.1.1" dependencies: @@ -14287,7 +14304,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.1.0, ajv@npm:^6.10.0, ajv@npm:^6.10.2, ajv@npm:^6.12.2, ajv@npm:^6.12.3, ajv@npm:^6.12.4, ajv@npm:^6.12.5": +"ajv@npm:^6.1.0, ajv@npm:^6.10.0, ajv@npm:^6.10.2, ajv@npm:^6.11.0, ajv@npm:^6.12.2, ajv@npm:^6.12.3, ajv@npm:^6.12.4, ajv@npm:^6.12.5": version: 6.12.6 resolution: "ajv@npm:6.12.6" dependencies: @@ -15130,6 +15147,21 @@ __metadata: languageName: node linkType: hard +"awesome-ajv-errors@npm:^1.0.1": + version: 1.0.1 + resolution: "awesome-ajv-errors@npm:1.0.1" + dependencies: + chalk: ^4.1.0 + jsonpointer: ^4.1.0 + jsonpos: ^1.1.0 + leven: ^3.1.0 + terminal-link: ^2.1.1 + peerDependencies: + ajv: ^6 || ^7 + checksum: 1653f6dcebaf4913341e9ad5722aaa772bc1eddd623c11c58434d958c11bddc8f06f470c8ce6f04f269b45e296c4328455151e90cd0bb6892c6f1629753730d8 + languageName: node + linkType: hard + "aws-sdk@npm:^2.1363.0": version: 2.1363.0 resolution: "aws-sdk@npm:2.1363.0" @@ -17280,6 +17312,13 @@ __metadata: languageName: node linkType: hard +"code-error-fragment@npm:0.0.230": + version: 0.0.230 + resolution: "code-error-fragment@npm:0.0.230" + checksum: 6c5e800d6d70b30938cc85a2fc2c6069f028eadb58bceb65716b995ce6228c99906302f2c438ba50115fd81a1ee15dd95dc7d317b16a6c590e311ac7e50613f3 + languageName: node + linkType: hard + "code-point-at@npm:^1.0.0": version: 1.1.0 resolution: "code-point-at@npm:1.1.0" @@ -26432,6 +26471,16 @@ __metadata: languageName: node linkType: hard +"json-to-ast@npm:^2.1.0": + version: 2.1.0 + resolution: "json-to-ast@npm:2.1.0" + dependencies: + code-error-fragment: 0.0.230 + grapheme-splitter: ^1.0.4 + checksum: 1e9b051505b218573b39f3fec9054d75772413aefc2fee3e763d9033276664faa7eec26b945a71f70b9ce29685b2f13259df7dd3243e15eacf4672c62d5ba7ce + languageName: node + linkType: hard + "json5@npm:^0.5.0": version: 0.5.1 resolution: "json5@npm:0.5.1" @@ -26505,6 +26554,13 @@ __metadata: languageName: node linkType: hard +"jsonpointer@npm:^4.1.0": + version: 4.1.0 + resolution: "jsonpointer@npm:4.1.0" + checksum: ffc3e8937380989934676b339718d3213ecf5f6b7ce637b1ce5669a22f45dc61a86463e28abbe8c743d62f87ae790253c50cce0f586cb8e7623a21a7f811a444 + languageName: node + linkType: hard + "jsonpointer@npm:^5.0.0": version: 5.0.0 resolution: "jsonpointer@npm:5.0.0" @@ -26512,6 +26568,15 @@ __metadata: languageName: node linkType: hard +"jsonpos@npm:^1.1.0": + version: 1.1.0 + resolution: "jsonpos@npm:1.1.0" + dependencies: + json-to-ast: ^2.1.0 + checksum: 00a11fff623e74e1b14d10dcda2846e25ccdf0a12ade911fcbc8a75b82f4d33429c22dd57b6f7d2fd8a8eb07bc6435f2c3e412cb7ec09f2c8f63f19381742483 + languageName: node + linkType: hard + "jsonwebtoken@npm:^8.1.0, jsonwebtoken@npm:^8.5.1": version: 8.5.1 resolution: "jsonwebtoken@npm:8.5.1" @@ -28002,6 +28067,13 @@ __metadata: languageName: node linkType: hard +"meta-types@npm:^1.1.0": + version: 1.1.1 + resolution: "meta-types@npm:1.1.1" + checksum: 4dc31cf2eca16529ea8fc317e7d21cf8e88d85a64bc7894c8a00cf7395c1ac2d56d6655767c0a8ec02c80b8916555cf2968fad14629b06c5fefd00cb9b731b40 + languageName: node + linkType: hard + "meteor-blaze-tools@npm:^1.2.0, meteor-blaze-tools@npm:^1.2.4": version: 1.5.0 resolution: "meteor-blaze-tools@npm:1.5.0" @@ -34244,7 +34316,7 @@ __metadata: "@types/chart.js": ^2.9.37 "@types/js-yaml": ^4.0.5 husky: ^7.0.4 - turbo: ^1.10.13 + turbo: ~1.10.14 languageName: unknown linkType: soft @@ -36523,13 +36595,13 @@ __metadata: languageName: node linkType: hard -"supports-hyperlinks@npm:^2.2.0": - version: 2.2.0 - resolution: "supports-hyperlinks@npm:2.2.0" +"supports-hyperlinks@npm:^2.0.0, supports-hyperlinks@npm:^2.2.0": + version: 2.3.0 + resolution: "supports-hyperlinks@npm:2.3.0" dependencies: has-flag: ^4.0.0 supports-color: ^7.0.0 - checksum: aef04fb41f4a67f1bc128f7c3e88a81b6cf2794c800fccf137006efe5bafde281da3e42e72bf9206c2fcf42e6438f37e3a820a389214d0a88613ca1f2d36076a + checksum: 9ee0de3c8ce919d453511b2b1588a8205bd429d98af94a01df87411391010fe22ca463f268c84b2ce2abad019dfff8452aa02806eeb5c905a8d7ad5c4f4c52b8 languageName: node linkType: hard @@ -36540,6 +36612,17 @@ __metadata: languageName: node linkType: hard +"suretype@npm:~2.4.1": + version: 2.4.1 + resolution: "suretype@npm:2.4.1" + dependencies: + ajv: ^6.11.0 + awesome-ajv-errors: ^1.0.1 + meta-types: ^1.1.0 + checksum: f7562a8c1faa68e8daa3969e4488948eb72397eb5f9b4dbaed28c5ce1eb58e0701cca6352166834cde947662b2e30aeefb6f24d31904f773ee9bf65dd98810d1 + languageName: node + linkType: hard + "svg-arc-to-cubic-bezier@npm:^3.0.0, svg-arc-to-cubic-bezier@npm:^3.2.0": version: 3.2.0 resolution: "svg-arc-to-cubic-bezier@npm:3.2.0" @@ -36826,6 +36909,16 @@ __metadata: languageName: node linkType: hard +"terminal-link@npm:^2.1.1": + version: 2.1.1 + resolution: "terminal-link@npm:2.1.1" + dependencies: + ansi-escapes: ^4.2.1 + supports-hyperlinks: ^2.0.0 + checksum: ce3d2cd3a438c4a9453947aa664581519173ea40e77e2534d08c088ee6dda449eabdbe0a76d2a516b8b73c33262fedd10d5270ccf7576ae316e3db170ce6562f + languageName: node + linkType: hard + "terser-webpack-plugin@npm:^1.4.3": version: 1.4.5 resolution: "terser-webpack-plugin@npm:1.4.5" @@ -37638,58 +37731,58 @@ __metadata: languageName: node linkType: hard -"turbo-darwin-64@npm:1.10.13": - version: 1.10.13 - resolution: "turbo-darwin-64@npm:1.10.13" +"turbo-darwin-64@npm:1.10.14": + version: 1.10.14 + resolution: "turbo-darwin-64@npm:1.10.14" conditions: os=darwin & cpu=x64 languageName: node linkType: hard -"turbo-darwin-arm64@npm:1.10.13": - version: 1.10.13 - resolution: "turbo-darwin-arm64@npm:1.10.13" +"turbo-darwin-arm64@npm:1.10.14": + version: 1.10.14 + resolution: "turbo-darwin-arm64@npm:1.10.14" conditions: os=darwin & cpu=arm64 languageName: node linkType: hard -"turbo-linux-64@npm:1.10.13": - version: 1.10.13 - resolution: "turbo-linux-64@npm:1.10.13" +"turbo-linux-64@npm:1.10.14": + version: 1.10.14 + resolution: "turbo-linux-64@npm:1.10.14" conditions: os=linux & cpu=x64 languageName: node linkType: hard -"turbo-linux-arm64@npm:1.10.13": - version: 1.10.13 - resolution: "turbo-linux-arm64@npm:1.10.13" +"turbo-linux-arm64@npm:1.10.14": + version: 1.10.14 + resolution: "turbo-linux-arm64@npm:1.10.14" conditions: os=linux & cpu=arm64 languageName: node linkType: hard -"turbo-windows-64@npm:1.10.13": - version: 1.10.13 - resolution: "turbo-windows-64@npm:1.10.13" +"turbo-windows-64@npm:1.10.14": + version: 1.10.14 + resolution: "turbo-windows-64@npm:1.10.14" conditions: os=win32 & cpu=x64 languageName: node linkType: hard -"turbo-windows-arm64@npm:1.10.13": - version: 1.10.13 - resolution: "turbo-windows-arm64@npm:1.10.13" +"turbo-windows-arm64@npm:1.10.14": + version: 1.10.14 + resolution: "turbo-windows-arm64@npm:1.10.14" conditions: os=win32 & cpu=arm64 languageName: node linkType: hard -"turbo@npm:^1.10.13": - version: 1.10.13 - resolution: "turbo@npm:1.10.13" +"turbo@npm:~1.10.14": + version: 1.10.14 + resolution: "turbo@npm:1.10.14" dependencies: - turbo-darwin-64: 1.10.13 - turbo-darwin-arm64: 1.10.13 - turbo-linux-64: 1.10.13 - turbo-linux-arm64: 1.10.13 - turbo-windows-64: 1.10.13 - turbo-windows-arm64: 1.10.13 + turbo-darwin-64: 1.10.14 + turbo-darwin-arm64: 1.10.14 + turbo-linux-64: 1.10.14 + turbo-linux-arm64: 1.10.14 + turbo-windows-64: 1.10.14 + turbo-windows-arm64: 1.10.14 dependenciesMeta: turbo-darwin-64: optional: true @@ -37705,7 +37798,7 @@ __metadata: optional: true bin: turbo: bin/turbo - checksum: 0c000c671534c8c80270c6d1fc77646df0e44164c0db561a85b3fefadd4bda6d5920626d067abb09af38613024e3984fb8d8bc5be922dae6236eda6aab9447a2 + checksum: 219d245bb5cc32a9f76b136b81e86e179228d93a44cab4df3e3d487a55dd2688b5b85f4d585b66568ac53166145352399dd2d7ed0cd47f1aae63d08beb814ebb languageName: node linkType: hard From b4a0f1fc680e559b49a84f61d40c626fba0cbfa7 Mon Sep 17 00:00:00 2001 From: janainaCoelhoRocketchat <105796517+janainaCoelhoRocketchat@users.noreply.github.com> Date: Mon, 2 Oct 2023 09:15:57 -0300 Subject: [PATCH 218/275] test: adding missing verifications on threads (#30528) --- apps/meteor/tests/e2e/threads.spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/apps/meteor/tests/e2e/threads.spec.ts b/apps/meteor/tests/e2e/threads.spec.ts index 6d6b8ee6f122..d9e181d2706b 100644 --- a/apps/meteor/tests/e2e/threads.spec.ts +++ b/apps/meteor/tests/e2e/threads.spec.ts @@ -104,6 +104,7 @@ test.describe.serial('Threads', () => { await page.locator('[data-qa-id="edit-message"]').click(); await page.locator('[name="msg"]').last().fill('this message was edited'); await page.keyboard.press('Enter'); + await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('this message was edited'); }); test('expect quote the thread message', async ({ page }) => { @@ -118,6 +119,9 @@ test.describe.serial('Threads', () => { test('expect star the thread message', async ({ page }) => { await poHomeChannel.content.openLastThreadMessageMenu(); await page.locator('[data-qa-id="star-message"]').click(); + await page.getByRole('button').and(page.getByTitle('Options')).click(); + await page.locator('[data-key="starred-messages"]').click(); + await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('this is a message for reply'); }); test('expect copy the message', async ({ page }) => { From 2f74b2c99a3bfcdb76f9b07e7e0b8b6749e93264 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Mon, 2 Oct 2023 09:24:54 -0300 Subject: [PATCH 219/275] test: refactor API E2E tests for groups endpoints (#30523) --- apps/meteor/tests/end-to-end/api/03-groups.js | 1343 +++++++++-------- 1 file changed, 732 insertions(+), 611 deletions(-) diff --git a/apps/meteor/tests/end-to-end/api/03-groups.js b/apps/meteor/tests/end-to-end/api/03-groups.js index cccc3eb27738..e875be80fd3b 100644 --- a/apps/meteor/tests/end-to-end/api/03-groups.js +++ b/apps/meteor/tests/end-to-end/api/03-groups.js @@ -29,8 +29,8 @@ describe('[Groups]', function () { before((done) => getCredentials(done)); - before('/groups.create', (done) => { - request + before(async () => { + await request .post(api('groups.create')) .set(credentials) .send({ @@ -46,10 +46,21 @@ describe('[Groups]', function () { expect(res.body).to.have.nested.property('group.msgs', 0); group._id = res.body.group._id; group.name = res.body.group.name; + }); + }); + + after(async () => { + await request + .post(api('groups.delete')) + .set(credentials) + .send({ + roomId: group._id, }) - .end(done); + .expect('Content-Type', 'application/json') + .expect(200); }); - describe('[/groups.create]', () => { + + describe('/groups.create', () => { let guestUser; let room; @@ -60,80 +71,89 @@ describe('[Groups]', function () { await deleteUser(guestUser); }); - it('should not add guest users to more rooms than defined in the license', async function () { - // TODO this is not the right way to do it. We're doing this way for now just because we have separate CI jobs for EE and CE, - // ideally we should have a single CI job that adds a license and runs both CE and EE tests. - if (!process.env.IS_EE) { - this.skip(); - } - const promises = []; + describe('guest users', () => { + it('should not add guest users to more rooms than defined in the license', async function () { + // TODO this is not the right way to do it. We're doing this way for now just because we have separate CI jobs for EE and CE, + // ideally we should have a single CI job that adds a license and runs both CE and EE tests. + if (!process.env.IS_EE) { + this.skip(); + } + const promises = []; + + for (let i = 0; i < maxRoomsPerGuest; i++) { + promises.push( + createRoom({ + type: 'p', + name: `channel.test.${Date.now()}-${Math.random()}`, + members: [guestUser.username], + }), + ); + } + await Promise.all(promises); - for (let i = 0; i < maxRoomsPerGuest; i++) { - promises.push( - createRoom({ - type: 'p', + await request + .post(api('groups.create')) + .set(credentials) + .send({ name: `channel.test.${Date.now()}-${Math.random()}`, members: [guestUser.username], - }), - ); - } - await Promise.all(promises); + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + room = res.body.group; + }); - request - .post(api('groups.create')) - .set(credentials) - .send({ - name: `channel.test.${Date.now()}-${Math.random()}`, - members: [guestUser.username], - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - room = res.body.group; - }) - .then(() => { - request - .get(api('groups.members')) - .set(credentials) - .query({ - roomId: 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('members').and.to.be.an('array'); - expect(res.body.members).to.have.lengthOf(1); - }); - }); + await request + .get(api('groups.members')) + .set(credentials) + .query({ + roomId: 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('members').and.to.be.an('array'); + expect(res.body.members).to.have.lengthOf(1); + }); + }); }); - }); - describe('/groups.create (encrypted)', () => { - it('should create a new encrypted group', async () => { - await request - .post(api('groups.create')) - .set(credentials) - .send({ - name: `encrypted-${apiPrivateChannelName}`, - extraData: { - encrypted: 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('group.name', `encrypted-${apiPrivateChannelName}`); - expect(res.body).to.have.nested.property('group.t', 'p'); - expect(res.body).to.have.nested.property('group.msgs', 0); - expect(res.body).to.have.nested.property('group.encrypted', true); - }); + + describe('validate E2E rooms', () => { + it('should create a new encrypted group', async () => { + await request + .post(api('groups.create')) + .set(credentials) + .send({ + name: `encrypted-${apiPrivateChannelName}`, + extraData: { + encrypted: 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('group.name', `encrypted-${apiPrivateChannelName}`); + expect(res.body).to.have.nested.property('group.t', 'p'); + expect(res.body).to.have.nested.property('group.msgs', 0); + expect(res.body).to.have.nested.property('group.encrypted', true); + }); + }); }); - it('should create the encrypted room by default', async () => { - await updateSetting('E2E_Enabled_Default_PrivateRooms', true); - try { + describe('E2E enabled by default', () => { + before(async () => { + await Promise.all([updateSetting('E2E_Enable', true), updateSetting('E2E_Enabled_Default_PrivateRooms', true)]); + }); + + after(async () => { + await Promise.all([updateSetting('E2E_Enable', false), updateSetting('E2E_Enabled_Default_PrivateRooms', false)]); + }); + + it('should create the encrypted room by default', async () => { await request .post(api('groups.create')) .set(credentials) @@ -149,30 +169,43 @@ describe('[Groups]', function () { expect(res.body).to.have.nested.property('group.msgs', 0); expect(res.body).to.have.nested.property('group.encrypted', true); }); - } finally { - await updateSetting('E2E_Enabled_Default_PrivateRooms', false); - } + }); }); }); - describe('[/groups.info]', () => { + + describe('/groups.info', () => { let testGroup = {}; let groupMessage = {}; - it('creating new group...', (done) => { - request + + const newGroupInfoName = `info-private-channel-test-${Date.now()}`; + + before('creating new group...', async () => { + await request .post(api('groups.create')) .set(credentials) .send({ - name: apiPrivateChannelName, + name: newGroupInfoName, }) .expect('Content-Type', 'application/json') .expect(200) .expect((res) => { testGroup = res.body.group; + }); + }); + + after('deleting group...', async () => { + await request + .post(api('groups.delete')) + .set(credentials) + .send({ + roomName: newGroupInfoName, }) - .end(done); + .expect('Content-Type', 'application/json') + .expect(200); }); - it('should return group basic structure', (done) => { - request + + it('should return group basic structure', async () => { + await request .get(api('groups.info')) .set(credentials) .query({ @@ -183,14 +216,14 @@ describe('[Groups]', function () { .expect((res) => { expect(res.body).to.have.property('success', true); expect(res.body).to.have.nested.property('group._id'); - expect(res.body).to.have.nested.property('group.name', apiPrivateChannelName); + expect(res.body).to.have.nested.property('group.name', newGroupInfoName); expect(res.body).to.have.nested.property('group.t', 'p'); expect(res.body).to.have.nested.property('group.msgs', 0); - }) - .end(done); + }); }); - it('sending a message...', (done) => { - request + + it('sending a message...', async () => { + await request .post(api('chat.sendMessage')) .set(credentials) .send({ @@ -204,11 +237,11 @@ describe('[Groups]', function () { .expect((res) => { expect(res.body).to.have.property('success', true); groupMessage = res.body.message; - }) - .end(done); + }); }); - it('REACTing with last message', (done) => { - request + + it('REACTing with last message', async () => { + await request .post(api('chat.react')) .set(credentials) .send({ @@ -219,11 +252,11 @@ describe('[Groups]', function () { .expect(200) .expect((res) => { expect(res.body).to.have.property('success', true); - }) - .end(done); + }); }); - it('STARring last message', (done) => { - request + + it('STARring last message', async () => { + await request .post(api('chat.starMessage')) .set(credentials) .send({ @@ -233,11 +266,11 @@ describe('[Groups]', function () { .expect(200) .expect((res) => { expect(res.body).to.have.property('success', true); - }) - .end(done); + }); }); - it('PINning last message', (done) => { - request + + it('PINning last message', async () => { + await request .post(api('chat.pinMessage')) .set(credentials) .send({ @@ -247,11 +280,11 @@ describe('[Groups]', function () { .expect(200) .expect((res) => { expect(res.body).to.have.property('success', true); - }) - .end(done); + }); }); - it('should return group structure with "lastMessage" object including pin, reaction and star(should be an array) infos', (done) => { - request + + it('should return group structure with "lastMessage" object including pin, reaction and star(should be an array) infos', async () => { + await request .get(api('groups.info')) .set(credentials) .query({ @@ -269,11 +302,10 @@ describe('[Groups]', function () { expect(group.lastMessage).to.have.property('pinnedAt').and.to.be.a('string'); expect(group.lastMessage).to.have.property('pinnedBy').and.to.be.an('object'); expect(group.lastMessage).to.have.property('starred').and.to.be.an('array'); - }) - .end(done); + }); }); - it('should return all groups messages where the last message of array should have the "star" array with USERS star ONLY', (done) => { - request + it('should return all groups messages where the last message of array should have the "star" array with USERS star ONLY', async () => { + await request .get(api('groups.messages')) .set(credentials) .query({ @@ -288,11 +320,11 @@ describe('[Groups]', function () { const lastMessage = messages.filter((message) => message._id === groupMessage._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 groups 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 + + it('should return all groups messages where the last message of array should have the "star" array with USERS star ONLY even requested with count and offset params', async () => { + await request .get(api('groups.messages')) .set(credentials) .query({ @@ -309,178 +341,161 @@ describe('[Groups]', function () { const lastMessage = messages.filter((message) => message._id === groupMessage._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('/groups.invite', async () => { - const roomInfo = await getRoomInfo(group._id); - return request - .post(api('groups.invite')) - .set(credentials) - .send({ - roomId: group._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('group._id'); - expect(res.body).to.have.nested.property('group.name', apiPrivateChannelName); - expect(res.body).to.have.nested.property('group.t', 'p'); - expect(res.body).to.have.nested.property('group.msgs', roomInfo.group.msgs + 1); - }); - }); + describe('/groups.invite', async () => { + let roomInfo = {}; - it('/groups.addModerator', (done) => { - request - .post(api('groups.addModerator')) - .set(credentials) - .send({ - roomId: group._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); + before(async () => { + roomInfo = await getRoomInfo(group._id); + }); - it('/groups.removeModerator', (done) => { - request - .post(api('groups.removeModerator')) - .set(credentials) - .send({ - roomId: group._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); + it('should invite user to group', async () => { + await request + .post(api('groups.invite')) + .set(credentials) + .send({ + roomId: group._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('group._id'); + expect(res.body).to.have.nested.property('group.name', apiPrivateChannelName); + expect(res.body).to.have.nested.property('group.t', 'p'); + expect(res.body).to.have.nested.property('group.msgs', roomInfo.group.msgs + 1); + }); + }); }); - it('/groups.addOwner', (done) => { - request - .post(api('groups.addOwner')) - .set(credentials) - .send({ - roomId: group._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); + describe('/groups.addModerator', () => { + it('should make user a moderator', (done) => { + request + .post(api('groups.addModerator')) + .set(credentials) + .send({ + roomId: group._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); }); - it('/groups.removeOwner', (done) => { - request - .post(api('groups.removeOwner')) - .set(credentials) - .send({ - roomId: group._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); + describe('/groups.removeModerator', () => { + it('should remove user from moderator', (done) => { + request + .post(api('groups.removeModerator')) + .set(credentials) + .send({ + roomId: group._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); }); - it('/groups.addLeader', (done) => { - request - .post(api('groups.addLeader')) - .set(credentials) - .send({ - roomId: group._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.a.property('success', true); - }) - .end(done); + describe('/groups.addOwner', () => { + it('should add user as owner', (done) => { + request + .post(api('groups.addOwner')) + .set(credentials) + .send({ + roomId: group._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); }); - it('/groups.removeLeader', (done) => { - request - .post(api('groups.removeLeader')) - .set(credentials) - .send({ - roomId: group._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); + describe('/groups.removeOwner', () => { + it('should remove user from owner', (done) => { + request + .post(api('groups.removeOwner')) + .set(credentials) + .send({ + roomId: group._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); }); - it('/groups.kick', (done) => { - request - .post(api('groups.kick')) - .set(credentials) - .send({ - roomId: group._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); + describe('/groups.addLeader', () => { + it('should add user as leader', (done) => { + request + .post(api('groups.addLeader')) + .set(credentials) + .send({ + roomId: group._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('/groups.invite', async () => { - const roomInfo = await getRoomInfo(group._id); - - return request - .post(api('groups.invite')) - .set(credentials) - .send({ - roomId: group._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('group._id'); - expect(res.body).to.have.nested.property('group.name', apiPrivateChannelName); - expect(res.body).to.have.nested.property('group.t', 'p'); - expect(res.body).to.have.nested.property('group.msgs', roomInfo.group.msgs + 1); - }); + describe('/groups.removeLeader', () => { + it('should remove user from leader', (done) => { + request + .post(api('groups.removeLeader')) + .set(credentials) + .send({ + roomId: group._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); }); - it('/groups.addOwner', (done) => { - request - .post(api('groups.addOwner')) - .set(credentials) - .send({ - roomId: group._id, - userId: 'rocket.cat', - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); + describe('/groups.kick', () => { + it('should remove user from group', (done) => { + request + .post(api('groups.kick')) + .set(credentials) + .send({ + roomId: group._id, + userId: 'rocket.cat', + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); }); describe('/groups.setDescription', () => { @@ -623,114 +638,124 @@ describe('[Groups]', function () { }); }); - it('/groups.archive', (done) => { - request - .post(api('groups.archive')) - .set(credentials) - .send({ - roomId: group._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); + describe('/groups.archive', () => { + it('should archive the group', (done) => { + request + .post(api('groups.archive')) + .set(credentials) + .send({ + roomId: group._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); }); - it('/groups.unarchive', (done) => { - request - .post(api('groups.unarchive')) - .set(credentials) - .send({ - roomId: group._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); + describe('/groups.unarchive', () => { + it('should unarchive the group', (done) => { + request + .post(api('groups.unarchive')) + .set(credentials) + .send({ + roomId: group._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); }); - it('/groups.close', (done) => { - request - .post(api('groups.close')) - .set(credentials) - .send({ - roomId: group._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); - }); + describe('/groups.close', () => { + it('should close the group', (done) => { + request + .post(api('groups.close')) + .set(credentials) + .send({ + roomId: group._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); - it('/groups.close', (done) => { - request - .post(api('groups.close')) - .set(credentials) - .send({ - roomName: apiPrivateChannelName, - }) - .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 private group, ${apiPrivateChannelName}, is already closed to the sender`); - }) - .end(done); + it('should return an error when trying to close a private group that is already closed', (done) => { + request + .post(api('groups.close')) + .set(credentials) + .send({ + roomName: apiPrivateChannelName, + }) + .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 private group, ${apiPrivateChannelName}, is already closed to the sender`); + }) + .end(done); + }); }); - it('/groups.open', (done) => { - request - .post(api('groups.open')) - .set(credentials) - .send({ - roomId: group._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); + describe('/groups.open', () => { + it('should open the group', (done) => { + request + .post(api('groups.open')) + .set(credentials) + .send({ + roomId: group._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); }); - it('/groups.list', (done) => { - request - .get(api('groups.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('groups').and.to.be.an('array'); - }) - .end(done); - }); + describe('/groups.list', () => { + it('should list the groups the caller is part of', (done) => { + request + .get(api('groups.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('groups').and.to.be.an('array'); + }) + .end(done); + }); - it('/groups.list should return a list of zero length if not a member of any group', async () => { - const user = await createUser(); - const newCreds = await login(user.username, password); - request - .get(api('groups.list')) - .set(newCreds) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.property('count').and.to.equal(0); - expect(res.body).to.have.property('total').and.to.equal(0); - expect(res.body).to.have.property('groups').and.to.be.an('array').and.that.has.lengthOf(0); - }); + it('should return a list of zero length if not a member of any group', async () => { + const user = await createUser(); + const newCreds = await login(user.username, password); + await request + .get(api('groups.list')) + .set(newCreds) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.property('count').and.to.equal(0); + expect(res.body).to.have.property('total').and.to.equal(0); + expect(res.body).to.have.property('groups').and.to.be.an('array').and.that.has.lengthOf(0); + }); + }); }); - describe('[/groups.online]', () => { + describe('/groups.online', () => { const createUserAndChannel = async (setAsOnline = true) => { const testUser = await createUser(); const testUserCredentials = await login(testUser.username, password); @@ -812,7 +837,7 @@ describe('[Groups]', function () { const { room } = await createUserAndChannel(); - return request + await request .get(api('groups.online')) .set(outsiderCredentials) .query(`query={"_id": "${room._id}"}`) @@ -823,6 +848,7 @@ describe('[Groups]', function () { }); }); }); + describe('/groups.members', () => { it('should return group members when searching by roomId', (done) => { request @@ -864,7 +890,7 @@ describe('[Groups]', function () { }); }); - describe('[/groups.files]', async () => { + describe('/groups.files', async () => { await testFileUploads('groups.files', group); }); @@ -899,192 +925,204 @@ describe('[Groups]', function () { }); }); - it('/groups.counters', (done) => { - request - .get(api('groups.counters')) - .set(credentials) - .query({ - roomId: group._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('/groups.counters', () => { + it('should return group counters', (done) => { + request + .get(api('groups.counters')) + .set(credentials) + .query({ + roomId: group._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); + }); }); - it('/groups.rename', async () => { - const roomInfo = await getRoomInfo(group._id); + describe('/groups.rename', async () => { + let roomInfo; + before(async () => { + roomInfo = await getRoomInfo(group._id); + }); - return request - .post(api('groups.rename')) - .set(credentials) - .send({ - roomId: group._id, - name: `EDITED${apiPrivateChannelName}`, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - expect(res.body).to.have.nested.property('group._id'); - expect(res.body).to.have.nested.property('group.name', `EDITED${apiPrivateChannelName}`); - expect(res.body).to.have.nested.property('group.t', 'p'); - expect(res.body).to.have.nested.property('group.msgs', roomInfo.group.msgs + 1); - }); + it('should return the group rename with an additional message', async () => { + await request + .post(api('groups.rename')) + .set(credentials) + .send({ + roomId: group._id, + name: `EDITED${apiPrivateChannelName}`, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('group._id'); + expect(res.body).to.have.nested.property('group.name', `EDITED${apiPrivateChannelName}`); + expect(res.body).to.have.nested.property('group.t', 'p'); + expect(res.body).to.have.nested.property('group.msgs', roomInfo.group.msgs + 1); + }); + }); }); describe('/groups.getIntegrations', () => { let integrationCreatedByAnUser; - let userCredentials; let createdGroup; - before((done) => { - createRoom({ name: `test-integration-group-${Date.now()}`, type: 'p' }).end((err, res) => { - createdGroup = res.body.group; - 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, - overrideDestinationChannelEnabled: true, - channel: `#${createdGroup.name}`, - }, - userCredentials, - ).then((integration) => { - integrationCreatedByAnUser = integration; - done(); - }); - }); - }); - }); - }); - }); + + before(async () => { + const resRoom = await createRoom({ name: `test-integration-group-${Date.now()}`, type: 'p' }); + + createdGroup = resRoom.body.group; + + const user = await createUser(); + + const userCredentials = await login(user.username, password); + + await Promise.all([ + updatePermission('manage-incoming-integrations', ['user']), + updatePermission('manage-own-incoming-integrations', ['user']), + ]); + + integrationCreatedByAnUser = await createIntegration( + { + type: 'webhook-incoming', + name: 'Incoming test', + enabled: true, + alias: 'test', + username: 'rocket.cat', + scriptEnabled: false, + overrideDestinationChannelEnabled: true, + channel: `#${createdGroup.name}`, + }, + userCredentials, + ); }); - after((done) => { - removeIntegration(integrationCreatedByAnUser._id, 'incoming').then(done); + after(async () => { + await removeIntegration(integrationCreatedByAnUser._id, 'incoming'); + + await Promise.all([ + updatePermission('manage-incoming-integrations', ['admin']), + updatePermission('manage-outgoing-integrations', ['admin']), + updatePermission('manage-own-incoming-integrations', ['admin']), + updatePermission('manage-own-outgoing-integrations', ['admin']), + ]); }); - it('should return the list of integrations of create group 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('groups.getIntegrations')) - .set(credentials) - .query({ - roomId: createdGroup._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 of create group and it should contain the integration created by user when the admin DOES have the permission', async () => { + await updatePermission('manage-incoming-integrations', ['admin']); + + await request + .get(api('groups.getIntegrations')) + .set(credentials) + .query({ + roomId: createdGroup._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'); + }); }); - 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('groups.getIntegrations')) - .set(credentials) - .query({ - roomId: createdGroup._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 the list of integrations created by the user only', async () => { + await Promise.all([ + updatePermission('manage-own-incoming-integrations', ['admin']), + updatePermission('manage-incoming-integrations', []), + ]); + + await request + .get(api('groups.getIntegrations')) + .set(credentials) + .query({ + roomId: createdGroup._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'); }); - }); }); - 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('groups.getIntegrations')) - .set(credentials) - .query({ - roomId: createdGroup._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('should return unauthorized error when the user does not have any integrations permissions', async () => { + await Promise.all([ + updatePermission('manage-incoming-integrations', []), + updatePermission('manage-outgoing-integrations', []), + updatePermission('manage-own-incoming-integrations', []), + updatePermission('manage-own-outgoing-integrations', []), + ]); + + await request + .get(api('groups.getIntegrations')) + .set(credentials) + .query({ + roomId: createdGroup._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'); }); - }); }); }); - it('/groups.setReadOnly', (done) => { - request - .post(api('groups.setReadOnly')) - .set(credentials) - .send({ - roomId: group._id, - readOnly: true, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); + describe('/groups.setReadOnly', () => { + it('should set the group as read only', (done) => { + request + .post(api('groups.setReadOnly')) + .set(credentials) + .send({ + roomId: group._id, + readOnly: true, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); }); - it.skip('/groups.leave', (done) => { - request - .post(api('groups.leave')) - .set(credentials) - .send({ - roomId: group._id, - }) - .expect('Content-Type', 'application/json') - .expect(200) - .expect((res) => { - expect(res.body).to.have.property('success', true); - }) - .end(done); + describe.skip('/groups.leave', () => { + it('should allow the user to leave the group', (done) => { + request + .post(api('groups.leave')) + .set(credentials) + .send({ + roomId: group._id, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + }) + .end(done); + }); }); describe('/groups.setAnnouncement', () => { @@ -1123,39 +1161,101 @@ describe('[Groups]', function () { }); describe('/groups.setType', () => { - it('should change the type of the group to a channel', (done) => { - request + let roomTypeId; + + before(async () => { + await request + .post(api('groups.create')) + .set(credentials) + .send({ + name: `channel.type.${Date.now()}`, + }) + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { + expect(res.body).to.have.property('success', true); + + roomTypeId = res.body.group._id; + }); + }); + + after(async () => { + await request + .post(api('channels.delete')) + .set(credentials) + .send({ + roomId: roomTypeId, + }) + .expect('Content-Type', 'application/json') + .expect(200); + }); + + it('should change the type of the group to a channel', async () => { + await request .post(api('groups.setType')) .set(credentials) .send({ - roomId: group._id, + roomId: roomTypeId, type: 'c', }) .expect('Content-Type', 'application/json') .expect(200) .expect((res) => { expect(res.body).to.have.property('success', true); - }) - .end(done); + expect(res.body).to.have.nested.property('group.t', 'c'); + }); }); }); - describe('/groups.setCustomFields:', () => { + describe('/groups.setCustomFields', () => { let cfchannel; - it('create group with customFields', (done) => { + let groupWithoutCustomFields; + + before('create group with customFields', async () => { const customFields = { field0: 'value0' }; - request + + await request .post(api('groups.create')) .set(credentials) .send({ name: `channel.cf.${Date.now()}`, customFields, }) - .end((err, res) => { + .expect((res) => { cfchannel = res.body.group; - done(); }); + + await request + .post(api('groups.create')) + .set(credentials) + .send({ + name: `channel.cf.${Date.now()}`, + }) + .expect((res) => { + groupWithoutCustomFields = res.body.group; + }); + }); + + after('delete group with customFields', async () => { + await request + .post(api('groups.delete')) + .set(credentials) + .send({ + roomName: cfchannel.name, + }) + .expect('Content-Type', 'application/json') + .expect(200); + + await request + .post(api('groups.delete')) + .set(credentials) + .send({ + roomName: groupWithoutCustomFields.name, + }) + .expect('Content-Type', 'application/json') + .expect(200); }); + it('get customFields using groups.info', (done) => { request .get(api('groups.info')) @@ -1173,7 +1273,7 @@ describe('[Groups]', function () { }); it('change customFields', async () => { const customFields = { field9: 'value9' }; - return request + await request .post(api('groups.setCustomFields')) .set(credentials) .send({ @@ -1206,39 +1306,14 @@ describe('[Groups]', function () { }) .end(done); }); - it('delete group with customFields', (done) => { - request - .post(api('groups.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 group without customFields', (done) => { - request - .post(api('groups.create')) - .set(credentials) - .send({ - name: `channel.cf.${Date.now()}`, - }) - .end((err, res) => { - cfchannel = res.body.group; - done(); - }); - }); + it('set customFields with one nested field', async () => { const customFields = { field1: 'value1' }; - return request + await request .post(api('groups.setCustomFields')) .set(credentials) .send({ - roomId: cfchannel._id, + roomId: groupWithoutCustomFields._id, customFields, }) .expect('Content-Type', 'application/json') @@ -1246,7 +1321,7 @@ describe('[Groups]', function () { .expect((res) => { expect(res.body).to.have.property('success', true); expect(res.body).to.have.nested.property('group._id'); - expect(res.body).to.have.nested.property('group.name', cfchannel.name); + expect(res.body).to.have.nested.property('group.name', groupWithoutCustomFields.name); expect(res.body).to.have.nested.property('group.t', 'p'); expect(res.body).to.have.nested.property('group.customFields.field1', 'value1'); }); @@ -1254,11 +1329,11 @@ describe('[Groups]', function () { it('set customFields with multiple nested fields', async () => { const customFields = { field2: 'value2', field3: 'value3', field4: 'value4' }; - return request + await request .post(api('groups.setCustomFields')) .set(credentials) .send({ - roomName: cfchannel.name, + roomName: groupWithoutCustomFields.name, customFields, }) .expect('Content-Type', 'application/json') @@ -1266,7 +1341,7 @@ describe('[Groups]', function () { .expect((res) => { expect(res.body).to.have.property('success', true); expect(res.body).to.have.nested.property('group._id'); - expect(res.body).to.have.nested.property('group.name', cfchannel.name); + expect(res.body).to.have.nested.property('group.name', groupWithoutCustomFields.name); expect(res.body).to.have.nested.property('group.t', 'p'); expect(res.body).to.have.nested.property('group.customFields.field2', 'value2'); expect(res.body).to.have.nested.property('group.customFields.field3', 'value3'); @@ -1277,11 +1352,11 @@ describe('[Groups]', function () { it('set customFields to empty object', async () => { const customFields = {}; - return request + await request .post(api('groups.setCustomFields')) .set(credentials) .send({ - roomName: cfchannel.name, + roomName: groupWithoutCustomFields.name, customFields, }) .expect('Content-Type', 'application/json') @@ -1289,7 +1364,7 @@ describe('[Groups]', function () { .expect((res) => { expect(res.body).to.have.property('success', true); expect(res.body).to.have.nested.property('group._id'); - expect(res.body).to.have.nested.property('group.name', cfchannel.name); + expect(res.body).to.have.nested.property('group.name', groupWithoutCustomFields.name); expect(res.body).to.have.nested.property('group.t', 'p'); expect(res.body).to.have.not.nested.property('group.customFields.field2', 'value2'); expect(res.body).to.have.not.nested.property('group.customFields.field3', 'value3'); @@ -1303,7 +1378,7 @@ describe('[Groups]', function () { .post(api('groups.setCustomFields')) .set(credentials) .send({ - roomName: cfchannel.name, + roomName: groupWithoutCustomFields.name, customFields, }) .expect('Content-Type', 'application/json') @@ -1313,37 +1388,25 @@ describe('[Groups]', function () { }) .end(done); }); - it('delete group with empty customFields', (done) => { - request - .post(api('groups.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); - }); }); describe('/groups.delete', () => { let testGroup; - it('/groups.create', (done) => { - request + before(async () => { + await request .post(api('groups.create')) .set(credentials) .send({ name: `group.test.${Date.now()}`, }) - .end((err, res) => { + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { testGroup = res.body.group; - done(); }); }); - it('/groups.delete', (done) => { + + it('should delete group', (done) => { request .post(api('groups.delete')) .set(credentials) @@ -1357,7 +1420,8 @@ describe('[Groups]', function () { }) .end(done); }); - it('/groups.info', (done) => { + + it('should return group not found', (done) => { request .get(api('groups.info')) .set(credentials) @@ -1376,18 +1440,31 @@ describe('[Groups]', function () { describe('/groups.roles', () => { let testGroup; - it('/groups.create', (done) => { - request + before(async () => { + await request .post(api('groups.create')) .set(credentials) .send({ name: `group.roles.test.${Date.now()}`, }) - .end((err, res) => { + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { testGroup = res.body.group; - done(); }); }); + + after(async () => { + await request + .post(api('groups.delete')) + .set(credentials) + .send({ + roomName: testGroup.name, + }) + .expect('Content-Type', 'application/json') + .expect(200); + }); + it('/groups.invite', (done) => { request .post(api('groups.invite')) @@ -1451,18 +1528,31 @@ describe('[Groups]', function () { describe('/groups.moderators', () => { let testGroup; - it('/groups.create', (done) => { - request + before(async () => { + await request .post(api('groups.create')) .set(credentials) .send({ name: `group.roles.test.${Date.now()}`, }) - .end((err, res) => { + .expect('Content-Type', 'application/json') + .expect(200) + .expect((res) => { testGroup = res.body.group; - done(); }); }); + + after(async () => { + await request + .post(api('groups.delete')) + .set(credentials) + .send({ + roomName: testGroup.name, + }) + .expect('Content-Type', 'application/json') + .expect(200); + }); + it('/groups.invite', (done) => { request .post(api('groups.invite')) @@ -1503,17 +1593,35 @@ describe('[Groups]', function () { describe('/groups.setEncrypted', () => { let testGroup; - it('/groups.create', (done) => { - request + + before(async () => { + await request .post(api('groups.create')) .set(credentials) .send({ name: `group.encrypted.test.${Date.now()}`, }) - .end((err, res) => { + .expect((res) => { + expect(res.body).to.have.property('success', true); + expect(res.body).to.have.nested.property('group._id'); + testGroup = res.body.group; - done(); }); + + await updateSetting('E2E_Enable', true); + }); + + after(async () => { + await updateSetting('E2E_Enable', false); + + await request + .post(api('groups.delete')) + .set(credentials) + .send({ + roomName: testGroup.name, + }) + .expect('Content-Type', 'application/json') + .expect(200); }); it('should return an error when passing no boolean param', (done) => { @@ -1584,16 +1692,28 @@ describe('[Groups]', function () { }); describe('/groups.convertToTeam', () => { - before((done) => { - request + let newGroup; + + before(async () => { + await request .post(api('groups.create')) .set(credentials) .send({ name: `group-${Date.now()}` }) .expect(200) .expect((response) => { - this.newGroup = response.body.group; + newGroup = response.body.group; + }); + }); + + after(async () => { + await request + .post(api('groups.delete')) + .set(credentials) + .send({ + roomName: newGroup.name, }) - .then(() => done()); + .expect('Content-Type', 'application/json') + .expect(200); }); it('should fail to convert group if lacking edit-room permission', (done) => { @@ -1602,7 +1722,7 @@ describe('[Groups]', function () { request .post(api('groups.convertToTeam')) .set(credentials) - .send({ roomId: this.newGroup._id }) + .send({ roomId: newGroup._id }) .expect(403) .expect((res) => { expect(res.body).to.have.a.property('success', false); @@ -1618,7 +1738,7 @@ describe('[Groups]', function () { request .post(api('groups.convertToTeam')) .set(credentials) - .send({ roomId: this.newGroup._id }) + .send({ roomId: newGroup._id }) .expect(403) .expect((res) => { expect(res.body).to.have.a.property('success', false); @@ -1634,7 +1754,7 @@ describe('[Groups]', function () { request .post(api('groups.convertToTeam')) .set(credentials) - .send({ roomId: this.newGroup._id }) + .send({ roomId: newGroup._id }) .expect(200) .expect((res) => { expect(res.body).to.have.a.property('success', true); @@ -1652,7 +1772,7 @@ describe('[Groups]', function () { request .post(api('groups.convertToTeam')) .set(credentials) - .send({ roomId: this.newGroup._id }) + .send({ roomId: newGroup._id }) .expect(400) .expect((res) => { expect(res.body).to.have.a.property('success', false); @@ -1693,6 +1813,7 @@ describe('[Groups]', function () { expect(res.body).to.have.property('success', true); }); }); + after(async () => { await updateSetting('UI_Use_Real_Name', false); From b252d69909bc899507ee201407cb3c44d7c2d969 Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Mon, 2 Oct 2023 11:12:36 -0300 Subject: [PATCH 220/275] refactor: Oembed backend (#30228) --- apps/meteor/app/oembed/server/providers.ts | 56 ++---- apps/meteor/app/oembed/server/server.ts | 191 +++++++++------------ apps/meteor/lib/callbacks.ts | 20 +-- packages/core-typings/src/IOembed.ts | 9 +- 4 files changed, 107 insertions(+), 169 deletions(-) diff --git a/apps/meteor/app/oembed/server/providers.ts b/apps/meteor/app/oembed/server/providers.ts index e80e456c679b..d2d0f85d19ce 100644 --- a/apps/meteor/app/oembed/server/providers.ts +++ b/apps/meteor/app/oembed/server/providers.ts @@ -1,9 +1,5 @@ -import QueryString from 'querystring'; -import URL from 'url'; - -import type { OEmbedMeta, OEmbedUrlContent, ParsedUrl, OEmbedProvider } from '@rocket.chat/core-typings'; +import type { OEmbedMeta, OEmbedUrlContent, OEmbedProvider } from '@rocket.chat/core-typings'; import { camelCase } from 'change-case'; -import _ from 'underscore'; import { callbacks } from '../../../lib/callbacks'; import { SystemLogger } from '../../../server/lib/logger/system'; @@ -16,10 +12,10 @@ class Providers { } static getConsumerUrl(provider: OEmbedProvider, url: string): string { - const urlObj = new URL.URL(provider.endPoint); + const urlObj = new URL(provider.endPoint); urlObj.searchParams.set('url', url); - return URL.format(urlObj); + return urlObj.toString(); } registerProvider(provider: OEmbedProvider): number { @@ -95,25 +91,20 @@ providers.registerProvider({ callbacks.add( 'oembed:beforeGetUrlContent', (data) => { - if (data.parsedUrl != null) { - const url = URL.format(data.parsedUrl); - const provider = providers.getProviderForUrl(url); - if (provider != null) { - const consumerUrl = Providers.getConsumerUrl(provider, url); - - const parsedConsumerUrl = URL.parse(consumerUrl, true); - _.extend(data.parsedUrl, parsedConsumerUrl); - - data.urlObj.port = parsedConsumerUrl.port; - data.urlObj.hostname = parsedConsumerUrl.hostname; - data.urlObj.pathname = parsedConsumerUrl.pathname; - data.urlObj.query = parsedConsumerUrl.query; - - delete data.urlObj.search; - delete data.urlObj.host; - } + if (!data.urlObj) { + return data; } - return data; + + const url = data.urlObj.toString(); + const provider = providers.getProviderForUrl(url); + + if (!provider) { + return data; + } + + const consumerUrl = Providers.getConsumerUrl(provider, url); + + return { ...data, urlObj: new URL(consumerUrl) }; }, callbacks.priority.MEDIUM, 'oembed-providers-before', @@ -123,13 +114,11 @@ const cleanupOembed = (data: { url: string; meta: OEmbedMeta; headers: { [k: string]: string }; - parsedUrl: ParsedUrl; content: OEmbedUrlContent; }): { url: string; meta: Omit; headers: { [k: string]: string }; - parsedUrl: ParsedUrl; content: OEmbedUrlContent; } => { if (!data?.meta) { @@ -148,24 +137,17 @@ const cleanupOembed = (data: { callbacks.add( 'oembed:afterParseContent', (data) => { - if (!data?.url || !data.content?.body || !data.parsedUrl?.query) { + if (!data?.url || !data.content?.body) { return cleanupOembed(data); } - const queryString = typeof data.parsedUrl.query === 'string' ? QueryString.parse(data.parsedUrl.query) : data.parsedUrl.query; - - if (!queryString.url) { - return cleanupOembed(data); - } + const provider = providers.getProviderForUrl(data.url); - const { url: originalUrl } = data; - const provider = providers.getProviderForUrl(originalUrl); if (!provider) { return cleanupOembed(data); } - const { url } = queryString; - data.meta.oembedUrl = url; + data.meta.oembedUrl = data.url; try { const metas = JSON.parse(data.content.body); diff --git a/apps/meteor/app/oembed/server/server.ts b/apps/meteor/app/oembed/server/server.ts index 256722cdd3d4..79de0402043f 100644 --- a/apps/meteor/app/oembed/server/server.ts +++ b/apps/meteor/app/oembed/server/server.ts @@ -1,6 +1,3 @@ -import querystring from 'querystring'; -import URL from 'url'; - import type { OEmbedUrlContentResult, OEmbedUrlWithMetadata, IMessage, MessageAttachment, OEmbedMeta } from '@rocket.chat/core-typings'; import { isOEmbedUrlContentResult, isOEmbedUrlWithMetadata } from '@rocket.chat/core-typings'; import { Logger } from '@rocket.chat/logger'; @@ -11,7 +8,6 @@ import he from 'he'; import iconv from 'iconv-lite'; import ipRangeCheck from 'ip-range-check'; import jschardet from 'jschardet'; -import _ from 'underscore'; import { callbacks } from '../../../lib/callbacks'; import { isURL } from '../../../lib/utils/isURL'; @@ -62,14 +58,7 @@ const toUtf8 = function (contentType: string, body: Buffer): string { return iconv.decode(body, getCharset(contentType, body)); }; -const getUrlContent = async function (urlObjStr: string | URL.UrlWithStringQuery, redirectCount = 5): Promise { - let urlObj: URL.UrlWithStringQuery; - if (typeof urlObjStr === 'string') { - urlObj = URL.parse(urlObjStr); - } else { - urlObj = urlObjStr; - } - +const getUrlContent = async (urlObj: URL, redirectCount = 5): Promise => { const portsProtocol = new Map( Object.entries({ 80: 'http:', @@ -78,34 +67,28 @@ const getUrlContent = async function (urlObjStr: string | URL.UrlWithStringQuery }), ); - const parsedUrl = _.pick(urlObj, ['host', 'hash', 'pathname', 'protocol', 'port', 'query', 'search', 'hostname']); const ignoredHosts = settings.get('API_EmbedIgnoredHosts').replace(/\s/g, '').split(',') || []; - if (parsedUrl.hostname && (ignoredHosts.includes(parsedUrl.hostname) || ipRangeCheck(parsedUrl.hostname, ignoredHosts))) { + if (urlObj.hostname && (ignoredHosts.includes(urlObj.hostname) || ipRangeCheck(urlObj.hostname, ignoredHosts))) { throw new Error('invalid host'); } const safePorts = settings.get('API_EmbedSafePorts').replace(/\s/g, '').split(',') || []; - if (safePorts.length > 0 && parsedUrl.port && !safePorts.includes(parsedUrl.port)) { + // checks if the URL port is in the safe ports list + if (safePorts.length > 0 && urlObj.port && !safePorts.includes(urlObj.port)) { throw new Error('invalid/unsafe port'); } - if (safePorts.length > 0 && !parsedUrl.port && !safePorts.some((port) => portsProtocol.get(port) === parsedUrl.protocol)) { + // if port is not detected, use protocol to verify instead + if (safePorts.length > 0 && !urlObj.port && !safePorts.some((port) => portsProtocol.get(port) === urlObj.protocol)) { throw new Error('invalid/unsafe port'); } const data = await callbacks.run('oembed:beforeGetUrlContent', { urlObj, - parsedUrl, }); - /* This prop is neither passed or returned by the callback, so I'll just comment it for now - if (data.attachments != null) { - return data; - } */ - - const url = URL.format(data.urlObj); - + const url = data.urlObj.toString(); const sizeLimit = 250000; log.debug(`Fetching ${url} following redirects ${redirectCount} times`); @@ -137,10 +120,10 @@ const getUrlContent = async function (urlObjStr: string | URL.UrlWithStringQuery log.debug('Obtained response from server with length of', totalSize); const buffer = Buffer.concat(chunks); + return { headers: Object.fromEntries(response.headers), body: toUtf8(response.headers.get('content-type') || 'text/plain', buffer), - parsedUrl, statusCode: response.status, }; }; @@ -150,19 +133,13 @@ const getUrlMeta = async function ( withFragment?: boolean, ): Promise { log.debug('Obtaining metadata for URL', url); - const urlObj = URL.parse(url); - if (withFragment != null) { - const queryStringObj = querystring.parse(urlObj.query || ''); - queryStringObj._escaped_fragment_ = ''; - urlObj.query = querystring.stringify(queryStringObj); - let path = urlObj.pathname; - if (urlObj.query != null) { - path += `?${urlObj.query}`; - urlObj.search = `?${urlObj.query}`; - } - urlObj.path = path; + const urlObj = new URL(url); + + if (withFragment) { + urlObj.searchParams.set('_escaped_fragment_', ''); } - log.debug('Fetching url content', urlObj.path); + + log.debug('Fetching url content', urlObj.toString()); let content: OEmbedUrlContentResult | undefined; try { content = await getUrlContent(urlObj, 5); @@ -174,7 +151,7 @@ const getUrlMeta = async function ( return; } - if (content.attachments != null) { + if (content.attachments) { return content; } @@ -221,7 +198,6 @@ const getUrlMeta = async function ( url, meta: metas, headers, - parsedUrl: content.parsedUrl, content, }); }; @@ -233,38 +209,25 @@ const getUrlMetaWithCache = async function ( log.debug('Getting oembed metadata for', url); const cache = await OEmbedCache.findOneById(url); - if (cache != null) { + if (cache) { log.debug('Found oembed metadata in cache for', url); return cache.data; } + const data = await getUrlMeta(url, withFragment); - if (data != null) { - try { - log.debug('Saving oembed metadata in cache for', url); - await OEmbedCache.createWithIdAndData(url, data); - } catch (_error) { - log.error({ msg: 'OEmbed duplicated record', url }); - } - return data; - } -}; -const hasOnlyContentLength = (obj: any): obj is { contentLength: string } => 'contentLength' in obj && Object.keys(obj).length === 1; -const hasOnlyContentType = (obj: any): obj is { contentType: string } => 'contentType' in obj && Object.keys(obj).length === 1; -const hasContentLengthAndContentType = (obj: any): obj is { contentLength: string; contentType: string } => - 'contentLength' in obj && 'contentType' in obj && Object.keys(obj).length === 2; - -const getRelevantHeaders = function (headersObj: { - [key: string]: string; -}): { contentLength: string } | { contentType: string } | { contentLength: string; contentType: string } | void { - const headers = { - ...(headersObj.contentLength && { contentLength: headersObj.contentLength }), - ...(headersObj.contentType && { contentType: headersObj.contentType }), - }; + if (!data) { + return; + } - if (hasOnlyContentLength(headers) || hasOnlyContentType(headers) || hasContentLengthAndContentType(headers)) { - return headers; + try { + log.debug('Saving oembed metadata in cache for', url); + await OEmbedCache.createWithIdAndData(url, data); + } catch (_error) { + log.error({ msg: 'OEmbed duplicated record', url }); } + + return data; }; const getRelevantMetaTags = function (metaObj: OEmbedMeta): Record | void { @@ -286,57 +249,71 @@ const insertMaxWidthInOembedHtml = (oembedHtml?: string): string | undefined => const rocketUrlParser = async function (message: IMessage): Promise { log.debug('Parsing message URLs'); - if (Array.isArray(message.urls)) { - log.debug('URLs found', message.urls.length); - - if ( - (message.attachments && message.attachments.length > 0) || - message.urls.filter((item) => !item.url.includes(settings.get('Site_Url'))).length > MAX_EXTERNAL_URL_PREVIEWS - ) { - log.debug('All URL ignored'); - return message; + + if (!Array.isArray(message.urls)) { + return message; + } + + log.debug('URLs found', message.urls.length); + + if ( + (message.attachments && message.attachments.length > 0) || + message.urls.filter((item) => !item.url.includes(settings.get('Site_Url'))).length > MAX_EXTERNAL_URL_PREVIEWS + ) { + log.debug('All URL ignored'); + return message; + } + + const attachments: MessageAttachment[] = []; + + let changed = false; + for await (const item of message.urls) { + if (item.ignoreParse === true) { + log.debug('URL ignored', item.url); + continue; } - const attachments: MessageAttachment[] = []; + if (!isURL(item.url)) { + continue; + } - let changed = false; - for await (const item of message.urls) { - if (item.ignoreParse === true) { - log.debug('URL ignored', item.url); - continue; - } - if (!isURL(item.url)) { - continue; - } - const data = await getUrlMetaWithCache(item.url); - if (data != null) { - if (isOEmbedUrlContentResult(data) && data.attachments) { - attachments.push(...data.attachments); - break; - } - if (isOEmbedUrlWithMetadata(data) && data.meta != null) { - item.meta = getRelevantMetaTags(data.meta) || {}; - if (item.meta?.oembedHtml) { - item.meta.oembedHtml = insertMaxWidthInOembedHtml(item.meta.oembedHtml) || ''; - } - } - if (data.headers != null) { - const headers = getRelevantHeaders(data.headers); - if (headers) { - item.headers = headers; - } - } - item.parsedUrl = data.parsedUrl; - changed = true; + const data = await getUrlMetaWithCache(item.url); + + if (!data) { + continue; + } + + if (isOEmbedUrlContentResult(data) && data.attachments) { + attachments.push(...data.attachments); + break; + } + + if (isOEmbedUrlWithMetadata(data) && data.meta) { + item.meta = getRelevantMetaTags(data.meta) || {}; + if (item.meta?.oembedHtml) { + item.meta.oembedHtml = insertMaxWidthInOembedHtml(item.meta.oembedHtml) || ''; } } - if (attachments.length > 0) { - await Messages.setMessageAttachments(message._id, attachments); + + if (data.headers?.contentLength) { + item.headers = { ...item.headers, contentLength: data.headers.contentLength }; } - if (changed === true) { - await Messages.setUrlsById(message._id, message.urls); + + if (data.headers?.contentType) { + item.headers = { ...item.headers, contentType: data.headers.contentType }; } + + changed = true; } + + if (attachments.length) { + await Messages.setMessageAttachments(message._id, attachments); + } + + if (changed === true) { + await Messages.setUrlsById(message._id, message.urls); + } + return message; }; diff --git a/apps/meteor/lib/callbacks.ts b/apps/meteor/lib/callbacks.ts index 46a27357f546..9c7333a355b3 100644 --- a/apps/meteor/lib/callbacks.ts +++ b/apps/meteor/lib/callbacks.ts @@ -1,5 +1,3 @@ -import type { UrlWithParsedQuery } from 'url'; - import type { IMessage, IRoom, @@ -10,7 +8,6 @@ import type { ILivechatInquiryRecord, ILivechatVisitor, VideoConference, - ParsedUrl, OEmbedMeta, OEmbedUrlContent, Username, @@ -167,24 +164,13 @@ type ChainedCallbackSignatures = { BusinessHourBehaviorClass: { new (): IBusinessHourBehavior }; }; 'renderMessage': (message: T) => T; - 'oembed:beforeGetUrlContent': (data: { - urlObj: Omit & { host?: unknown; search?: unknown }; - parsedUrl: ParsedUrl; - }) => { - urlObj: UrlWithParsedQuery; - parsedUrl: ParsedUrl; + 'oembed:beforeGetUrlContent': (data: { urlObj: URL }) => { + urlObj: URL; }; - 'oembed:afterParseContent': (data: { - url: string; - meta: OEmbedMeta; - headers: { [k: string]: string }; - parsedUrl: ParsedUrl; - content: OEmbedUrlContent; - }) => { + 'oembed:afterParseContent': (data: { url: string; meta: OEmbedMeta; headers: { [k: string]: string }; content: OEmbedUrlContent }) => { url: string; meta: OEmbedMeta; headers: { [k: string]: string }; - parsedUrl: ParsedUrl; content: OEmbedUrlContent; }; 'livechat.beforeListTags': () => ILivechatTag[]; diff --git a/packages/core-typings/src/IOembed.ts b/packages/core-typings/src/IOembed.ts index c540cb893817..0b781aa07fc8 100644 --- a/packages/core-typings/src/IOembed.ts +++ b/packages/core-typings/src/IOembed.ts @@ -1,9 +1,5 @@ -import type Url from 'url'; - import type { MessageAttachment } from './IMessage'; -export type ParsedUrl = Pick; - export type OEmbedMeta = { [key: string]: string; } & { @@ -12,8 +8,7 @@ export type OEmbedMeta = { }; export type OEmbedUrlContent = { - urlObj: Url.UrlWithParsedQuery; - parsedUrl: ParsedUrl; + urlObj: URL; headers: { [k: string]: string }; body: string; statusCode: number; @@ -27,7 +22,6 @@ export type OEmbedProvider = { export type OEmbedUrlContentResult = { headers: { [key: string]: string }; body: string; - parsedUrl: Pick; statusCode: number; attachments?: MessageAttachment[]; }; @@ -38,7 +32,6 @@ export type OEmbedUrlWithMetadata = { url: string; meta: OEmbedMeta; headers: { [k: string]: string }; - parsedUrl: Pick; content: OEmbedUrlContent; }; From d04c6014566a9e0ecdd434556f3099a507a75976 Mon Sep 17 00:00:00 2001 From: janainaCoelhoRocketchat <105796517+janainaCoelhoRocketchat@users.noreply.github.com> Date: Mon, 2 Oct 2023 14:31:07 -0300 Subject: [PATCH 221/275] test: adding missing verifications on message-actions (#30531) --- apps/meteor/tests/e2e/message-actions.spec.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/apps/meteor/tests/e2e/message-actions.spec.ts b/apps/meteor/tests/e2e/message-actions.spec.ts index f6093053fde6..7cfa089326b2 100644 --- a/apps/meteor/tests/e2e/message-actions.spec.ts +++ b/apps/meteor/tests/e2e/message-actions.spec.ts @@ -40,6 +40,8 @@ test.describe.serial('message-actions', () => { await page.locator('[data-qa-id="edit-message"]').click(); await page.locator('[name="msg"]').fill('this message was edited'); await page.keyboard.press('Enter'); + + await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('this message was edited'); }); test('expect message is deleted', async ({ page }) => { @@ -47,6 +49,9 @@ test.describe.serial('message-actions', () => { await poHomeChannel.content.openLastMessageMenu(); await page.locator('[data-qa-id="delete-message"]').click(); await page.locator('#modal-root .rcx-button-group--align-end .rcx-button--danger').click(); + await expect(poHomeChannel.content.lastUserMessage.locator('[data-qa-type="message-body"]:has-text("Message to delete")')).toHaveCount( + 0, + ); }); test('expect quote the message', async ({ page }) => { @@ -64,6 +69,9 @@ test.describe.serial('message-actions', () => { await poHomeChannel.content.sendMessage('Message to star'); await poHomeChannel.content.openLastMessageMenu(); await page.locator('[data-qa-id="star-message"]').click(); + await page.getByRole('button').and(page.getByTitle('Options')).click(); + await page.locator('[data-key="starred-messages"]').click(); + await expect(poHomeChannel.content.lastUserMessageBody).toHaveText('Message to star'); }); test('expect copy the message', async ({ page }) => { From aa30c8581626409881df237da8f98f58b747f061 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Mon, 2 Oct 2023 16:32:26 -0300 Subject: [PATCH 222/275] chore: Delete Trigger Endpoint (#30533) --- apps/meteor/app/livechat/imports/server/rest/triggers.ts | 9 ++++++++- apps/meteor/app/livechat/server/api/lib/triggers.ts | 4 ++++ apps/meteor/app/livechat/server/methods/removeTrigger.ts | 3 +++ .../client/views/omnichannel/triggers/TriggersRow.tsx | 6 +++--- packages/rest-typings/src/v1/omnichannel.ts | 1 + 5 files changed, 19 insertions(+), 4 deletions(-) diff --git a/apps/meteor/app/livechat/imports/server/rest/triggers.ts b/apps/meteor/app/livechat/imports/server/rest/triggers.ts index a12d4a988281..a7660827b0ce 100644 --- a/apps/meteor/app/livechat/imports/server/rest/triggers.ts +++ b/apps/meteor/app/livechat/imports/server/rest/triggers.ts @@ -3,7 +3,7 @@ import { isGETLivechatTriggersParams, isPOSTLivechatTriggersParams } from '@rock import { API } from '../../../../api/server'; import { getPaginationItems } from '../../../../api/server/helpers/getPaginationItems'; -import { findTriggers, findTriggerById } from '../../../server/api/lib/triggers'; +import { findTriggers, findTriggerById, deleteTrigger } from '../../../server/api/lib/triggers'; API.v1.addRoute( 'livechat/triggers', @@ -57,5 +57,12 @@ API.v1.addRoute( trigger, }); }, + async delete() { + await deleteTrigger({ + triggerId: this.urlParams._id, + }); + + return API.v1.success(); + }, }, ); diff --git a/apps/meteor/app/livechat/server/api/lib/triggers.ts b/apps/meteor/app/livechat/server/api/lib/triggers.ts index dbb6f8a6633a..4cbafcb0dc73 100644 --- a/apps/meteor/app/livechat/server/api/lib/triggers.ts +++ b/apps/meteor/app/livechat/server/api/lib/triggers.ts @@ -29,3 +29,7 @@ export async function findTriggers({ export async function findTriggerById({ triggerId }: { triggerId: string }): Promise { return LivechatTrigger.findOneById(triggerId); } + +export async function deleteTrigger({ triggerId }: { triggerId: string }): Promise { + await LivechatTrigger.removeById(triggerId); +} diff --git a/apps/meteor/app/livechat/server/methods/removeTrigger.ts b/apps/meteor/app/livechat/server/methods/removeTrigger.ts index c403dcd3edac..69f3a4a2d80c 100644 --- a/apps/meteor/app/livechat/server/methods/removeTrigger.ts +++ b/apps/meteor/app/livechat/server/methods/removeTrigger.ts @@ -4,6 +4,7 @@ import { check } from 'meteor/check'; import { Meteor } from 'meteor/meteor'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; +import { methodDeprecationLogger } from '../../../lib/server/lib/deprecationWarningLogger'; declare module '@rocket.chat/ui-contexts' { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -14,6 +15,8 @@ declare module '@rocket.chat/ui-contexts' { Meteor.methods({ async 'livechat:removeTrigger'(triggerId) { + methodDeprecationLogger.method('livechat:removeTrigger', '7.0.0'); + const uid = Meteor.userId(); if (!uid || !(await hasPermissionAsync(uid, 'view-livechat-manager'))) { throw new Meteor.Error('error-not-allowed', 'Not allowed', { diff --git a/apps/meteor/client/views/omnichannel/triggers/TriggersRow.tsx b/apps/meteor/client/views/omnichannel/triggers/TriggersRow.tsx index 8a1a81d9f64a..5ade384582c2 100644 --- a/apps/meteor/client/views/omnichannel/triggers/TriggersRow.tsx +++ b/apps/meteor/client/views/omnichannel/triggers/TriggersRow.tsx @@ -1,7 +1,7 @@ import type { ILivechatTrigger } from '@rocket.chat/core-typings'; import { IconButton } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; -import { useSetModal, useToastMessageDispatch, useRoute, useMethod, useTranslation } from '@rocket.chat/ui-contexts'; +import { useSetModal, useToastMessageDispatch, useRoute, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts'; import React, { memo } from 'react'; import GenericModal from '../../../components/GenericModal'; @@ -13,7 +13,7 @@ const TriggersRow = ({ _id, name, description, enabled, reload }: TriggersRowPro const t = useTranslation(); const setModal = useSetModal(); const triggersRoute = useRoute('omnichannel-triggers'); - const deleteTrigger = useMethod('livechat:removeTrigger'); + const deleteTrigger = useEndpoint('DELETE', '/v1/livechat/triggers/:_id', { _id }); const dispatchToastMessage = useToastMessageDispatch(); const handleClick = useMutableCallback(() => { @@ -35,7 +35,7 @@ const TriggersRow = ({ _id, name, description, enabled, reload }: TriggersRowPro e.stopPropagation(); const onDeleteTrigger = async () => { try { - await deleteTrigger(_id); + await deleteTrigger(); dispatchToastMessage({ type: 'success', message: t('Trigger_removed') }); reload(); } catch (error) { diff --git a/packages/rest-typings/src/v1/omnichannel.ts b/packages/rest-typings/src/v1/omnichannel.ts index 31d004ba39c4..bebea2856861 100644 --- a/packages/rest-typings/src/v1/omnichannel.ts +++ b/packages/rest-typings/src/v1/omnichannel.ts @@ -3596,6 +3596,7 @@ export type OmnichannelEndpoints = { }; '/v1/livechat/triggers/:_id': { GET: () => { trigger: ILivechatTrigger | null }; + DELETE: () => void; }; '/v1/livechat/rooms': { GET: (params: GETLivechatRoomsParams) => PaginatedResult<{ rooms: IOmnichannelRoom[] }>; From 6d4cb42b17156f87e970607bb6a421ae76a397dc Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Mon, 2 Oct 2023 19:00:52 -0300 Subject: [PATCH 223/275] chore: adjust callbacks return type (#30547) --- apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts | 2 +- apps/meteor/lib/callbacks/callbacksBase.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts b/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts index 504de297791f..0279fc293b09 100644 --- a/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts +++ b/apps/meteor/app/cloud/server/functions/getWorkspaceLicense.ts @@ -55,7 +55,7 @@ export async function getWorkspaceLicense(): Promise<{ updated: boolean; license const fromCurrentLicense = async () => { const license = currentLicense?.value as string | undefined; if (license) { - callbacks.run('workspaceLicenseChanged', license); + await callbacks.run('workspaceLicenseChanged', license); } return { updated: false, license: license ?? '' }; diff --git a/apps/meteor/lib/callbacks/callbacksBase.ts b/apps/meteor/lib/callbacks/callbacksBase.ts index e6681df78321..405cc5da80e6 100644 --- a/apps/meteor/lib/callbacks/callbacksBase.ts +++ b/apps/meteor/lib/callbacks/callbacksBase.ts @@ -170,7 +170,7 @@ export class Callbacks< this.setCallbacks(hook, hooks); } - run(hook: Hook, ...args: Parameters): void; + run(hook: Hook, ...args: Parameters): Promise; run( hook: Hook, From 8e03a0c48641ad1b31c861c2342483fdad77974e Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Mon, 2 Oct 2023 20:50:31 -0300 Subject: [PATCH 224/275] chore: set license public key v3 with v2 (#30548) --- ee/packages/license/src/token.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/ee/packages/license/src/token.ts b/ee/packages/license/src/token.ts index 80ecc29b4a3f..2a9836a48303 100644 --- a/ee/packages/license/src/token.ts +++ b/ee/packages/license/src/token.ts @@ -4,10 +4,10 @@ import { verify, sign, getPairs } from '@rocket.chat/jwt'; import type { ILicenseV3 } from './definition/ILicenseV3'; -const PUBLIC_KEY_V2 = +const PUBLIC_LICENSE_KEY_V2 = 'LS0tLS1CRUdJTiBQVUJMSUMgS0VZLS0tLS0KTUlJQ0lqQU5CZ2txaGtpRzl3MEJBUUVGQUFPQ0FnOEFNSUlDQ2dLQ0FnRUFxV1Nza2Q5LzZ6Ung4a3lQY2ljcwpiMzJ3Mnd4VnV3N3lCVDk2clEvOEQreU1lQ01POXdTU3BIYS85bkZ5d293RXRpZ3B0L3dyb1BOK1ZHU3didHdQCkZYQmVxRWxCbmRHRkFsODZlNStFbGlIOEt6L2hHbkNtSk5tWHB4RUsyUkUwM1g0SXhzWVg3RERCN010eC9pcXMKY2pCL091dlNCa2ppU2xlUzdibE5JVC9kQTdLNC9DSjNvaXUwMmJMNEV4Y2xDSGVwenFOTWVQM3dVWmdweE9uZgpOT3VkOElYWUs3M3pTY3VFOEUxNTdZd3B6Q0twVmFIWDdaSmY4UXVOc09PNVcvYUlqS2wzTDYyNjkrZUlPRXJHCndPTm1hSG56Zmc5RkxwSmh6Z3BPMzhhVm43NnZENUtLakJhaldza1krNGEyZ1NRbUtOZUZxYXFPb3p5RUZNMGUKY0ZXWlZWWjNMZWg0dkVNb1lWUHlJeng5Nng4ZjIveW1QbmhJdXZRdjV3TjRmeWVwYTdFWTVVQ2NwNzF6OGtmUAo0RmNVelBBMElEV3lNaWhYUi9HNlhnUVFaNEdiL3FCQmh2cnZpSkNGemZZRGNKZ0w3RmVnRllIUDNQR0wwN1FnCnZMZXZNSytpUVpQcnhyYnh5U3FkUE9rZ3VyS2pWclhUVXI0QTlUZ2lMeUlYNVVsSnEzRS9SVjdtZk9xWm5MVGEKU0NWWEhCaHVQbG5DR1pSMDFUb1RDZktoTUcxdTBDRm5MMisxNWhDOWZxT21XdjlRa2U0M3FsSjBQZ0YzVkovWAp1eC9tVHBuazlnbmJHOUpIK21mSDM5Um9GdlROaW5Zd1NNdll6dXRWT242OXNPemR3aERsYTkwbDNBQ2g0eENWCks3Sk9YK3VIa29OdTNnMmlWeGlaVU0wQ0F3RUFBUT09Ci0tLS0tRU5EIFBVQkxJQyBLRVktLS0tLQo='; -const PUBLIC_KEY_V3 = ''; +const PUBLIC_LICENSE_KEY_V3 = process.env.PUBLIC_LICENSE_KEY_V3 || PUBLIC_LICENSE_KEY_V2; let TEST_KEYS: [string, string] | undefined = undefined; @@ -19,7 +19,7 @@ export async function decrypt(encrypted: string): Promise { TEST_KEYS = TEST_KEYS ?? (await getPairs()); if (!TEST_KEYS) { - throw new Error('Missing LICENSE_PUBLIC_KEY_V3'); + throw new Error('Missing PUBLIC_LICENSE_KEY_V3'); } const [spki] = TEST_KEYS; @@ -32,12 +32,12 @@ export async function decrypt(encrypted: string): Promise { // handle V3 if (encrypted.startsWith('RCV3_')) { const jwt = encrypted.substring(5); - const [payload] = await verify(jwt, PUBLIC_KEY_V3); + const [payload] = await verify(jwt, PUBLIC_LICENSE_KEY_V3); return JSON.stringify(payload); } - const decrypted = crypto.publicDecrypt(Buffer.from(PUBLIC_KEY_V2, 'base64').toString('utf-8'), Buffer.from(encrypted, 'base64')); + const decrypted = crypto.publicDecrypt(Buffer.from(PUBLIC_LICENSE_KEY_V2, 'base64').toString('utf-8'), Buffer.from(encrypted, 'base64')); return decrypted.toString('utf-8'); } @@ -49,10 +49,6 @@ export async function encrypt(license: ILicenseV3): Promise { TEST_KEYS = TEST_KEYS ?? (await getPairs()); - if (!TEST_KEYS) { - throw new Error('Missing LICENSE_PUBLIC_KEY_V3'); - } - const [, pkcs8] = TEST_KEYS; return `RCV3_${await sign(license, pkcs8)}`; From b14e159d9b5e16839642c8575beef3540f453080 Mon Sep 17 00:00:00 2001 From: Anshul Singh <68077049+Rottenblasters@users.noreply.github.com> Date: Tue, 3 Oct 2023 05:36:41 +0530 Subject: [PATCH 225/275] fix: in forward search field, user cannot be found by name (Full Name) (#29663) --- .changeset/quiet-phones-reply.md | 5 +++++ .../UserAndRoomAutoCompleteMultiple.tsx | 11 ++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 .changeset/quiet-phones-reply.md diff --git a/.changeset/quiet-phones-reply.md b/.changeset/quiet-phones-reply.md new file mode 100644 index 000000000000..f2735e615491 --- /dev/null +++ b/.changeset/quiet-phones-reply.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Search users using full name too on share message modal diff --git a/apps/meteor/client/components/UserAndRoomAutoCompleteMultiple/UserAndRoomAutoCompleteMultiple.tsx b/apps/meteor/client/components/UserAndRoomAutoCompleteMultiple/UserAndRoomAutoCompleteMultiple.tsx index 96d11cf44cb7..f96c198865cc 100644 --- a/apps/meteor/client/components/UserAndRoomAutoCompleteMultiple/UserAndRoomAutoCompleteMultiple.tsx +++ b/apps/meteor/client/components/UserAndRoomAutoCompleteMultiple/UserAndRoomAutoCompleteMultiple.tsx @@ -18,7 +18,16 @@ const UserAndRoomAutoCompleteMultiple = ({ value, onChange, ...props }: UserAndR const debouncedFilter = useDebouncedValue(filter, 1000); const rooms = useUserSubscriptions( - useMemo(() => ({ open: { $ne: false }, lowerCaseName: new RegExp(escapeRegExp(debouncedFilter), 'i') }), [debouncedFilter]), + useMemo( + () => ({ + open: { $ne: false }, + $or: [ + { lowerCaseFName: new RegExp(escapeRegExp(debouncedFilter), 'i') }, + { lowerCaseName: new RegExp(escapeRegExp(debouncedFilter), 'i') }, + ], + }), + [debouncedFilter], + ), ).filter((room) => { if (!user) { return; From d23156daaadefa8f57bafd82c391a33557b67c01 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Mon, 2 Oct 2023 21:47:06 -0300 Subject: [PATCH 226/275] chore: add the new endpoints to sync with cloud (#30546) --- .../server/functions/buildRegistrationData.ts | 44 ++-- .../server/functions/getWorkspaceLicense.ts | 8 +- .../supportedVersionsToken.ts | 13 +- .../syncWorkspace/announcementSync.ts | 116 +++++++++++ .../syncWorkspace/handleCommsSync.ts | 65 ++++++ .../server/functions/syncWorkspace/index.ts | 4 +- .../syncWorkspace/legacySyncWorkspace.ts | 182 +++++++++++++++++ .../functions/syncWorkspace/syncCloudData.ts | 189 ++---------------- ee/packages/license/package.json | 3 +- .../license/src/definition/ILicenseV3.ts | 4 - ee/packages/license/src/index.ts | 8 +- .../src/cloud/WorkspaceSyncPayload.ts | 38 +++- packages/core-typings/src/cloud/index.ts | 8 +- .../server-cloud-communication/package.json | 4 + .../server-cloud-communication/src/index.ts | 2 + yarn.lock | 1 + 16 files changed, 470 insertions(+), 219 deletions(-) create mode 100644 apps/meteor/app/cloud/server/functions/syncWorkspace/announcementSync.ts create mode 100644 apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts create mode 100644 apps/meteor/app/cloud/server/functions/syncWorkspace/legacySyncWorkspace.ts diff --git a/apps/meteor/app/cloud/server/functions/buildRegistrationData.ts b/apps/meteor/app/cloud/server/functions/buildRegistrationData.ts index 10e0d7f7f7ee..2ad8ba29072a 100644 --- a/apps/meteor/app/cloud/server/functions/buildRegistrationData.ts +++ b/apps/meteor/app/cloud/server/functions/buildRegistrationData.ts @@ -1,50 +1,52 @@ -import type { SettingValue } from '@rocket.chat/core-typings'; import { Statistics, Users } from '@rocket.chat/models'; import { settings } from '../../../settings/server'; import { statistics } from '../../../statistics/server'; +import { Info } from '../../../utils/rocketchat.info'; import { LICENSE_VERSION } from '../license'; export type WorkspaceRegistrationData = { uniqueId: string; - workspaceId: SettingValue; - address: SettingValue; + workspaceId: string; + address: string; contactName: string; contactEmail: T; seats: number; - allowMarketing: SettingValue; - accountName: SettingValue; + organizationType: string; industry: string; orgSize: string; country: string; language: string; - agreePrivacyTerms: SettingValue; - website: SettingValue; - siteName: SettingValue; + allowMarketing: string; + accountName: string; + agreePrivacyTerms: string; + website: string; + siteName: string; workspaceType: unknown; deploymentMethod: string; deploymentPlatform: string; - version: unknown; + version: string; licenseVersion: number; enterpriseReady: boolean; setupComplete: boolean; connectionDisable: boolean; - npsEnabled: SettingValue; + npsEnabled: string; + MAC: number; }; export async function buildWorkspaceRegistrationData(contactEmail: T): Promise> { const stats = (await Statistics.findLast()) || (await statistics.get()); - const address = settings.get('Site_Url'); - const siteName = settings.get('Site_Name'); - const workspaceId = settings.get('Cloud_Workspace_Id'); - const allowMarketing = settings.get('Allow_Marketing_Emails'); - const accountName = settings.get('Organization_Name'); - const website = settings.get('Website'); - const npsEnabled = settings.get('NPS_survey_enabled'); - const agreePrivacyTerms = settings.get('Cloud_Service_Agree_PrivacyTerms'); - const setupWizardState = settings.get('Show_Setup_Wizard'); + const address = settings.get('Site_Url'); + const siteName = settings.get('Site_Name'); + const workspaceId = settings.get('Cloud_Workspace_Id'); + const allowMarketing = settings.get('Allow_Marketing_Emails'); + const accountName = settings.get('Organization_Name'); + const website = settings.get('Website'); + const npsEnabled = settings.get('NPS_survey_enabled'); + const agreePrivacyTerms = settings.get('Cloud_Service_Agree_PrivacyTerms'); + const setupWizardState = settings.get('Show_Setup_Wizard'); const firstUser = await Users.getOldest({ projection: { name: 1, emails: 1 } }); const contactName = firstUser?.name || ''; @@ -72,11 +74,13 @@ export async function buildWorkspaceRegistrationData { const currentLicense = await Settings.findOne('Cloud_Workspace_License'); + // it should never happen, since even if the license is not found, it will return an empty settings + if (!currentLicense?._updatedAt) { + throw new CloudWorkspaceLicenseError('Failed to retrieve current license'); + } const fromCurrentLicense = async () => { const license = currentLicense?.value as string | undefined; @@ -67,10 +71,6 @@ export async function getWorkspaceLicense(): Promise<{ updated: boolean; license return fromCurrentLicense(); } - if (!currentLicense?._updatedAt) { - throw new CloudWorkspaceLicenseError('Failed to retrieve current license'); - } - const payload = await fetchCloudWorkspaceLicensePayload({ token }); if (Date.parse(payload.updatedAt) <= currentLicense._updatedAt.getTime()) { diff --git a/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts index 3d79ed436e51..577abd4383d0 100644 --- a/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts +++ b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts @@ -1,7 +1,7 @@ import type { SettingValue } from '@rocket.chat/core-typings'; import { License } from '@rocket.chat/license'; import { Settings } from '@rocket.chat/models'; -import type { SupportedVersions } from '@rocket.chat/server-cloud-communication'; +import type { SignedSupportedVersions, SupportedVersions } from '@rocket.chat/server-cloud-communication'; import type { Response } from '@rocket.chat/server-fetch'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; @@ -10,6 +10,12 @@ import { settings } from '../../../../settings/server'; import { generateWorkspaceBearerHttpHeader } from '../getWorkspaceAccessToken'; import { supportedVersionsChooseLatest } from './supportedVersionsChooseLatest'; +declare module '@rocket.chat/license' { + interface ILicenseV3 { + supportedVersions?: SignedSupportedVersions; + } +} + /** HELPERS */ export const wrapPromise = ( @@ -115,9 +121,10 @@ const getSupportedVersionsToken = async () => { * return the token */ - const [versionsFromLicense, response] = await Promise.all([License.supportedVersions(), getSupportedVersionsFromCloud()]); + const [versionsFromLicense, response] = await Promise.all([License.getLicense(), getSupportedVersionsFromCloud()]); - return (await supportedVersionsChooseLatest(versionsFromLicense, (response.success && response.result) || undefined))?.signed; + return (await supportedVersionsChooseLatest(versionsFromLicense?.supportedVersions, (response.success && response.result) || undefined)) + ?.signed; }; export const getCachedSupportedVersionsToken = cacheValueInSettings('Cloud_Workspace_Supported_Versions_Token', getSupportedVersionsToken); diff --git a/apps/meteor/app/cloud/server/functions/syncWorkspace/announcementSync.ts b/apps/meteor/app/cloud/server/functions/syncWorkspace/announcementSync.ts new file mode 100644 index 000000000000..26d98b4a7574 --- /dev/null +++ b/apps/meteor/app/cloud/server/functions/syncWorkspace/announcementSync.ts @@ -0,0 +1,116 @@ +import { type Cloud, type Serialized } from '@rocket.chat/core-typings'; +import { serverFetch as fetch } from '@rocket.chat/server-fetch'; +import { v, compile } from 'suretype'; + +import { CloudWorkspaceAccessError } from '../../../../../lib/errors/CloudWorkspaceAccessError'; +import { CloudWorkspaceConnectionError } from '../../../../../lib/errors/CloudWorkspaceConnectionError'; +import { CloudWorkspaceRegistrationError } from '../../../../../lib/errors/CloudWorkspaceRegistrationError'; +import { SystemLogger } from '../../../../../server/lib/logger/system'; +import { settings } from '../../../../settings/server'; +import { buildWorkspaceRegistrationData } from '../buildRegistrationData'; +import { getWorkspaceAccessToken } from '../getWorkspaceAccessToken'; +import { retrieveRegistrationStatus } from '../retrieveRegistrationStatus'; +import { handleAnnouncementsOnWorkspaceSync, handleNpsOnWorkspaceSync } from './handleCommsSync'; +import { legacySyncWorkspace } from './legacySyncWorkspace'; + +const workspaceCommPayloadSchema = v.object({ + workspaceId: v.string().required(), + publicKey: v.string(), + nps: v.object({ + id: v.string().required(), + startAt: v.string().format('date-time').required(), + expireAt: v.string().format('date-time').required(), + }), + announcements: v.object({ + create: v.array( + v.object({ + _id: v.string().required(), + _updatedAt: v.string().format('date-time').required(), + selector: v.object({ + roles: v.array(v.string()), + }), + platform: v.array(v.string().enum('web', 'mobile')).required(), + expireAt: v.string().format('date-time').required(), + startAt: v.string().format('date-time').required(), + createdBy: v.string().enum('cloud', 'system').required(), + createdAt: v.string().format('date-time').required(), + dictionary: v.object({}).additional(v.object({}).additional(v.string())), + view: v.any(), + surface: v.string().enum('banner', 'modal').required(), + }), + ), + delete: v.array(v.string()), + }), +}); + +const assertWorkspaceCommPayload = compile(workspaceCommPayloadSchema); + +const fetchCloudAnnouncementsSync = async ({ + token, + data, +}: { + token: string; + data: Cloud.WorkspaceSyncRequestPayload; +}): Promise> => { + const cloudUrl = settings.get('Cloud_Url'); + const response = await fetch(`${cloudUrl}/api/v3/comms/workspace`, { + method: 'POST', + headers: { + Authorization: `Bearer ${token}`, + }, + body: data, + }); + + if (!response.ok) { + try { + const { error } = await response.json(); + throw new CloudWorkspaceConnectionError(`Failed to connect to Rocket.Chat Cloud: ${error}`); + } catch (error) { + throw new CloudWorkspaceConnectionError(`Failed to connect to Rocket.Chat Cloud: ${response.statusText}`); + } + } + + const payload = await response.json(); + + assertWorkspaceCommPayload(payload); + return payload; +}; + +export async function announcementSync() { + try { + const { workspaceRegistered } = await retrieveRegistrationStatus(); + if (!workspaceRegistered) { + throw new CloudWorkspaceRegistrationError('Workspace is not registered'); + } + + const token = await getWorkspaceAccessToken(true); + if (!token) { + throw new CloudWorkspaceAccessError('Workspace does not have a valid access token'); + } + + const workspaceRegistrationData = await buildWorkspaceRegistrationData(undefined); + + const { nps, announcements } = await fetchCloudAnnouncementsSync({ + token, + data: workspaceRegistrationData, + }); + + if (nps) { + await handleNpsOnWorkspaceSync(nps); + } + + if (announcements) { + await handleAnnouncementsOnWorkspaceSync(announcements); + } + + return true; + } catch (err) { + SystemLogger.error({ + msg: 'Failed to sync with Rocket.Chat Cloud', + url: '/sync', + err, + }); + } + + await legacySyncWorkspace(); +} diff --git a/apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts b/apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts new file mode 100644 index 000000000000..c8b07f8826cf --- /dev/null +++ b/apps/meteor/app/cloud/server/functions/syncWorkspace/handleCommsSync.ts @@ -0,0 +1,65 @@ +import { NPS, Banner } from '@rocket.chat/core-services'; +import { type Cloud, type Serialized } from '@rocket.chat/core-typings'; +import { CloudAnnouncements } from '@rocket.chat/models'; + +import { getAndCreateNpsSurvey } from '../../../../../server/services/nps/getAndCreateNpsSurvey'; + +export const handleNpsOnWorkspaceSync = async (nps: Exclude['nps'], undefined>) => { + const { id: npsId, expireAt } = nps; + + const startAt = new Date(nps.startAt); + + await NPS.create({ + npsId, + startAt, + expireAt: new Date(expireAt), + createdBy: { + _id: 'rocket.cat', + username: 'rocket.cat', + }, + }); + + const now = new Date(); + + if (startAt.getFullYear() === now.getFullYear() && startAt.getMonth() === now.getMonth() && startAt.getDate() === now.getDate()) { + await getAndCreateNpsSurvey(npsId); + } +}; + +export const handleBannerOnWorkspaceSync = async (banners: Exclude['banners'], undefined>) => { + for await (const banner of banners) { + const { createdAt, expireAt, startAt, inactivedAt, _updatedAt, ...rest } = banner; + + await Banner.create({ + ...rest, + createdAt: new Date(createdAt), + expireAt: new Date(expireAt), + startAt: new Date(startAt), + ...(inactivedAt && { inactivedAt: new Date(inactivedAt) }), + }); + } +}; + +const deserializeAnnouncement = (announcement: Serialized): Cloud.Announcement => ({ + ...announcement, + _updatedAt: new Date(announcement._updatedAt), + expireAt: new Date(announcement.expireAt), + startAt: new Date(announcement.startAt), + createdAt: new Date(announcement.createdAt), +}); + +export const handleAnnouncementsOnWorkspaceSync = async ( + announcements: Exclude['announcements'], undefined>, +) => { + const { create, delete: deleteIds } = announcements; + + if (deleteIds) { + await CloudAnnouncements.deleteMany({ _id: { $in: deleteIds } }); + } + + for await (const announcement of create.map(deserializeAnnouncement)) { + const { _id, ...rest } = announcement; + + await CloudAnnouncements.updateOne({ _id }, { $set: rest }, { upsert: true }); + } +}; diff --git a/apps/meteor/app/cloud/server/functions/syncWorkspace/index.ts b/apps/meteor/app/cloud/server/functions/syncWorkspace/index.ts index 48d5afa9dbc5..3173e652afe5 100644 --- a/apps/meteor/app/cloud/server/functions/syncWorkspace/index.ts +++ b/apps/meteor/app/cloud/server/functions/syncWorkspace/index.ts @@ -1,12 +1,12 @@ import { CloudWorkspaceAccessTokenError } from '../getWorkspaceAccessToken'; -import { getWorkspaceLicense } from '../getWorkspaceLicense'; import { getCachedSupportedVersionsToken } from '../supportedVersionsToken/supportedVersionsToken'; +import { announcementSync } from './announcementSync'; import { syncCloudData } from './syncCloudData'; export async function syncWorkspace() { try { await syncCloudData(); - await getWorkspaceLicense(); + await announcementSync(); } catch (error) { if (error instanceof CloudWorkspaceAccessTokenError) { // TODO: Remove License if there is no access token diff --git a/apps/meteor/app/cloud/server/functions/syncWorkspace/legacySyncWorkspace.ts b/apps/meteor/app/cloud/server/functions/syncWorkspace/legacySyncWorkspace.ts new file mode 100644 index 000000000000..d5f86fad8409 --- /dev/null +++ b/apps/meteor/app/cloud/server/functions/syncWorkspace/legacySyncWorkspace.ts @@ -0,0 +1,182 @@ +import { type Cloud, type Serialized } from '@rocket.chat/core-typings'; +import { Settings } from '@rocket.chat/models'; +import { serverFetch as fetch } from '@rocket.chat/server-fetch'; +import { v, compile } from 'suretype'; + +import { CloudWorkspaceAccessError } from '../../../../../lib/errors/CloudWorkspaceAccessError'; +import { CloudWorkspaceConnectionError } from '../../../../../lib/errors/CloudWorkspaceConnectionError'; +import { CloudWorkspaceRegistrationError } from '../../../../../lib/errors/CloudWorkspaceRegistrationError'; +import { SystemLogger } from '../../../../../server/lib/logger/system'; +import { settings } from '../../../../settings/server'; +import type { WorkspaceRegistrationData } from '../buildRegistrationData'; +import { buildWorkspaceRegistrationData } from '../buildRegistrationData'; +import { getWorkspaceAccessToken } from '../getWorkspaceAccessToken'; +import { getWorkspaceLicense } from '../getWorkspaceLicense'; +import { retrieveRegistrationStatus } from '../retrieveRegistrationStatus'; +import { handleBannerOnWorkspaceSync, handleNpsOnWorkspaceSync } from './handleCommsSync'; + +const workspaceClientPayloadSchema = v.object({ + workspaceId: v.string().required(), + publicKey: v.string(), + trial: v.object({ + trialing: v.boolean().required(), + trialID: v.string().required(), + endDate: v.string().format('date-time').required(), + marketing: v + .object({ + utmContent: v.string().required(), + utmMedium: v.string().required(), + utmSource: v.string().required(), + utmCampaign: v.string().required(), + }) + .required(), + DowngradesToPlan: v + .object({ + id: v.string().required(), + }) + .required(), + trialRequested: v.boolean().required(), + }), + nps: v.object({ + id: v.string().required(), + startAt: v.string().format('date-time').required(), + expireAt: v.string().format('date-time').required(), + }), + banners: v.array( + v.object({ + _id: v.string().required(), + _updatedAt: v.string().format('date-time').required(), + platform: v.array(v.string()).required(), + expireAt: v.string().format('date-time').required(), + startAt: v.string().format('date-time').required(), + roles: v.array(v.string()), + createdBy: v.object({ + _id: v.string().required(), + username: v.string(), + }), + createdAt: v.string().format('date-time').required(), + view: v.any(), + active: v.boolean(), + inactivedAt: v.string().format('date-time'), + snapshot: v.string(), + }), + ), + announcements: v.object({ + create: v.array( + v.object({ + _id: v.string().required(), + _updatedAt: v.string().format('date-time').required(), + selector: v.object({ + roles: v.array(v.string()), + }), + platform: v.array(v.string().enum('web', 'mobile')).required(), + expireAt: v.string().format('date-time').required(), + startAt: v.string().format('date-time').required(), + createdBy: v.string().enum('cloud', 'system').required(), + createdAt: v.string().format('date-time').required(), + dictionary: v.object({}).additional(v.object({}).additional(v.string())), + view: v.any(), + surface: v.string().enum('banner', 'modal').required(), + }), + ), + delete: v.array(v.string()), + }), +}); + +const assertWorkspaceClientPayload = compile(workspaceClientPayloadSchema); + +/** @deprecated */ +const fetchWorkspaceClientPayload = async ({ + token, + workspaceRegistrationData, +}: { + token: string; + workspaceRegistrationData: WorkspaceRegistrationData; +}): Promise | undefined> => { + const workspaceRegistrationClientUri = settings.get('Cloud_Workspace_Registration_Client_Uri'); + const response = await fetch(`${workspaceRegistrationClientUri}/client`, { + method: 'POST', + headers: { + Authorization: `Bearer ${token}`, + }, + body: workspaceRegistrationData, + }); + + if (!response.ok) { + try { + const { error } = await response.json(); + throw new CloudWorkspaceConnectionError(`Failed to connect to Rocket.Chat Cloud: ${error}`); + } catch (error) { + throw new CloudWorkspaceConnectionError(`Failed to connect to Rocket.Chat Cloud: ${response.statusText}`); + } + } + + const payload = await response.json(); + + if (!payload) { + return undefined; + } + + if (!assertWorkspaceClientPayload(payload)) { + throw new CloudWorkspaceConnectionError('Invalid response from Rocket.Chat Cloud'); + } + + return payload; +}; + +/** @deprecated */ +const consumeWorkspaceSyncPayload = async (result: Serialized) => { + if (result.publicKey) { + await Settings.updateValueById('Cloud_Workspace_PublicKey', result.publicKey); + } + + if (result.trial?.trialID) { + await Settings.updateValueById('Cloud_Workspace_Had_Trial', true); + } + + // add banners + if (result.banners) { + await handleBannerOnWorkspaceSync(result.banners); + } + + if (result.nps) { + await handleNpsOnWorkspaceSync(result.nps); + } +}; + +/** @deprecated */ +export async function legacySyncWorkspace() { + try { + const { workspaceRegistered } = await retrieveRegistrationStatus(); + if (!workspaceRegistered) { + throw new CloudWorkspaceRegistrationError('Workspace is not registered'); + } + + const token = await getWorkspaceAccessToken(true); + if (!token) { + throw new CloudWorkspaceAccessError('Workspace does not have a valid access token'); + } + + const workspaceRegistrationData = await buildWorkspaceRegistrationData(undefined); + + const payload = await fetchWorkspaceClientPayload({ token, workspaceRegistrationData }); + + if (!payload) { + return true; + } + + await consumeWorkspaceSyncPayload(payload); + + return true; + } catch (err) { + SystemLogger.error({ + msg: 'Failed to sync with Rocket.Chat Cloud', + url: '/client', + err, + }); + + return false; + } finally { + await getWorkspaceLicense(); + } +} diff --git a/apps/meteor/app/cloud/server/functions/syncWorkspace/syncCloudData.ts b/apps/meteor/app/cloud/server/functions/syncWorkspace/syncCloudData.ts index df63dda6d563..5f529a4892ec 100644 --- a/apps/meteor/app/cloud/server/functions/syncWorkspace/syncCloudData.ts +++ b/apps/meteor/app/cloud/server/functions/syncWorkspace/syncCloudData.ts @@ -1,105 +1,40 @@ -import { NPS, Banner } from '@rocket.chat/core-services'; -import { type Cloud, type Serialized } from '@rocket.chat/core-typings'; -import { CloudAnnouncements, Settings } from '@rocket.chat/models'; +import type { Cloud, Serialized } from '@rocket.chat/core-typings'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; import { v, compile } from 'suretype'; +import { callbacks } from '../../../../../lib/callbacks'; import { CloudWorkspaceAccessError } from '../../../../../lib/errors/CloudWorkspaceAccessError'; import { CloudWorkspaceConnectionError } from '../../../../../lib/errors/CloudWorkspaceConnectionError'; import { CloudWorkspaceRegistrationError } from '../../../../../lib/errors/CloudWorkspaceRegistrationError'; import { SystemLogger } from '../../../../../server/lib/logger/system'; -import { getAndCreateNpsSurvey } from '../../../../../server/services/nps/getAndCreateNpsSurvey'; import { settings } from '../../../../settings/server'; -import type { WorkspaceRegistrationData } from '../buildRegistrationData'; import { buildWorkspaceRegistrationData } from '../buildRegistrationData'; import { getWorkspaceAccessToken } from '../getWorkspaceAccessToken'; -import { getWorkspaceLicense } from '../getWorkspaceLicense'; import { retrieveRegistrationStatus } from '../retrieveRegistrationStatus'; +import { legacySyncWorkspace } from './legacySyncWorkspace'; const workspaceSyncPayloadSchema = v.object({ workspaceId: v.string().required(), publicKey: v.string(), - trial: v.object({ - trialing: v.boolean().required(), - trialID: v.string().required(), - endDate: v.string().format('date-time').required(), - marketing: v - .object({ - utmContent: v.string().required(), - utmMedium: v.string().required(), - utmSource: v.string().required(), - utmCampaign: v.string().required(), - }) - .required(), - DowngradesToPlan: v - .object({ - id: v.string().required(), - }) - .required(), - trialRequested: v.boolean().required(), - }), - nps: v.object({ - id: v.string().required(), - startAt: v.string().format('date-time').required(), - expireAt: v.string().format('date-time').required(), - }), - banners: v.array( - v.object({ - _id: v.string().required(), - _updatedAt: v.string().format('date-time').required(), - platform: v.array(v.string()).required(), - expireAt: v.string().format('date-time').required(), - startAt: v.string().format('date-time').required(), - roles: v.array(v.string()), - createdBy: v.object({ - _id: v.string().required(), - username: v.string(), - }), - createdAt: v.string().format('date-time').required(), - view: v.any(), - active: v.boolean(), - inactivedAt: v.string().format('date-time'), - snapshot: v.string(), - }), - ), - announcements: v.object({ - create: v.array( - v.object({ - _id: v.string().required(), - _updatedAt: v.string().format('date-time').required(), - selector: v.object({ - roles: v.array(v.string()), - }), - platform: v.array(v.string().enum('web', 'mobile')).required(), - expireAt: v.string().format('date-time').required(), - startAt: v.string().format('date-time').required(), - createdBy: v.string().enum('cloud', 'system').required(), - createdAt: v.string().format('date-time').required(), - dictionary: v.object({}).additional(v.object({}).additional(v.string())), - view: v.any(), - surface: v.string().enum('banner', 'modal').required(), - }), - ), - delete: v.array(v.string()), - }), + license: v.string().required(), }); const assertWorkspaceSyncPayload = compile(workspaceSyncPayloadSchema); const fetchWorkspaceSyncPayload = async ({ token, - workspaceRegistrationData, + data, }: { token: string; - workspaceRegistrationData: WorkspaceRegistrationData; -}): Promise | undefined> => { + data: Cloud.WorkspaceSyncRequestPayload; +}): Promise> => { const workspaceRegistrationClientUri = settings.get('Cloud_Workspace_Registration_Client_Uri'); - const response = await fetch(`${workspaceRegistrationClientUri}/client`, { + const response = await fetch(`${workspaceRegistrationClientUri}/sync`, { method: 'POST', headers: { Authorization: `Bearer ${token}`, }, - body: workspaceRegistrationData, + body: data, }); if (!response.ok) { @@ -113,98 +48,11 @@ const fetchWorkspaceSyncPayload = async ({ const payload = await response.json(); - if (!payload) { - return undefined; - } - assertWorkspaceSyncPayload(payload); return payload; }; -const handleNpsOnWorkspaceSync = async (nps: Exclude['nps'], undefined>) => { - const { id: npsId, expireAt } = nps; - - const startAt = new Date(nps.startAt); - - await NPS.create({ - npsId, - startAt, - expireAt: new Date(expireAt), - createdBy: { - _id: 'rocket.cat', - username: 'rocket.cat', - }, - }); - - const now = new Date(); - - if (startAt.getFullYear() === now.getFullYear() && startAt.getMonth() === now.getMonth() && startAt.getDate() === now.getDate()) { - await getAndCreateNpsSurvey(npsId); - } -}; - -const handleBannerOnWorkspaceSync = async (banners: Exclude['banners'], undefined>) => { - for await (const banner of banners) { - const { createdAt, expireAt, startAt, inactivedAt, _updatedAt, ...rest } = banner; - - await Banner.create({ - ...rest, - createdAt: new Date(createdAt), - expireAt: new Date(expireAt), - startAt: new Date(startAt), - ...(inactivedAt && { inactivedAt: new Date(inactivedAt) }), - }); - } -}; - -const deserializeAnnouncement = (announcement: Serialized): Cloud.Announcement => ({ - ...announcement, - _updatedAt: new Date(announcement._updatedAt), - expireAt: new Date(announcement.expireAt), - startAt: new Date(announcement.startAt), - createdAt: new Date(announcement.createdAt), -}); - -const handleAnnouncementsOnWorkspaceSync = async ( - announcements: Exclude['announcements'], undefined>, -) => { - const { create, delete: deleteIds } = announcements; - - if (deleteIds) { - await CloudAnnouncements.deleteMany({ _id: { $in: deleteIds } }); - } - - for await (const announcement of create.map(deserializeAnnouncement)) { - const { _id, ...rest } = announcement; - - await CloudAnnouncements.updateOne({ _id }, { $set: rest }, { upsert: true }); - } -}; - -const consumeWorkspaceSyncPayload = async (result: Serialized) => { - if (result.publicKey) { - await Settings.updateValueById('Cloud_Workspace_PublicKey', result.publicKey); - } - - if (result.trial?.trialID) { - await Settings.updateValueById('Cloud_Workspace_Had_Trial', true); - } - - if (result.nps) { - await handleNpsOnWorkspaceSync(result.nps); - } - - // add banners - if (result.banners) { - await handleBannerOnWorkspaceSync(result.banners); - } - - if (result.announcements) { - await handleAnnouncementsOnWorkspaceSync(result.announcements); - } -}; - export async function syncCloudData() { try { const { workspaceRegistered } = await retrieveRegistrationStatus(); @@ -219,24 +67,21 @@ export async function syncCloudData() { const workspaceRegistrationData = await buildWorkspaceRegistrationData(undefined); - const payload = await fetchWorkspaceSyncPayload({ token, workspaceRegistrationData }); - - if (!payload) { - return true; - } + const { license } = await fetchWorkspaceSyncPayload({ + token, + data: workspaceRegistrationData, + }); - await consumeWorkspaceSyncPayload(payload); + await callbacks.run('workspaceLicenseChanged', license); return true; } catch (err) { SystemLogger.error({ msg: 'Failed to sync with Rocket.Chat Cloud', - url: '/client', + url: '/sync', err, }); - - return false; - } finally { - await getWorkspaceLicense(); } + + await legacySyncWorkspace(); } diff --git a/ee/packages/license/package.json b/ee/packages/license/package.json index 24ecdc30bc49..f6a1e7a2b7d5 100644 --- a/ee/packages/license/package.json +++ b/ee/packages/license/package.json @@ -42,7 +42,6 @@ "dependencies": { "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/jwt": "workspace:^", - "@rocket.chat/logger": "workspace:^", - "@rocket.chat/server-cloud-communication": "workspace:^" + "@rocket.chat/logger": "workspace:^" } } diff --git a/ee/packages/license/src/definition/ILicenseV3.ts b/ee/packages/license/src/definition/ILicenseV3.ts index e2a8bd424bb2..d3a2d7f572a3 100644 --- a/ee/packages/license/src/definition/ILicenseV3.ts +++ b/ee/packages/license/src/definition/ILicenseV3.ts @@ -1,5 +1,3 @@ -import type { SignedSupportedVersions } from '@rocket.chat/server-cloud-communication'; - import type { ILicenseTag } from './ILicenseTag'; import type { LicenseLimit } from './LicenseLimit'; import type { LicenseModule } from './LicenseModule'; @@ -61,8 +59,6 @@ export interface ILicenseV3 { monthlyActiveContacts?: LicenseLimit[]; }; cloudMeta?: Record; - - supportedVersions?: SignedSupportedVersions; } export type LicenseLimitKind = keyof ILicenseV3['limits']; diff --git a/ee/packages/license/src/index.ts b/ee/packages/license/src/index.ts index 11cf3bbbe4c5..9dbd94db53ed 100644 --- a/ee/packages/license/src/index.ts +++ b/ee/packages/license/src/index.ts @@ -1,4 +1,4 @@ -import type { ILicenseV3, LicenseLimitKind } from './definition/ILicenseV3'; +import type { LicenseLimitKind } from './definition/ILicenseV3'; import type { LimitContext } from './definition/LimitContext'; import { getAppsConfig, getMaxActiveUsers, getUnmodifiedLicenseAndModules } from './deprecated'; import { onLicense } from './events/deprecated'; @@ -45,8 +45,6 @@ interface License { onInvalidateLicense: typeof onInvalidateLicense; onLimitReached: typeof onLimitReached; - supportedVersions(): ILicenseV3['supportedVersions']; - // Deprecated: onLicense: typeof onLicense; // Deprecated: @@ -58,10 +56,6 @@ interface License { } export class LicenseImp extends LicenseManager implements License { - supportedVersions() { - return this.getLicense()?.supportedVersions; - } - validateFormat = validateFormat; hasModule = hasModule; diff --git a/packages/core-typings/src/cloud/WorkspaceSyncPayload.ts b/packages/core-typings/src/cloud/WorkspaceSyncPayload.ts index 964cb42571b2..fb95cfa4553c 100644 --- a/packages/core-typings/src/cloud/WorkspaceSyncPayload.ts +++ b/packages/core-typings/src/cloud/WorkspaceSyncPayload.ts @@ -7,10 +7,6 @@ import type { NpsSurveyAnnouncement } from './NpsSurveyAnnouncement'; export interface WorkspaceSyncPayload { workspaceId: string; publicKey?: string; - announcements?: { - create: Announcement[]; - delete: Announcement['_id'][]; - }; trial?: { trialing: boolean; trialID: string; @@ -31,3 +27,37 @@ export interface WorkspaceSyncPayload { /** @deprecated */ banners?: IBanner[]; } + +export interface WorkspaceSyncRequestPayload { + uniqueId: string; + workspaceId: string; + seats: number; + MAC: number; // Need to align on the property + address: string; + siteName: string; + deploymentMethod: string; + deploymentPlatform: string; + version: string; + licenseVersion: number; + connectionDisable: boolean; +} + +export interface WorkspaceSyncResponse { + workspaceId: string; + publicKey: string; + license: unknown; +} + +export interface WorkspaceCommsRequestPayload { + npsEnabled: boolean; + deploymentMethod: string; + deploymentPlatform: string; + version: string; +} +export interface WorkspaceCommsResponsePayload { + nps?: NpsSurveyAnnouncement | null; // Potentially consolidate into announcements + announcements?: { + create: Announcement[]; + delete: Announcement['_id'][]; + }; +} diff --git a/packages/core-typings/src/cloud/index.ts b/packages/core-typings/src/cloud/index.ts index b9c044b054e3..da0565a215ed 100644 --- a/packages/core-typings/src/cloud/index.ts +++ b/packages/core-typings/src/cloud/index.ts @@ -1,4 +1,10 @@ export { Announcement } from './Announcement'; export { NpsSurveyAnnouncement } from './NpsSurveyAnnouncement'; export { WorkspaceLicensePayload } from './WorkspaceLicensePayload'; -export { WorkspaceSyncPayload } from './WorkspaceSyncPayload'; +export { + WorkspaceSyncPayload, + WorkspaceSyncRequestPayload, + WorkspaceSyncResponse, + WorkspaceCommsRequestPayload, + WorkspaceCommsResponsePayload, +} from './WorkspaceSyncPayload'; diff --git a/packages/server-cloud-communication/package.json b/packages/server-cloud-communication/package.json index 9b091bbc464f..52a3ff801dac 100644 --- a/packages/server-cloud-communication/package.json +++ b/packages/server-cloud-communication/package.json @@ -3,12 +3,16 @@ "version": "0.0.1", "private": true, "devDependencies": { + "@rocket.chat/license": "workspace:^", "@types/jest": "~29.5.3", "eslint": "~8.45.0", "jest": "~29.6.1", "ts-jest": "~29.0.5", "typescript": "~5.1.6" }, + "volta": { + "extends": "../../package.json" + }, "scripts": { "lint": "eslint --ext .js,.jsx,.ts,.tsx .", "lint:fix": "eslint --ext .js,.jsx,.ts,.tsx . --fix", diff --git a/packages/server-cloud-communication/src/index.ts b/packages/server-cloud-communication/src/index.ts index a18306b926eb..382400b0c72c 100644 --- a/packages/server-cloud-communication/src/index.ts +++ b/packages/server-cloud-communication/src/index.ts @@ -1,3 +1,5 @@ +/* eslint-disable @typescript-eslint/naming-convention */ + import type { SupportedVersions, SignedSupportedVersions } from './definitions'; export { SupportedVersions, SignedSupportedVersions }; diff --git a/yarn.lock b/yarn.lock index 265f9c7ab0d3..b915bb0f2e2a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -9426,6 +9426,7 @@ __metadata: version: 0.0.0-use.local resolution: "@rocket.chat/server-cloud-communication@workspace:packages/server-cloud-communication" dependencies: + "@rocket.chat/license": "workspace:^" "@types/jest": ~29.5.3 eslint: ~8.45.0 jest: ~29.6.1 From 83c7708832f40c35418a3c854fbeb1a9197da52b Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 3 Oct 2023 00:55:23 -0300 Subject: [PATCH 227/275] chore: do not focus messagebox on mobile devices (#30553) --- .../client/messageBox/createComposerAPI.ts | 12 ++++++--- .../room/composer/messageBox/MessageBox.tsx | 2 +- .../hooks/useMessageBoxAutoFocus.ts | 25 ++++++++++++++++--- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/apps/meteor/app/ui-message/client/messageBox/createComposerAPI.ts b/apps/meteor/app/ui-message/client/messageBox/createComposerAPI.ts index 4609797e6bd2..a926f8540d27 100644 --- a/apps/meteor/app/ui-message/client/messageBox/createComposerAPI.ts +++ b/apps/meteor/app/ui-message/client/messageBox/createComposerAPI.ts @@ -48,13 +48,15 @@ export const createComposerAPI = (input: HTMLTextAreaElement, storageID: string) text: string, { selection, + skipFocus, }: { selection?: | { readonly start?: number; readonly end?: number } | ((previous: { readonly start: number; readonly end: number }) => { readonly start?: number; readonly end?: number }); + skipFocus?: boolean; } = {}, ): void => { - focus(); + !skipFocus && focus(); const { selectionStart, selectionEnd } = input; const textAreaTxt = input.value; @@ -66,7 +68,7 @@ export const createComposerAPI = (input: HTMLTextAreaElement, storageID: string) if (selection) { if (!document.execCommand?.('insertText', false, text)) { input.value = textAreaTxt.substring(0, selectionStart) + text + textAreaTxt.substring(selectionStart); - focus(); + !skipFocus && focus(); } input.setSelectionRange(selection.start ?? 0, selection.end ?? text.length); } @@ -78,7 +80,7 @@ export const createComposerAPI = (input: HTMLTextAreaElement, storageID: string) triggerEvent(input, 'input'); triggerEvent(input, 'change'); - focus(); + !skipFocus && focus(); }; const insertText = (text: string): void => { @@ -260,7 +262,9 @@ export const createComposerAPI = (input: HTMLTextAreaElement, storageID: string) const insertNewLine = (): void => insertText('\n'); - setText(Meteor._localStorage.getItem(storageID) ?? ''); + setText(Meteor._localStorage.getItem(storageID) ?? '', { + skipFocus: true, + }); // Gets the text that is connected to the cursor and replaces it with the given text const replaceText = (text: string, selection: { readonly start: number; readonly end: number }): void => { diff --git a/apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx b/apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx index de9a96dc43b4..da598c00be11 100644 --- a/apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx +++ b/apps/meteor/client/views/room/composer/messageBox/MessageBox.tsx @@ -141,7 +141,7 @@ const MessageBox = ({ [chat, storageID], ); - const autofocusRef = useMessageBoxAutoFocus(); + const autofocusRef = useMessageBoxAutoFocus(!isMobile); const useEmojis = useUserPreference('useEmojis'); diff --git a/apps/meteor/client/views/room/composer/messageBox/hooks/useMessageBoxAutoFocus.ts b/apps/meteor/client/views/room/composer/messageBox/hooks/useMessageBoxAutoFocus.ts index 5ea6db79a869..b8efd9391f87 100644 --- a/apps/meteor/client/views/room/composer/messageBox/hooks/useMessageBoxAutoFocus.ts +++ b/apps/meteor/client/views/room/composer/messageBox/hooks/useMessageBoxAutoFocus.ts @@ -1,13 +1,13 @@ import type { Ref } from 'react'; -import { useEffect, useRef } from 'react'; +import { useCallback, useEffect, useRef } from 'react'; /** * if the user is types outside the message box and its not actually typing in any input field * then the message box should be focused * @returns callbackRef to bind the logic to the message box */ -export const useMessageBoxAutoFocus = (): Ref => { - const ref = useRef(null); +export const useMessageBoxAutoFocus = (enabled: boolean): Ref => { + const ref = useRef(); useEffect(() => { const handleKeyDown = (e: KeyboardEvent) => { @@ -43,5 +43,22 @@ export const useMessageBoxAutoFocus = (): Ref => { }; }, []); - return ref; + return useCallback( + (node: HTMLElement | null) => { + if (!node) { + return; + } + + ref.current = node; + + if (!enabled) { + return; + } + + if (ref.current) { + ref.current.focus(); + } + }, + [enabled, ref], + ); }; From c0ef13a0bfd254dc5837303c16f9fd655ba69736 Mon Sep 17 00:00:00 2001 From: Heitor Tanoue <68477006+heitortanoue@users.noreply.github.com> Date: Tue, 3 Oct 2023 12:44:12 -0300 Subject: [PATCH 228/275] feat: push notification statistics (#30269) Co-authored-by: Matheus Barbosa Silva <36537004+matheusbsilva137@users.noreply.github.com> --- .changeset/nice-chairs-add.md | 13 +++++++++++++ apps/meteor/app/statistics/server/lib/statistics.ts | 9 +++++++++ .../views/admin/info/DeploymentCard.stories.tsx | 1 + .../views/admin/info/InformationPage.stories.tsx | 1 + .../client/views/admin/info/UsageCard.stories.tsx | 1 + packages/core-typings/src/IStats.ts | 1 + 6 files changed, 26 insertions(+) create mode 100644 .changeset/nice-chairs-add.md diff --git a/.changeset/nice-chairs-add.md b/.changeset/nice-chairs-add.md new file mode 100644 index 000000000000..dfc9d763e1c0 --- /dev/null +++ b/.changeset/nice-chairs-add.md @@ -0,0 +1,13 @@ +--- +"@rocket.chat/meteor": minor +"@rocket.chat/core-typings": minor +--- + +Added `push` statistic, containing three bits. Each bit represents a boolean: +``` +1 1 1 +| | | +| | +- push enabled = 0b1 = 1 +| +--- push gateway enabled = 0b10 = 2 ++----- push gateway changed = 0b100 = 4 +``` diff --git a/apps/meteor/app/statistics/server/lib/statistics.ts b/apps/meteor/app/statistics/server/lib/statistics.ts index b6b983d92fce..89b068c11341 100644 --- a/apps/meteor/app/statistics/server/lib/statistics.ts +++ b/apps/meteor/app/statistics/server/lib/statistics.ts @@ -517,6 +517,15 @@ export const statistics = { statistics.totalWebRTCCalls = settings.get('WebRTC_Calls_Count'); statistics.uncaughtExceptionsCount = settings.get('Uncaught_Exceptions_Count'); + const defaultGateway = (await Settings.findOneById('Push_gateway', { projection: { packageValue: 1 } }))?.packageValue; + + // one bit for each of the following: + const pushEnabled = settings.get('Push_enable') ? 1 : 0; + const pushGatewayEnabled = settings.get('Push_enable_gateway') ? 2 : 0; + const pushGatewayChanged = settings.get('Push_gateway') !== defaultGateway ? 4 : 0; + + statistics.push = pushEnabled | pushGatewayEnabled | pushGatewayChanged; + const defaultHomeTitle = (await Settings.findOneById('Layout_Home_Title'))?.packageValue; statistics.homeTitleChanged = settings.get('Layout_Home_Title') !== defaultHomeTitle; diff --git a/apps/meteor/client/views/admin/info/DeploymentCard.stories.tsx b/apps/meteor/client/views/admin/info/DeploymentCard.stories.tsx index ebb92b040c83..98aa3a7073ff 100644 --- a/apps/meteor/client/views/admin/info/DeploymentCard.stories.tsx +++ b/apps/meteor/client/views/admin/info/DeploymentCard.stories.tsx @@ -265,6 +265,7 @@ export default { totalCustomRoles: 0, totalWebRTCCalls: 0, uncaughtExceptionsCount: 0, + push: 0, matrixFederation: { enabled: false, }, diff --git a/apps/meteor/client/views/admin/info/InformationPage.stories.tsx b/apps/meteor/client/views/admin/info/InformationPage.stories.tsx index 222f31f88334..a6ef0c8e9289 100644 --- a/apps/meteor/client/views/admin/info/InformationPage.stories.tsx +++ b/apps/meteor/client/views/admin/info/InformationPage.stories.tsx @@ -295,6 +295,7 @@ export default { totalCustomRoles: 0, totalWebRTCCalls: 0, uncaughtExceptionsCount: 0, + push: 0, matrixFederation: { enabled: false, }, diff --git a/apps/meteor/client/views/admin/info/UsageCard.stories.tsx b/apps/meteor/client/views/admin/info/UsageCard.stories.tsx index 14a6cac8633d..da49ee88fa6b 100644 --- a/apps/meteor/client/views/admin/info/UsageCard.stories.tsx +++ b/apps/meteor/client/views/admin/info/UsageCard.stories.tsx @@ -243,6 +243,7 @@ export default { totalCustomRoles: 0, totalWebRTCCalls: 0, uncaughtExceptionsCount: 0, + push: 0, matrixFederation: { enabled: false, }, diff --git a/packages/core-typings/src/IStats.ts b/packages/core-typings/src/IStats.ts index cd8aeb9f1762..6bbc2da81b74 100644 --- a/packages/core-typings/src/IStats.ts +++ b/packages/core-typings/src/IStats.ts @@ -211,6 +211,7 @@ export interface IStats { totalCustomRoles: number; totalWebRTCCalls: number; uncaughtExceptionsCount: number; + push: number; matrixFederation: { enabled: boolean; }; From 1065cd8870cc9df1d3824b91b8760bd4c12d3ec5 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 3 Oct 2023 14:28:14 -0300 Subject: [PATCH 229/275] regression: fix initializing startup order (#30555) --- apps/meteor/ee/server/index.ts | 2 -- apps/meteor/server/main.ts | 3 ++- ee/packages/presence/package.json | 3 +++ packages/core-services/package.json | 3 +++ packages/core-services/src/lib/Api.ts | 6 +++++- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/apps/meteor/ee/server/index.ts b/apps/meteor/ee/server/index.ts index 9b56239ad046..f5b385c9a805 100644 --- a/apps/meteor/ee/server/index.ts +++ b/apps/meteor/ee/server/index.ts @@ -1,5 +1,3 @@ -import './startup'; - import '../app/license/server/index'; import '../app/api-enterprise/server/index'; import '../app/authorization/server/index'; diff --git a/apps/meteor/server/main.ts b/apps/meteor/server/main.ts index 5579261911f5..09edca701540 100644 --- a/apps/meteor/server/main.ts +++ b/apps/meteor/server/main.ts @@ -9,9 +9,10 @@ import './importPackages'; import '../imports/startup/server'; import '../app/lib/server/startup'; +import '../ee/server/startup'; +import './startup'; import '../ee/server'; import './lib/pushConfig'; -import './startup'; import './configuration/accounts_meld'; import './configuration/ldap'; import './methods/OEmbedCacheCleanup'; diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 9011dab086b6..fdb6a16393b3 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -28,6 +28,9 @@ "files": [ "/dist" ], + "volta": { + "extends": "../../../package.json" + }, "dependencies": { "@rocket.chat/core-services": "workspace:^", "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 4cce8aebe07b..3492cc1f77bf 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -30,6 +30,9 @@ "files": [ "/dist" ], + "volta": { + "extends": "../../package.json" + }, "dependencies": { "@rocket.chat/apps-engine": "1.41.0-alpha.290", "@rocket.chat/core-typings": "workspace:^", diff --git a/packages/core-services/src/lib/Api.ts b/packages/core-services/src/lib/Api.ts index 66806dc54fde..f0b5e67594c2 100644 --- a/packages/core-services/src/lib/Api.ts +++ b/packages/core-services/src/lib/Api.ts @@ -46,7 +46,11 @@ export class Api implements IApiService { } async broadcast(event: T, ...args: Parameters): Promise { - return this.broker?.broadcast(event, ...args); + if (!this.broker) { + throw new Error(`No broker set to broadcast: ${event}`); + } + + return this.broker.broadcast(event, ...args); } async broadcastToServices( From 3979680e8fb2eb735a5b3bdb5f9839eff79d3bff Mon Sep 17 00:00:00 2001 From: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com> Date: Tue, 3 Oct 2023 16:33:14 -0300 Subject: [PATCH 230/275] regression: unmarked dangling promise on license validation (#30557) --- ee/packages/license/src/pendingLicense.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ee/packages/license/src/pendingLicense.ts b/ee/packages/license/src/pendingLicense.ts index 2c2140044336..8dd82dcd7774 100644 --- a/ee/packages/license/src/pendingLicense.ts +++ b/ee/packages/license/src/pendingLicense.ts @@ -8,10 +8,10 @@ export function setPendingLicense(this: LicenseManager, encryptedLicense: string } } -export function applyPendingLicense(this: LicenseManager) { +export async function applyPendingLicense(this: LicenseManager) { if (this.pendingLicense) { logger.info('Applying pending license.'); - this.setLicense(this.pendingLicense); + return this.setLicense(this.pendingLicense); } } From b810163a24220bbe57db44cd8ae226e770818f27 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 3 Oct 2023 17:21:47 -0300 Subject: [PATCH 231/275] ci: run tests from forks (#30556) --- .github/actions/build-docker/action.yml | 2 ++ .github/workflows/ci-test-e2e.yml | 8 ++++++++ .github/workflows/ci.yml | 4 +++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-docker/action.yml b/.github/actions/build-docker/action.yml index 808b8acdcbe3..753bdc2169a8 100644 --- a/.github/actions/build-docker/action.yml +++ b/.github/actions/build-docker/action.yml @@ -19,6 +19,7 @@ runs: steps: - name: Login to GitHub Container Registry + if: github.event.pull_request.head.repo.full_name == github.repository uses: docker/login-action@v2 with: registry: ghcr.io @@ -62,6 +63,7 @@ runs: docker compose -f docker-compose-ci.yml build "${args[@]}" - name: Publish Docker images to GitHub Container Registry + if: github.event.pull_request.head.repo.full_name == github.repository shell: bash run: | args=(rocketchat) diff --git a/.github/workflows/ci-test-e2e.yml b/.github/workflows/ci-test-e2e.yml index e14857a97a09..d77966f186b3 100644 --- a/.github/workflows/ci-test-e2e.yml +++ b/.github/workflows/ci-test-e2e.yml @@ -97,6 +97,14 @@ jobs: cache-modules: true install: true + # if we are testing a PR from a fork, we need to build the docker image at this point + - uses: ./.github/actions/build-docker + if: github.event.pull_request.head.repo.full_name != github.repository + with: + CR_USER: ${{ secrets.CR_USER }} + CR_PAT: ${{ secrets.CR_PAT }} + node-version: ${{ inputs.node-version }} + - uses: dtinth/setup-github-actions-caching-for-turbo@v1 - name: Start httpbin container and wait for it to be ready diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 31c2c42718b6..ec8e905cd803 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,7 +172,6 @@ jobs: build-gh-docker-coverage: name: 🚢 Build Docker Images for Testing needs: [build, release-versions] - if: (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') runs-on: ubuntu-20.04 env: @@ -189,7 +188,10 @@ jobs: steps: - uses: actions/checkout@v3 + + # we only build and publish the actual docker images if not a PR from a fork - uses: ./.github/actions/build-docker + if: (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') with: CR_USER: ${{ secrets.CR_USER }} CR_PAT: ${{ secrets.CR_PAT }} From a98f3ff303b2dac8e4c96947fc28ec9ef7e0d74c Mon Sep 17 00:00:00 2001 From: Pierre Lehnen <55164754+pierre-lehnen-rc@users.noreply.github.com> Date: Tue, 3 Oct 2023 17:27:17 -0300 Subject: [PATCH 232/275] feat: new `licenses.info` endpoint (#30473) --- .changeset/tough-carrots-walk.md | 7 ++++ apps/meteor/ee/server/api/licenses.ts | 13 ++++++++ ee/packages/license/src/index.ts | 10 +++++- ee/packages/license/src/license.ts | 41 +++++++++++++++++++++++- packages/rest-typings/src/index.ts | 1 + packages/rest-typings/src/v1/licenses.ts | 29 ++++++++++++++++- 6 files changed, 98 insertions(+), 3 deletions(-) create mode 100644 .changeset/tough-carrots-walk.md diff --git a/.changeset/tough-carrots-walk.md b/.changeset/tough-carrots-walk.md new file mode 100644 index 000000000000..2851e697b85e --- /dev/null +++ b/.changeset/tough-carrots-walk.md @@ -0,0 +1,7 @@ +--- +'@rocket.chat/rest-typings': minor +'@rocket.chat/license': patch +'@rocket.chat/meteor': patch +--- + +feat: added `licenses.info` endpoint diff --git a/apps/meteor/ee/server/api/licenses.ts b/apps/meteor/ee/server/api/licenses.ts index cfd657a1f0e9..ff5c3fcc3e47 100644 --- a/apps/meteor/ee/server/api/licenses.ts +++ b/apps/meteor/ee/server/api/licenses.ts @@ -1,5 +1,6 @@ import { License } from '@rocket.chat/license'; import { Settings, Users } from '@rocket.chat/models'; +import { isLicensesInfoProps } from '@rocket.chat/rest-typings'; import { check } from 'meteor/check'; import { API } from '../../../app/api/server/api'; @@ -22,6 +23,18 @@ API.v1.addRoute( }, ); +API.v1.addRoute( + 'licenses.info', + { authRequired: true, validateParams: isLicensesInfoProps, permissionsRequired: ['view-privileged-setting'] }, + { + async get() { + const data = await License.getInfo(Boolean(this.queryParams.loadValues)); + + return API.v1.success({ data }); + }, + }, +); + API.v1.addRoute( 'licenses.add', { authRequired: true }, diff --git a/ee/packages/license/src/index.ts b/ee/packages/license/src/index.ts index 9dbd94db53ed..c5dbd9f9496f 100644 --- a/ee/packages/license/src/index.ts +++ b/ee/packages/license/src/index.ts @@ -1,4 +1,5 @@ -import type { LicenseLimitKind } from './definition/ILicenseV3'; +import type { ILicenseV3, LicenseLimitKind } from './definition/ILicenseV3'; +import type { LicenseModule } from './definition/LicenseModule'; import type { LimitContext } from './definition/LimitContext'; import { getAppsConfig, getMaxActiveUsers, getUnmodifiedLicenseAndModules } from './deprecated'; import { onLicense } from './events/deprecated'; @@ -45,6 +46,13 @@ interface License { onInvalidateLicense: typeof onInvalidateLicense; onLimitReached: typeof onLimitReached; + getInfo: (loadCurrentValues: boolean) => Promise<{ + license: ILicenseV3 | undefined; + activeModules: LicenseModule[]; + limits: Record; + inFairPolicy: boolean; + }>; + // Deprecated: onLicense: typeof onLicense; // Deprecated: diff --git a/ee/packages/license/src/license.ts b/ee/packages/license/src/license.ts index 2fb25b0e3b4f..a420eb2b0d57 100644 --- a/ee/packages/license/src/license.ts +++ b/ee/packages/license/src/license.ts @@ -9,7 +9,7 @@ import { DuplicatedLicenseError } from './errors/DuplicatedLicenseError'; import { InvalidLicenseError } from './errors/InvalidLicenseError'; import { NotReadyForValidation } from './errors/NotReadyForValidation'; import { logger } from './logger'; -import { invalidateAll, replaceModules } from './modules'; +import { getModules, invalidateAll, replaceModules } from './modules'; import { applyPendingLicense, clearPendingLicense, hasPendingLicense, isPendingLicense, setPendingLicense } from './pendingLicense'; import { showLicense } from './showLicense'; import { replaceTags } from './tags'; @@ -227,4 +227,43 @@ export class LicenseManager extends Emitter< .some(({ max }) => max < currentValue), ); } + + public async getInfo(loadCurrentValues = false): Promise<{ + license: ILicenseV3 | undefined; + activeModules: LicenseModule[]; + limits: Record; + inFairPolicy: boolean; + }> { + const activeModules = getModules.call(this); + const license = this.getLicense(); + + // Get all limits present in the license and their current value + const limits = ( + (license && + (await Promise.all( + (['activeUsers', 'guestUsers', 'privateApps', 'marketplaceApps', 'monthlyActiveContacts'] as LicenseLimitKind[]) + .map((limitKey) => ({ + limitKey, + max: Math.max(-1, Math.min(...Array.from(license.limits[limitKey as LicenseLimitKind] || [])?.map(({ max }) => max))), + })) + .filter(({ max }) => max >= 0 && max < Infinity) + .map(async ({ max, limitKey }) => { + return { + [limitKey as LicenseLimitKind]: { + ...(loadCurrentValues ? { value: await getCurrentValueForLicenseLimit.call(this, limitKey as LicenseLimitKind) } : {}), + max, + }, + }; + }), + ))) || + [] + ).reduce((prev, curr) => ({ ...prev, ...curr }), {}); + + return { + license, + activeModules, + limits: limits as Record, + inFairPolicy: this.inFairPolicy, + }; + } } diff --git a/packages/rest-typings/src/index.ts b/packages/rest-typings/src/index.ts index 066e3248dc33..3b8197ce20bf 100644 --- a/packages/rest-typings/src/index.ts +++ b/packages/rest-typings/src/index.ts @@ -228,6 +228,7 @@ export * from './v1/invites'; export * from './v1/dm'; export * from './v1/dm/DmHistoryProps'; export * from './v1/integrations'; +export * from './v1/licenses'; export * from './v1/omnichannel'; export * from './v1/oauthapps'; export * from './v1/oauthapps/UpdateOAuthAppParamsPOST'; diff --git a/packages/rest-typings/src/v1/licenses.ts b/packages/rest-typings/src/v1/licenses.ts index 96c67e2654bb..6dc935aae739 100644 --- a/packages/rest-typings/src/v1/licenses.ts +++ b/packages/rest-typings/src/v1/licenses.ts @@ -1,4 +1,4 @@ -import type { ILicenseV2, ILicenseV3 } from '@rocket.chat/license'; +import type { ILicenseV2, ILicenseV3, LicenseLimitKind } from '@rocket.chat/license'; import Ajv from 'ajv'; const ajv = new Ajv({ @@ -22,10 +22,37 @@ const licensesAddPropsSchema = { export const isLicensesAddProps = ajv.compile(licensesAddPropsSchema); +type licensesInfoProps = { + loadValues?: boolean; +}; + +const licensesInfoPropsSchema = { + type: 'object', + properties: { + loadValues: { + type: 'boolean', + }, + }, + required: [], + additionalProperties: false, +}; + +export const isLicensesInfoProps = ajv.compile(licensesInfoPropsSchema); + export type LicensesEndpoints = { '/v1/licenses.get': { GET: () => { licenses: Array }; }; + '/v1/licenses.info': { + GET: (params: licensesInfoProps) => { + data: { + license: ILicenseV3 | undefined; + activeModules: string[]; + limits: Record; + inFairPolicy: boolean; + }; + }; + }; '/v1/licenses.add': { POST: (params: licensesAddProps) => void; }; From 3fd0bc412023ef393149aa137c02e81f0b7416bf Mon Sep 17 00:00:00 2001 From: gabriellsh <40830821+gabriellsh@users.noreply.github.com> Date: Tue, 3 Oct 2023 18:23:02 -0300 Subject: [PATCH 233/275] chore: get translations from CDN (#30331) --- .changeset/soft-cows-juggle.md | 5 +++++ apps/meteor/client/providers/TranslationProvider.tsx | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .changeset/soft-cows-juggle.md diff --git a/.changeset/soft-cows-juggle.md b/.changeset/soft-cows-juggle.md new file mode 100644 index 000000000000..6fcb20506483 --- /dev/null +++ b/.changeset/soft-cows-juggle.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +download translation files through CDN diff --git a/apps/meteor/client/providers/TranslationProvider.tsx b/apps/meteor/client/providers/TranslationProvider.tsx index fdddb9ec5349..03be723e0b7f 100644 --- a/apps/meteor/client/providers/TranslationProvider.tsx +++ b/apps/meteor/client/providers/TranslationProvider.tsx @@ -2,7 +2,7 @@ import { useLocalStorage, useMutableCallback } from '@rocket.chat/fuselage-hooks import languages from '@rocket.chat/i18n/dist/languages'; import en from '@rocket.chat/i18n/src/locales/en.i18n.json'; import type { TranslationKey, TranslationContextValue } from '@rocket.chat/ui-contexts'; -import { useMethod, useSetting, TranslationContext, useAbsoluteUrl } from '@rocket.chat/ui-contexts'; +import { useMethod, useSetting, TranslationContext } from '@rocket.chat/ui-contexts'; import type i18next from 'i18next'; import I18NextHttpBackend from 'i18next-http-backend'; import sprintf from 'i18next-sprintf-postprocessor'; @@ -12,6 +12,7 @@ import React, { useEffect, useMemo } from 'react'; import { I18nextProvider, initReactI18next, useTranslation } from 'react-i18next'; import { CachedCollectionManager } from '../../app/ui-cached-collection/client'; +import { getURL } from '../../app/utils/client'; import { i18n, addSprinfToI18n } from '../../app/utils/lib/i18n'; import { AppClientOrchestratorInstance } from '../../ee/client/apps/orchestrator'; import { applyCustomTranslations } from '../lib/utils/applyCustomTranslations'; @@ -39,8 +40,6 @@ const parseToJSON = (customTranslations: string): Record>(); const useI18next = (lng: string): typeof i18next => { - const basePath = useAbsoluteUrl()('/i18n'); - const customTranslations = useSetting('Custom_Translations'); const parsedCustomTranslations = useMemo(() => { @@ -100,17 +99,18 @@ const useI18next = (lng: string): typeof i18next => { partialBundledLanguages: true, defaultNS: 'core', backend: { - loadPath: `${basePath}/{{lng}}.json`, + loadPath: 'i18n/{{lng}}.json', parse: (data: string, lngs?: string | string[], namespaces: string | string[] = []) => extractKeys(JSON.parse(data), lngs, namespaces), request: (_options, url, _payload, callback) => { const params = url.split('/'); + const lng = params[params.length - 1]; let promise = localeCache.get(lng); if (!promise) { - promise = fetch(url).then((res) => res.text()); + promise = fetch(getURL(url)).then((res) => res.text()); localeCache.set(lng, promise); } From 3bdcf92c7cbc254c51d14432a0a5cdf4c045b607 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Tue, 3 Oct 2023 20:09:00 -0300 Subject: [PATCH 234/275] chore: Fix triggers flaky tests (#30530) --- .../tests/e2e/omnichannel/omnichannel-triggers.spec.ts | 2 ++ packages/livechat/src/components/Modal/styles.scss | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/apps/meteor/tests/e2e/omnichannel/omnichannel-triggers.spec.ts b/apps/meteor/tests/e2e/omnichannel/omnichannel-triggers.spec.ts index 4cf3b82b2c66..9db221723ebe 100644 --- a/apps/meteor/tests/e2e/omnichannel/omnichannel-triggers.spec.ts +++ b/apps/meteor/tests/e2e/omnichannel/omnichannel-triggers.spec.ts @@ -29,6 +29,7 @@ test.describe.serial('Omnichannel Triggers', () => { const { page } = await createAuxContext(browser, Users.user1, '/omnichannel/triggers'); agent = { page, poHomeOmnichannel: new HomeOmnichannel(page) }; + await page.emulateMedia({ reducedMotion: 'reduce' }); }); test.beforeEach(async ({ page, api }) => { @@ -39,6 +40,7 @@ test.describe.serial('Omnichannel Triggers', () => { await Promise.all([ api.delete('/livechat/users/agent/user1'), api.delete('/livechat/users/manager/user1'), + api.delete(`/livechat/triggers/${triggersName}`), api.post('/settings/Livechat_clear_local_storage_when_chat_ended', { value: false }), ]); await agent.page.close(); diff --git a/packages/livechat/src/components/Modal/styles.scss b/packages/livechat/src/components/Modal/styles.scss index 6c3a7fd38957..359a953bf124 100644 --- a/packages/livechat/src/components/Modal/styles.scss +++ b/packages/livechat/src/components/Modal/styles.scss @@ -59,6 +59,12 @@ $modal-background-color: $bg-color-white; line-height: 1.5; } +@media (prefers-reduced-motion) { + .modal--animated { + animation: none; + } +} + @keyframes fadeInUp { 0% { transform: translate3d(-50%, 100%, 0); From 3e9a86262de97417d6d0afc58ee835daef0ebfe3 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Tue, 3 Oct 2023 21:06:10 -0300 Subject: [PATCH 235/275] ci: fix Docker image build for production (#30562) --- .github/actions/build-docker/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/build-docker/action.yml b/.github/actions/build-docker/action.yml index 753bdc2169a8..284a0985b78e 100644 --- a/.github/actions/build-docker/action.yml +++ b/.github/actions/build-docker/action.yml @@ -19,7 +19,7 @@ runs: steps: - name: Login to GitHub Container Registry - if: github.event.pull_request.head.repo.full_name == github.repository + if: (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') uses: docker/login-action@v2 with: registry: ghcr.io @@ -63,7 +63,7 @@ runs: docker compose -f docker-compose-ci.yml build "${args[@]}" - name: Publish Docker images to GitHub Container Registry - if: github.event.pull_request.head.repo.full_name == github.repository + if: (github.event.pull_request.head.repo.full_name == github.repository || github.event_name == 'release' || github.ref == 'refs/heads/develop') shell: bash run: | args=(rocketchat) From 2a1aa293a5bc38f360f0448f2fb26517f2c0b3cd Mon Sep 17 00:00:00 2001 From: Yash Rajpal <58601732+yash-rajpal@users.noreply.github.com> Date: Wed, 4 Oct 2023 21:39:30 +0530 Subject: [PATCH 236/275] fix: Check for room scoped permissions for creating discussions (#30497) --- .changeset/sweet-chefs-exist.md | 5 +++++ .../app/discussion/client/createDiscussionMessageAction.ts | 2 +- .../meteor/app/discussion/server/methods/createDiscussion.ts | 2 +- .../actions/CreateDiscussionAction.tsx | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/sweet-chefs-exist.md diff --git a/.changeset/sweet-chefs-exist.md b/.changeset/sweet-chefs-exist.md new file mode 100644 index 000000000000..6ceee63dd762 --- /dev/null +++ b/.changeset/sweet-chefs-exist.md @@ -0,0 +1,5 @@ +--- +'@rocket.chat/meteor': patch +--- + +Check for room scoped permissions for starting discussions diff --git a/apps/meteor/app/discussion/client/createDiscussionMessageAction.ts b/apps/meteor/app/discussion/client/createDiscussionMessageAction.ts index 5eb2ef38e5b7..3ad61c4c42f0 100644 --- a/apps/meteor/app/discussion/client/createDiscussionMessageAction.ts +++ b/apps/meteor/app/discussion/client/createDiscussionMessageAction.ts @@ -59,7 +59,7 @@ Meteor.startup(() => { return false; } - return uid !== user._id ? hasPermission('start-discussion-other-user') : hasPermission('start-discussion'); + return uid !== user._id ? hasPermission('start-discussion-other-user', room._id) : hasPermission('start-discussion', room._id); }, order: 1, group: 'menu', diff --git a/apps/meteor/app/discussion/server/methods/createDiscussion.ts b/apps/meteor/app/discussion/server/methods/createDiscussion.ts index ce5c09947a60..c08378fd64f6 100644 --- a/apps/meteor/app/discussion/server/methods/createDiscussion.ts +++ b/apps/meteor/app/discussion/server/methods/createDiscussion.ts @@ -221,7 +221,7 @@ export const createDiscussion = async ( }); } - if (!(await hasAtLeastOnePermissionAsync(userId, ['start-discussion', 'start-discussion-other-user']))) { + if (!(await hasAtLeastOnePermissionAsync(userId, ['start-discussion', 'start-discussion-other-user'], prid))) { throw new Meteor.Error('error-action-not-allowed', 'You are not allowed to create a discussion', { method: 'createDiscussion' }); } const user = await Users.findOneById(userId); diff --git a/apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/actions/CreateDiscussionAction.tsx b/apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/actions/CreateDiscussionAction.tsx index 3a1f1eef6dcc..419c6c2cfdda 100644 --- a/apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/actions/CreateDiscussionAction.tsx +++ b/apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/actions/CreateDiscussionAction.tsx @@ -14,8 +14,8 @@ const CreateDiscussionAction = ({ room }: { room: IRoom }) => { setModal( setModal(null)} defaultParentRoom={room?.prid || room?._id} />); const discussionEnabled = useSetting('Discussion_enabled') as boolean; - const canStartDiscussion = usePermission('start-discussion'); - const canSstartDiscussionOtherUser = usePermission('start-discussion-other-user'); + const canStartDiscussion = usePermission('start-discussion', room._id); + const canSstartDiscussionOtherUser = usePermission('start-discussion-other-user', room._id); const allowDiscussion = room && discussionEnabled && !isRoomFederated(room) && (canStartDiscussion || canSstartDiscussionOtherUser); From f3b685862ad125731907688bb60c22b4e66dad54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Jaeger=20Foresti?= <60678893+juliajforesti@users.noreply.github.com> Date: Wed, 4 Oct 2023 15:21:18 -0300 Subject: [PATCH 237/275] chore: Replace `Field.[SUBCOMPONENT]` in favor of named imports (#30501) --- .../CreateDiscussion/CreateDiscussion.tsx | 50 ++++--- .../client/components/Omnichannel/Tags.tsx | 18 +-- .../Omnichannel/modals/CloseChatModal.tsx | 61 ++++---- .../Omnichannel/modals/ForwardChatModal.tsx | 33 +++-- .../Omnichannel/modals/TranscriptModal.tsx | 18 +-- .../TwoFactorModal/TwoFactorEmailModal.tsx | 12 +- .../TwoFactorModal/TwoFactorPasswordModal.tsx | 12 +- .../TwoFactorModal/TwoFactorTotpModal.tsx | 12 +- .../CreateChannel/CreateChannelModal.tsx | 64 +++++---- .../header/CreateTeam/CreateTeamModal.tsx | 61 ++++---- .../client/sidebar/header/EditStatusModal.tsx | 12 +- .../MatrixFederationManageServerModal.tsx | 24 +++- .../AccountFeaturePreviewPage.tsx | 15 +- .../integrations/AccountIntegrationsPage.tsx | 8 +- .../PreferencesConversationTranscript.tsx | 22 +-- .../preferences/PreferencesGlobalSection.tsx | 8 +- .../PreferencesHighlightsSection.tsx | 10 +- .../PreferencesLocalizationSection.tsx | 8 +- .../PreferencesMessagesSection.tsx | 89 +++++++----- .../preferences/PreferencesMyDataSection.tsx | 6 +- .../PreferencesNotificationsSection.tsx | 58 ++++---- .../preferences/PreferencesSoundSection.tsx | 26 ++-- .../PreferencesUserPresenceSection.tsx | 14 +- .../account/profile/AccountProfileForm.tsx | 84 ++++++----- .../account/profile/ActionConfirmModal.tsx | 8 +- .../views/account/security/EndToEnd.tsx | 14 +- .../tokens/AccountTokensTable/AddToken.tsx | 12 +- .../RegisterWorkspaceSetupStepOneModal.tsx | 8 +- .../RegisterWorkspaceSetupStepTwoModal.tsx | 8 +- .../modals/RegisterWorkspaceTokenModal.tsx | 10 +- .../admin/customEmoji/AddCustomEmoji.tsx | 24 ++-- .../admin/customEmoji/EditCustomEmoji.tsx | 34 +++-- .../admin/customSounds/AddCustomSound.tsx | 10 +- .../views/admin/customSounds/EditSound.tsx | 10 +- .../customUserStatus/CustomUserStatusForm.tsx | 18 +-- .../views/admin/emailInbox/EmailInboxForm.tsx | 134 +++++++++--------- .../client/views/admin/mailer/MailerPage.tsx | 73 ++++++---- .../moderation/ModerationConsoleTable.tsx | 8 +- .../views/admin/oauthApps/EditOauthApp.tsx | 70 +++++---- .../views/admin/oauthApps/OAuthAddApp.tsx | 42 ++++-- .../views/admin/permissions/RoleForm.tsx | 30 ++-- .../UsersInRole/UsersInRolePage.tsx | 14 +- .../client/views/admin/rooms/EditRoom.tsx | 91 ++++++------ .../views/admin/settings/MemoizedSetting.tsx | 4 +- .../views/admin/settings/SettingSkeleton.tsx | 10 +- .../settings/groups/CreateOAuthModal.tsx | 10 +- .../admin/settings/groups/LDAPGroupPage.tsx | 8 +- .../settings/groups/voip/AssignAgentModal.tsx | 14 +- .../settings/inputs/ActionSettingInput.tsx | 8 +- .../settings/inputs/AssetSettingInput.tsx | 10 +- .../settings/inputs/BooleanSettingInput.tsx | 10 +- .../settings/inputs/CodeSettingInput.tsx | 8 +- .../settings/inputs/ColorSettingInput.tsx | 12 +- .../settings/inputs/FontSettingInput.tsx | 10 +- .../settings/inputs/GenericSettingInput.tsx | 10 +- .../admin/settings/inputs/IntSettingInput.tsx | 10 +- .../settings/inputs/LanguageSettingInput.tsx | 10 +- .../settings/inputs/LookupSettingInput.tsx | 10 +- .../inputs/MultiSelectSettingInput.tsx | 6 +- .../settings/inputs/PasswordSettingInput.tsx | 10 +- .../inputs/RelativeUrlSettingInput.tsx | 6 +- .../settings/inputs/RoomPickSettingInput.tsx | 10 +- .../settings/inputs/SelectSettingInput.tsx | 10 +- .../inputs/SelectTimezoneSettingInput.tsx | 10 +- .../settings/inputs/StringSettingInput.tsx | 10 +- .../views/admin/users/AdminUserForm.tsx | 112 ++++++++------- .../views/e2e/EnterE2EPasswordModal.tsx | 8 +- .../views/omnichannel/agents/AgentEdit.tsx | 50 ++++--- .../agents/AgentsTable/AddAgent.tsx | 8 +- .../omnichannel/analytics/AnalyticsPage.tsx | 8 +- .../omnichannel/analytics/DateRangePicker.tsx | 14 +- .../omnichannel/appearance/AppearanceForm.tsx | 126 ++++++++-------- .../currentChats/CustomFieldsList.tsx | 14 +- .../departments/DepartmentTags/index.tsx | 12 +- .../departments/EditDepartment.tsx | 63 ++++---- .../chats/contextualBar/RoomEdit/RoomEdit.tsx | 8 +- .../contacts/contextualBar/ContactNewEdit.tsx | 26 ++-- .../views/omnichannel/managers/AddManager.tsx | 8 +- .../omnichannel/triggers/TriggersForm.tsx | 58 ++++---- .../AutoTranslate/AutoTranslate.tsx | 14 +- .../ExportMessages/ExportMessages.tsx | 8 +- .../ExportMessages/FileExport.tsx | 20 +-- .../ExportMessages/MailExportForm.tsx | 20 +-- .../components/MessageSearchForm.tsx | 14 +- .../components/NotificationPreference.tsx | 8 +- .../PruneMessages/PruneMessages.tsx | 34 ++--- .../PruneMessagesDateTimeRow.tsx | 4 +- .../RoomMembers/AddUsers/AddUsers.tsx | 4 +- .../InviteUsers/EditInviteLink.tsx | 14 +- .../RoomMembers/InviteUsers/InviteLink.tsx | 8 +- .../Threads/components/ThreadChat.tsx | 10 +- .../UserInfo/ReportUserModal.tsx | 12 +- .../FileUploadModal/FileUploadModal.tsx | 16 +-- .../ForwardMessageModal.tsx | 10 +- .../ReportMessageModal/ReportMessageModal.tsx | 8 +- .../room/webdav/AddWebdavAccountModal.tsx | 32 ++--- .../views/room/webdav/SaveToWebdavModal.tsx | 10 +- .../root/MainLayout/RegisterUsername.tsx | 10 +- .../AddExistingModal/AddExistingModal.tsx | 4 +- .../DepartmentBusinessHours.tsx | 8 +- .../additionalForms/DepartmentForwarding.tsx | 10 +- .../additionalForms/MaxChatsPerAgent.tsx | 8 +- .../additionalForms/PrioritiesSelect.tsx | 8 +- .../additionalForms/SlaPoliciesSelect.tsx | 8 +- .../components/cannedResponseForm.tsx | 22 +-- .../omnichannel/monitors/MonitorsTable.tsx | 8 +- .../priorities/PriorityEditForm.tsx | 4 +- .../omnichannel/slaPolicies/SlaEdit.tsx | 28 ++-- .../views/audit/components/AuditForm.tsx | 18 +-- .../views/audit/components/AuditLogTable.tsx | 8 +- .../views/audit/components/tabs/DirectTab.tsx | 12 +- .../audit/components/tabs/OmnichannelTab.tsx | 22 +-- .../views/audit/components/tabs/RoomsTab.tsx | 12 +- .../views/audit/components/tabs/UsersTab.tsx | 12 +- .../components/modals/WrapUpCallModal.tsx | 10 +- .../voip/modal/DialPad/DialPadModal.tsx | 6 +- .../voip/modals/DeviceSettingsModal.tsx | 14 +- .../fuselage-ui-kit/src/blocks/InputBlock.tsx | 20 ++- .../src/components/CustomFieldsForm.tsx | 14 +- .../src/EmailConfirmationForm.tsx | 10 +- .../web-ui-registration/src/LoginForm.tsx | 46 +++--- .../web-ui-registration/src/RegisterForm.tsx | 86 ++++++----- .../src/template/FormSkeleton.tsx | 18 +-- 123 files changed, 1483 insertions(+), 1253 deletions(-) diff --git a/apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx b/apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx index 4f62e0684647..9f55917be231 100644 --- a/apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx +++ b/apps/meteor/client/components/CreateDiscussion/CreateDiscussion.tsx @@ -1,5 +1,19 @@ import type { IMessage, IRoom, IUser } from '@rocket.chat/core-typings'; -import { Modal, Field, FieldGroup, ToggleSwitch, TextInput, TextAreaInput, Button, Icon, Box } from '@rocket.chat/fuselage'; +import { + Modal, + Field, + FieldGroup, + ToggleSwitch, + TextInput, + TextAreaInput, + Button, + Icon, + Box, + FieldDescription, + FieldLabel, + FieldRow, + FieldError, +} from '@rocket.chat/fuselage'; import { useTranslation, useEndpoint } from '@rocket.chat/ui-contexts'; import { useMutation } from '@tanstack/react-query'; import type { ComponentProps, ReactElement } from 'react'; @@ -79,11 +93,11 @@ const CreateDiscussion = ({ onClose, defaultParentRoom, parentMessageId, nameSug - {t('Discussion_description')} + {t('Discussion_description')} - {t('Discussion_target_channel')} - + {t('Discussion_target_channel')} + {defaultParentRoom && ( )} - - {errors.parentRoom && {errors.parentRoom.message}} + + {errors.parentRoom && {errors.parentRoom.message}} - {t('Encrypted')} + {t('Encrypted')} - {t('Discussion_name')} - + {t('Discussion_name')} + } /> - - {errors.name && {errors.name.message}} + + {errors.name && {errors.name.message}} - {t('Invite_Users')} - + {t('Invite_Users')} + )} /> - + - {t('Discussion_first_message_title')} - + {t('Discussion_first_message_title')} + - - {encrypted && {t('Discussion_first_message_disabled_due_to_e2e')}} + + {encrypted && {t('Discussion_first_message_disabled_due_to_e2e')}} diff --git a/apps/meteor/client/components/Omnichannel/Tags.tsx b/apps/meteor/client/components/Omnichannel/Tags.tsx index 39564ca7f89f..88f5f1a5c6e7 100644 --- a/apps/meteor/client/components/Omnichannel/Tags.tsx +++ b/apps/meteor/client/components/Omnichannel/Tags.tsx @@ -1,4 +1,4 @@ -import { Field, TextInput, Chip, Button } from '@rocket.chat/fuselage'; +import { TextInput, Chip, Button, FieldLabel, FieldRow } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import type { ChangeEvent, ReactElement } from 'react'; @@ -71,12 +71,12 @@ const Tags = ({ tags = [], handler, error, tagRequired, department }: TagsProps) return ( <> - + {t('Tags')} - + {EETagsComponent && tagsResult?.tags && tagsResult?.tags.length ? ( - + { @@ -85,10 +85,10 @@ const Tags = ({ tags = [], handler, error, tagRequired, department }: TagsProps) department={department} viewAll={!department} /> - + ) : ( <> - + {t('Add')} - + )} {customTags.length > 0 && ( - + {customTags?.map((tag, i) => ( removeTag(tag)} mie={8}> {tag} ))} - + )} ); diff --git a/apps/meteor/client/components/Omnichannel/modals/CloseChatModal.tsx b/apps/meteor/client/components/Omnichannel/modals/CloseChatModal.tsx index 17cbc094160b..67d650186680 100644 --- a/apps/meteor/client/components/Omnichannel/modals/CloseChatModal.tsx +++ b/apps/meteor/client/components/Omnichannel/modals/CloseChatModal.tsx @@ -1,5 +1,18 @@ import type { ILivechatDepartment } from '@rocket.chat/core-typings'; -import { Field, FieldGroup, Button, TextInput, Modal, Box, CheckBox, Divider, EmailInput } from '@rocket.chat/fuselage'; +import { + Field, + FieldGroup, + Button, + TextInput, + Modal, + Box, + CheckBox, + Divider, + EmailInput, + FieldLabel, + FieldRow, + FieldError, +} from '@rocket.chat/fuselage'; import { usePermission, useSetting, useTranslation, useUserPreference } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React, { useCallback, useState, useEffect, useMemo } from 'react'; @@ -134,8 +147,8 @@ const CloseChatModal = ({ {t('Close_room_description')} - {t('Comment')} - + {t('Comment')} + - - {errors.comment?.message} + + {errors.comment?.message} - {errors.tags?.message} + {errors.tags?.message} {canSendTranscript && ( <> - {t('Chat_transcript')} + {t('Chat_transcript')} {canSendTranscriptPDF && ( - + - + {t('Omnichannel_transcript_pdf')} - - + + )} {canSendTranscriptEmail && ( <> - + - + {t('Omnichannel_transcript_email')} - - + + {transcriptEmail && ( <> - {t('Contact_email')} - + {t('Contact_email')} + - + - {t('Subject')} - + {t('Subject')} + - - {errors.subject?.message} + + {errors.subject?.message} )} )} - + {canSendTranscriptPDF && canSendTranscriptEmail ? t('These_options_affect_this_conversation_only_To_set_default_selections_go_to_My_Account_Omnichannel') : t('This_option_affect_this_conversation_only_To_set_default_selection_go_to_My_Account_Omnichannel')} - + )} diff --git a/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx b/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx index 82c92d39cc8f..b78df7688741 100644 --- a/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx +++ b/apps/meteor/client/components/Omnichannel/modals/ForwardChatModal.tsx @@ -1,5 +1,16 @@ import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; -import { Field, FieldGroup, Button, TextAreaInput, Modal, Box, PaginatedSelectFiltered, Divider } from '@rocket.chat/fuselage'; +import { + Field, + FieldGroup, + Button, + TextAreaInput, + Modal, + Box, + PaginatedSelectFiltered, + Divider, + FieldLabel, + FieldRow, +} from '@rocket.chat/fuselage'; import { useDebouncedValue } from '@rocket.chat/fuselage-hooks'; import { useEndpoint, useSetting, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -102,8 +113,8 @@ const ForwardChatModal = ({ - {t('Forward_to_department')} - + {t('Forward_to_department')} + - + - {t('Forward_to_user')} - + {t('Forward_to_user')} + - + - + {t('Leave_a_comment')}{' '} ({t('Optional')}) - - + + - + diff --git a/apps/meteor/client/components/Omnichannel/modals/TranscriptModal.tsx b/apps/meteor/client/components/Omnichannel/modals/TranscriptModal.tsx index e879caf38032..2757b5d9a88b 100644 --- a/apps/meteor/client/components/Omnichannel/modals/TranscriptModal.tsx +++ b/apps/meteor/client/components/Omnichannel/modals/TranscriptModal.tsx @@ -1,5 +1,5 @@ import type { IOmnichannelRoom } from '@rocket.chat/core-typings'; -import { Field, Button, TextInput, Modal, Box, FieldGroup } from '@rocket.chat/fuselage'; +import { Field, Button, TextInput, Modal, Box, FieldGroup, FieldLabel, FieldRow, FieldError } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { FC } from 'react'; import React, { useCallback, useEffect } from 'react'; @@ -78,28 +78,28 @@ const TranscriptModal: FC = ({ {!!transcriptRequest &&

{t('Livechat_transcript_already_requested_warning')}

} - {t('Email')}* - + {t('Email')}* + - - {errors.email?.message} + + {errors.email?.message} - {t('Subject')}* - + {t('Subject')}* + - - {errors.subject?.message} + + {errors.subject?.message} diff --git a/apps/meteor/client/components/TwoFactorModal/TwoFactorEmailModal.tsx b/apps/meteor/client/components/TwoFactorModal/TwoFactorEmailModal.tsx index 1b7936cafd3e..19074f7f6b34 100644 --- a/apps/meteor/client/components/TwoFactorModal/TwoFactorEmailModal.tsx +++ b/apps/meteor/client/components/TwoFactorModal/TwoFactorEmailModal.tsx @@ -1,4 +1,4 @@ -import { Box, FieldGroup, TextInput, Field } from '@rocket.chat/fuselage'; +import { Box, FieldGroup, TextInput, Field, FieldLabel, FieldRow, FieldError } from '@rocket.chat/fuselage'; import { useAutoFocus, useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useToastMessageDispatch, useEndpoint, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement, ChangeEvent, SyntheticEvent } from 'react'; @@ -59,13 +59,13 @@ const TwoFactorEmailModal = ({ onConfirm, onClose, emailOrUsername, invalidAttem > - + {t('Verify_your_email_with_the_code_we_sent')} - - + + - - {invalidAttempt && {t('Invalid_password')}} + + {invalidAttempt && {t('Invalid_password')}} diff --git a/apps/meteor/client/components/TwoFactorModal/TwoFactorPasswordModal.tsx b/apps/meteor/client/components/TwoFactorModal/TwoFactorPasswordModal.tsx index 3d604fc5004b..4c91e274de68 100644 --- a/apps/meteor/client/components/TwoFactorModal/TwoFactorPasswordModal.tsx +++ b/apps/meteor/client/components/TwoFactorModal/TwoFactorPasswordModal.tsx @@ -1,4 +1,4 @@ -import { Box, PasswordInput, FieldGroup, Field } from '@rocket.chat/fuselage'; +import { Box, PasswordInput, FieldGroup, Field, FieldLabel, FieldRow, FieldError } from '@rocket.chat/fuselage'; import { useAutoFocus, useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement, ChangeEvent, Ref, SyntheticEvent } from 'react'; @@ -43,10 +43,10 @@ const TwoFactorPasswordModal = ({ onConfirm, onClose, invalidAttempt }: TwoFacto > - + {t('For_your_security_you_must_enter_your_current_password_to_continue')} - - + + } @@ -54,8 +54,8 @@ const TwoFactorPasswordModal = ({ onConfirm, onClose, invalidAttempt }: TwoFacto onChange={onChange} placeholder={t('Password')} > - - {invalidAttempt && {t('Invalid_password')}} + + {invalidAttempt && {t('Invalid_password')}} diff --git a/apps/meteor/client/components/TwoFactorModal/TwoFactorTotpModal.tsx b/apps/meteor/client/components/TwoFactorModal/TwoFactorTotpModal.tsx index 266e92586944..04aa7a4f94f0 100644 --- a/apps/meteor/client/components/TwoFactorModal/TwoFactorTotpModal.tsx +++ b/apps/meteor/client/components/TwoFactorModal/TwoFactorTotpModal.tsx @@ -1,4 +1,4 @@ -import { Box, TextInput, Field, FieldGroup } from '@rocket.chat/fuselage'; +import { Box, TextInput, Field, FieldGroup, FieldLabel, FieldRow, FieldError } from '@rocket.chat/fuselage'; import { useAutoFocus, useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement, ChangeEvent, SyntheticEvent } from 'react'; @@ -42,13 +42,13 @@ const TwoFactorTotpModal = ({ onConfirm, onClose, invalidAttempt }: TwoFactorTot > - + {t('Open_your_authentication_app_and_enter_the_code')} - - + + - - {invalidAttempt && {t('Invalid_password')}} + + {invalidAttempt && {t('Invalid_password')}} diff --git a/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx b/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx index 57ebffdbcf39..3f001b158d72 100644 --- a/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx +++ b/apps/meteor/client/sidebar/header/CreateChannel/CreateChannelModal.tsx @@ -1,4 +1,18 @@ -import { Box, Modal, Button, TextInput, Icon, Field, ToggleSwitch, FieldGroup } from '@rocket.chat/fuselage'; +import { + Box, + Modal, + Button, + TextInput, + Icon, + Field, + ToggleSwitch, + FieldGroup, + FieldLabel, + FieldRow, + FieldError, + FieldHint, + FieldDescription, +} from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { @@ -194,10 +208,10 @@ const CreateChannelModal = ({ teamId = '', onClose }: CreateChannelModalProps): - + {t('Channel_name')} - - + + - + {errors.name && ( - + {errors.name.message} - + )} - {t('Topic')} - + {t('Topic')} + - - {t('Channel_what_is_this_channel_about')} + + {t('Channel_what_is_this_channel_about')} - {t('Private')} - + {t('Private')} + {isPrivate ? t('Only_invited_users_can_acess_this_channel') : t('Everyone_can_access_this_channel')} - + - {t('Federation_Matrix_Federated')} - {t(getFederationHintKey(federatedModule, federationEnabled))} + {t('Federation_Matrix_Federated')} + {t(getFederationHintKey(federatedModule, federationEnabled))} - {t('Read_only')} - + {t('Read_only')} + {readOnly ? t('Only_authorized_users_can_write_new_messages') : t('All_users_in_the_channel_can_write_new_messages')} - + - {t('Encrypted')} - + {t('Encrypted')} + {isPrivate ? t('Encrypted_channel_Description') : t('Encrypted_not_available')} - + - {t('Broadcast')} - {t('Broadcast_channel_Description')} + {t('Broadcast')} + {t('Broadcast_channel_Description')} - {t('Add_members')} + {t('Add_members')} void }): ReactElement => - + {t('Teams_New_Name_Label')} - - + + void }): ReactElement => aria-describedby={`${nameId}-error`} aria-required='true' /> - + {errors?.name && ( - + {errors.name.message} - + )} - + {t('Teams_New_Description_Label')}{' '} ({t('optional')}) - - + + - + - {t('Teams_New_Private_Label')} - + {t('Teams_New_Private_Label')} + {isPrivate ? t('Teams_New_Private_Description_Enabled') : t('Teams_New_Private_Description_Disabled')} - + void }): ReactElement => - {t('Teams_New_Read_only_Label')} - + {t('Teams_New_Read_only_Label')} + {readOnly ? t('Only_authorized_users_can_write_new_messages') : t('Teams_New_Read_only_Description')} - + void }): ReactElement => - {t('Teams_New_Encrypted_Label')} - + {t('Teams_New_Encrypted_Label')} + {isPrivate ? t('Teams_New_Encrypted_Description_Enabled') : t('Teams_New_Encrypted_Description_Disabled')} - + void }): ReactElement => - {t('Teams_New_Broadcast_Label')} - {t('Teams_New_Broadcast_Description')} + {t('Teams_New_Broadcast_Label')} + {t('Teams_New_Broadcast_Description')} void }): ReactElement => - + {t('Teams_New_Add_members_Label')}{' '} ({t('optional')}) - + - {t('StatusMessage')} - + {t('StatusMessage')} + } /> - - {!allowUserStatusMessageChange && {t('StatusMessage_Change_Disabled')}} - {statusTextError} + + {!allowUserStatusMessageChange && {t('StatusMessage_Change_Disabled')}} + {statusTextError} diff --git a/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationManageServerModal.tsx b/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationManageServerModal.tsx index a0f90a7d2f2f..6ea69ce6c037 100644 --- a/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationManageServerModal.tsx +++ b/apps/meteor/client/sidebar/header/MatrixFederationSearch/MatrixFederationManageServerModal.tsx @@ -1,4 +1,16 @@ -import { Divider, Modal, ButtonGroup, Button, Field, TextInput, Throbber } from '@rocket.chat/fuselage'; +import { + Divider, + Modal, + ButtonGroup, + Button, + Field, + TextInput, + Throbber, + FieldLabel, + FieldRow, + FieldError, + FieldHint, +} from '@rocket.chat/fuselage'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useSetModal, useTranslation, useEndpoint, useToastMessageDispatch } from '@rocket.chat/ui-contexts'; import { useMutation, useQueryClient } from '@tanstack/react-query'; @@ -63,8 +75,8 @@ const MatrixFederationAddServerModal: VFC = - {t('Server_name')} - + {t('Server_name')} + = {!isLoading && t('Add')} {isLoading && } - - {isError && errorKey && {t(errorKey)}} - {t('Federation_Example_matrix_server')} + + {isError && errorKey && {t(errorKey)}} + {t('Federation_Example_matrix_server')} {!isLoadingServerList && data?.servers && } diff --git a/apps/meteor/client/views/account/featurePreview/AccountFeaturePreviewPage.tsx b/apps/meteor/client/views/account/featurePreview/AccountFeaturePreviewPage.tsx index 715f6fb9b125..29b2a796953e 100644 --- a/apps/meteor/client/views/account/featurePreview/AccountFeaturePreviewPage.tsx +++ b/apps/meteor/client/views/account/featurePreview/AccountFeaturePreviewPage.tsx @@ -3,13 +3,16 @@ import { ButtonGroup, Button, Box, - Field, ToggleSwitch, - FieldGroup, States, StatesIcon, StatesTitle, Accordion, + Field, + FieldGroup, + FieldLabel, + FieldRow, + FieldHint, } from '@rocket.chat/fuselage'; import type { FeaturePreviewProps } from '@rocket.chat/ui-client'; import { useFeaturePreviewList } from '@rocket.chat/ui-client'; @@ -104,12 +107,12 @@ const AccountFeaturePreviewPage = () => { - {t(feature.i18n)} - + {t(feature.i18n)} + - + - {feature.description && {t(feature.description)}} + {feature.description && {t(feature.description)}} {feature.imageUrl && } diff --git a/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx b/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx index 71d025d792cd..54806d879aa1 100644 --- a/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx +++ b/apps/meteor/client/views/account/integrations/AccountIntegrationsPage.tsx @@ -1,6 +1,6 @@ import type { IWebdavAccountIntegration } from '@rocket.chat/core-typings'; import type { SelectOption } from '@rocket.chat/fuselage'; -import { SelectLegacy, Box, Field, Button } from '@rocket.chat/fuselage'; +import { SelectLegacy, Box, Button, Field, FieldLabel, FieldRow } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useEndpoint, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -38,8 +38,8 @@ const AccountIntegrationsPage = (): ReactElement => { - {t('WebDAV_Accounts')} - + {t('WebDAV_Accounts')} + { - + diff --git a/apps/meteor/client/views/account/omnichannel/PreferencesConversationTranscript.tsx b/apps/meteor/client/views/account/omnichannel/PreferencesConversationTranscript.tsx index fb1903806fec..9fccaef4593e 100644 --- a/apps/meteor/client/views/account/omnichannel/PreferencesConversationTranscript.tsx +++ b/apps/meteor/client/views/account/omnichannel/PreferencesConversationTranscript.tsx @@ -1,4 +1,4 @@ -import { Accordion, Box, Field, FieldGroup, Tag, ToggleSwitch } from '@rocket.chat/fuselage'; +import { Accordion, Box, Field, FieldGroup, FieldLabel, FieldRow, FieldHint, Tag, ToggleSwitch } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useTranslation, usePermission } from '@rocket.chat/ui-contexts'; import React from 'react'; @@ -24,7 +24,7 @@ const PreferencesConversationTranscript = () => { - + {t('Omnichannel_transcript_pdf')} @@ -32,16 +32,16 @@ const PreferencesConversationTranscript = () => { {!canSendTranscriptPDF && hasLicense && {t('No_permission')}} - - + + - + - {t('Accounts_Default_User_Preferences_omnichannelTranscriptPDF_Description')} + {t('Accounts_Default_User_Preferences_omnichannelTranscriptPDF_Description')} - + {t('Omnichannel_transcript_email')} {!canSendTranscriptEmail && ( @@ -50,16 +50,16 @@ const PreferencesConversationTranscript = () => { )} - - + + - + - {t('Accounts_Default_User_Preferences_omnichannelTranscriptEmail_Description')} + {t('Accounts_Default_User_Preferences_omnichannelTranscriptEmail_Description')}
diff --git a/apps/meteor/client/views/account/preferences/PreferencesGlobalSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesGlobalSection.tsx index 4e616072d185..d09492fdc5a6 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesGlobalSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesGlobalSection.tsx @@ -1,5 +1,5 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { Accordion, Field, FieldGroup, MultiSelect } from '@rocket.chat/fuselage'; +import { Accordion, Field, FieldGroup, FieldLabel, FieldRow, MultiSelect } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useUserPreference, useTranslation } from '@rocket.chat/ui-contexts'; import React from 'react'; @@ -18,8 +18,8 @@ const PreferencesGlobalSection = () => { - {t('Dont_ask_me_again_list')} - + {t('Dont_ask_me_again_list')} + { )} /> - + diff --git a/apps/meteor/client/views/account/preferences/PreferencesHighlightsSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesHighlightsSection.tsx index 8c05a92bad47..85bfc9072b12 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesHighlightsSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesHighlightsSection.tsx @@ -1,4 +1,4 @@ -import { Accordion, Field, FieldGroup, TextAreaInput } from '@rocket.chat/fuselage'; +import { Accordion, Field, FieldGroup, FieldLabel, FieldRow, FieldHint, TextAreaInput } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; import React from 'react'; @@ -14,11 +14,11 @@ const PreferencesHighlightsSection = () => { - {t('Highlights_List')} - + {t('Highlights_List')} + - - {t('Highlights_How_To')} + + {t('Highlights_How_To')} diff --git a/apps/meteor/client/views/account/preferences/PreferencesLocalizationSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesLocalizationSection.tsx index 2faaa9da89c2..0dc6e25f1ac3 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesLocalizationSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesLocalizationSection.tsx @@ -1,5 +1,5 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { Accordion, Field, Select, FieldGroup } from '@rocket.chat/fuselage'; +import { Accordion, Field, FieldGroup, FieldLabel, FieldRow, Select } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useLanguages, useTranslation } from '@rocket.chat/ui-contexts'; import React, { useMemo } from 'react'; @@ -23,8 +23,8 @@ const PreferencesLocalizationSection = () => { - {t('Language')} - + {t('Language')} + { )} /> - - {t('Enter_Behaviour_Description')} + + {t('Enter_Behaviour_Description')} diff --git a/apps/meteor/client/views/account/preferences/PreferencesMyDataSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesMyDataSection.tsx index 0775b07cec3e..0b82d7441323 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesMyDataSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesMyDataSection.tsx @@ -1,4 +1,4 @@ -import { Accordion, Field, FieldGroup, ButtonGroup, Button, Box } from '@rocket.chat/fuselage'; +import { Accordion, Field, FieldGroup, FieldRow, ButtonGroup, Button, Box } from '@rocket.chat/fuselage'; import { useSetModal, useToastMessageDispatch, useMethod, useTranslation } from '@rocket.chat/ui-contexts'; import React, { useCallback } from 'react'; @@ -77,7 +77,7 @@ const PreferencesMyDataSection = () => { - + - + diff --git a/apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx index e0a6017e7efe..2643eab0ebc7 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesNotificationsSection.tsx @@ -1,5 +1,5 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { Accordion, Field, Select, FieldGroup, ToggleSwitch, Button, Box } from '@rocket.chat/fuselage'; +import { Accordion, Field, FieldLabel, FieldRow, FieldHint, Select, FieldGroup, ToggleSwitch, Button, Box } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useUserPreference, useSetting, useTranslation } from '@rocket.chat/ui-contexts'; @@ -92,8 +92,8 @@ const PreferencesNotificationsSection = () => { - {t('Desktop_Notifications')} - + {t('Desktop_Notifications')} + {notificationsPermission === 'denied' && t('Desktop_Notifications_Disabled')} {notificationsPermission === 'granted' && ( <> @@ -109,12 +109,12 @@ const PreferencesNotificationsSection = () => { )} - + - {t('Notification_RequireInteraction')} - + {t('Notification_RequireInteraction')} + { /> )} /> - + - {t('Only_works_with_chrome_version_greater_50')} + {t('Only_works_with_chrome_version_greater_50')} - {t('Notification_Desktop_Default_For')} - + {t('Notification_Desktop_Default_For')} + { )} /> - + - {t('Email_Notification_Mode')} - + {t('Email_Notification_Mode')} + { /> )} /> - - + + {canChangeEmailNotification && t('You_need_to_verifiy_your_email_address_to_get_notications')} {!canChangeEmailNotification && t('Email_Notifications_Change_Disabled')} - + {showNewLoginEmailPreference && ( - {t('Receive_Login_Detection_Emails')} - + {t('Receive_Login_Detection_Emails')} + { /> )} /> - + - {t('Receive_Login_Detection_Emails_Description')} + {t('Receive_Login_Detection_Emails_Description')} )} {showCalendarPreference && ( - {t('Notify_Calendar_Events')} - + {t('Notify_Calendar_Events')} + { )} /> - + )} {showMobileRinging && ( - {t('VideoConf_Mobile_Ringing')} - + {t('VideoConf_Mobile_Ringing')} + { )} /> - + )} diff --git a/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx index 7b5f051fc017..223d67fd7f95 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesSoundSection.tsx @@ -1,5 +1,5 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { Accordion, Field, Select, FieldGroup, ToggleSwitch, Tooltip, Box } from '@rocket.chat/fuselage'; +import { Accordion, Field, FieldLabel, FieldRow, Select, FieldGroup, ToggleSwitch, Tooltip, Box } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useTranslation, useCustomSound } from '@rocket.chat/ui-contexts'; import type { ChangeEvent } from 'react'; @@ -23,8 +23,8 @@ const PreferencesSoundSection = () => { - {t('New_Room_Notification')} - + {t('New_Room_Notification')} + { /> )} /> - + - {t('New_Message_Notification')} - + {t('New_Message_Notification')} + { /> )} /> - + - {t('Mute_Focused_Conversations')} - + {t('Mute_Focused_Conversations')} + { )} /> - + - {t('Notifications_Sound_Volume')} - + {t('Notifications_Sound_Volume')} + { {notificationsSoundVolume} - + diff --git a/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx index 3a075c50f7d7..89575e36aa6b 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesUserPresenceSection.tsx @@ -1,4 +1,4 @@ -import { Accordion, Field, NumberInput, FieldGroup, ToggleSwitch, Box } from '@rocket.chat/fuselage'; +import { Accordion, Field, FieldLabel, FieldRow, NumberInput, FieldGroup, ToggleSwitch, Box } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; import React from 'react'; @@ -16,8 +16,8 @@ const PreferencesUserPresenceSection = () => { - {t('Enable_Auto_Away')} - + {t('Enable_Auto_Away')} + { )} /> - + - {t('Idle_Time_Limit')} - + {t('Idle_Time_Limit')} + - + diff --git a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx index 1a326db4544d..ed97b95caae8 100644 --- a/apps/meteor/client/views/account/profile/AccountProfileForm.tsx +++ b/apps/meteor/client/views/account/profile/AccountProfileForm.tsx @@ -1,5 +1,17 @@ import type { IUser } from '@rocket.chat/core-typings'; -import { Field, FieldGroup, TextInput, TextAreaInput, Box, Icon, Button } from '@rocket.chat/fuselage'; +import { + Field, + FieldGroup, + FieldLabel, + FieldRow, + FieldError, + FieldHint, + TextInput, + TextAreaInput, + Box, + Icon, + Button, +} from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { CustomFieldsForm } from '@rocket.chat/ui-client'; import { @@ -139,10 +151,10 @@ const AccountProfileForm = (props: AllHTMLAttributes): ReactEle - + {t('Name')} - - + + ): ReactEle /> )} /> - + {errors.name && ( - + {errors.name.message} - + )} - {!allowRealNameChange && {t('RealName_Change_Disabled')}} + {!allowRealNameChange && {t('RealName_Change_Disabled')}} - + {t('Username')} - - + + ): ReactEle /> )} /> - + {errors?.username && ( - + {errors.username.message} - + )} - {!canChangeUsername && {t('Username_Change_Disabled')}} + {!canChangeUsername && {t('Username_Change_Disabled')}} - {t('StatusMessage')} - + {t('StatusMessage')} + ): ReactEle /> )} /> - + {errors?.statusText && ( - + {errors?.statusText.message} - + )} - {!allowUserStatusMessageChange && {t('StatusMessage_Change_Disabled')}} + {!allowUserStatusMessageChange && {t('StatusMessage_Change_Disabled')}} - {t('Nickname')} - + {t('Nickname')} + ): ReactEle } /> )} /> - + - {t('Bio')} - + {t('Bio')} + ): ReactEle /> )} /> - + {errors?.bio && ( - + {errors.bio.message} - + )} - + {t('Email')} - - + + ): ReactEle {t('Resend_verification_email')} )} - + {errors.email && ( - + {errors?.email?.message} - + )} - {!allowEmailChange && {t('Email_Change_Disabled')}} + {!allowEmailChange && {t('Email_Change_Disabled')}} {customFieldsMetadata && } diff --git a/apps/meteor/client/views/account/profile/ActionConfirmModal.tsx b/apps/meteor/client/views/account/profile/ActionConfirmModal.tsx index 4d73f04c2973..286bd564dd18 100644 --- a/apps/meteor/client/views/account/profile/ActionConfirmModal.tsx +++ b/apps/meteor/client/views/account/profile/ActionConfirmModal.tsx @@ -1,4 +1,4 @@ -import { Box, PasswordInput, TextInput, FieldGroup, Field } from '@rocket.chat/fuselage'; +import { Box, PasswordInput, TextInput, FieldGroup, Field, FieldRow, FieldError } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { FC } from 'react'; import React, { useState, useCallback } from 'react'; @@ -50,11 +50,11 @@ const ActionConfirmModal: FC = ({ isPassword, onConfirm {isPassword ? t('Enter_your_password_to_delete_your_account') : t('Enter_your_username_to_delete_your_account')} - + {isPassword && } {!isPassword && } - - {inputError} + + {inputError} diff --git a/apps/meteor/client/views/account/security/EndToEnd.tsx b/apps/meteor/client/views/account/security/EndToEnd.tsx index 78410e519e2c..72213f3202ba 100644 --- a/apps/meteor/client/views/account/security/EndToEnd.tsx +++ b/apps/meteor/client/views/account/security/EndToEnd.tsx @@ -1,4 +1,4 @@ -import { Box, Margins, PasswordInput, Field, FieldGroup, Button } from '@rocket.chat/fuselage'; +import { Box, Margins, PasswordInput, Field, FieldGroup, FieldLabel, FieldRow, FieldError, FieldHint, Button } from '@rocket.chat/fuselage'; import { useToastMessageDispatch, useMethod, useTranslation, useLogout } from '@rocket.chat/ui-contexts'; import type { ComponentProps, ReactElement } from 'react'; import React, { useCallback, useEffect } from 'react'; @@ -71,20 +71,20 @@ const EndToEnd = (props: ComponentProps): ReactElement => { - {t('New_encryption_password')} - + {t('New_encryption_password')} + - - {!keysExist && {t('EncryptionKey_Change_Disabled')}} + + {!keysExist && {t('EncryptionKey_Change_Disabled')}} {hasTypedPassword && ( - {t('Confirm_new_encryption_password')} + {t('Confirm_new_encryption_password')} ): ReactElement => { placeholder={t('Confirm_New_Password_Placeholder')} aria-labelledby='Confirm_new_encryption_password' /> - {errors.passwordConfirm && {errors.passwordConfirm.message}} + {errors.passwordConfirm && {errors.passwordConfirm.message}} )} diff --git a/apps/meteor/client/views/account/tokens/AccountTokensTable/AddToken.tsx b/apps/meteor/client/views/account/tokens/AccountTokensTable/AddToken.tsx index 4d38d2e68fc6..97d2a8163cab 100644 --- a/apps/meteor/client/views/account/tokens/AccountTokensTable/AddToken.tsx +++ b/apps/meteor/client/views/account/tokens/AccountTokensTable/AddToken.tsx @@ -1,4 +1,4 @@ -import { Box, TextInput, Button, Field, FieldGroup, Margins, CheckBox } from '@rocket.chat/fuselage'; +import { Box, TextInput, Button, Field, FieldGroup, FieldLabel, FieldRow, Margins, CheckBox } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useSetModal, useToastMessageDispatch, useUserId, useMethod, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -56,18 +56,18 @@ const AddToken = ({ reload, ...props }: { reload: () => void }): ReactElement => return ( - + - - + + - {t('Ignore_Two_Factor_Authentication')} - + {t('Ignore_Two_Factor_Authentication')} + ); diff --git a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx b/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx index 09548b3349a9..41e8f300d898 100644 --- a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx +++ b/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepOneModal.tsx @@ -1,4 +1,4 @@ -import { Modal, Box, Field, TextInput, CheckBox, ButtonGroup, Button } from '@rocket.chat/fuselage'; +import { Modal, Box, Field, FieldLabel, FieldRow, TextInput, CheckBox, ButtonGroup, Button } from '@rocket.chat/fuselage'; import { ExternalLink } from '@rocket.chat/ui-client'; import { useEndpoint, useSetModal, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import React from 'react'; @@ -66,14 +66,14 @@ const RegisterWorkspaceSetupStepOneModal = ({ {t('RegisterWorkspace_Setup_Subtitle')} - {t('RegisterWorkspace_Setup_Label')} - + {t('RegisterWorkspace_Setup_Label')} + { setEmail((e.target as HTMLInputElement).value); }} /> - + diff --git a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepTwoModal.tsx b/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepTwoModal.tsx index fa1640bc8dfb..734f07442f11 100644 --- a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepTwoModal.tsx +++ b/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceSetupModal/RegisterWorkspaceSetupStepTwoModal.tsx @@ -1,4 +1,4 @@ -import { Modal, Box, Field, TextInput } from '@rocket.chat/fuselage'; +import { Modal, Box, Field, FieldLabel, FieldRow, TextInput } from '@rocket.chat/fuselage'; import { useEndpoint, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import React, { useCallback, useEffect } from 'react'; import { Trans } from 'react-i18next'; @@ -81,10 +81,10 @@ const RegisterWorkspaceSetupStepTwoModal = ({ email, step, setStep, onClose, int {t('RegisterWorkspace_Setup_Email_Verification')} - {t('Security_code')} - + {t('Security_code')} + - + diff --git a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceTokenModal.tsx b/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceTokenModal.tsx index 12ba3798c97e..89728457226b 100644 --- a/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceTokenModal.tsx +++ b/apps/meteor/client/views/admin/cloud/modals/RegisterWorkspaceTokenModal.tsx @@ -1,4 +1,4 @@ -import { Box, Button, ButtonGroup, Field, Modal, TextInput } from '@rocket.chat/fuselage'; +import { Box, Button, ButtonGroup, Field, FieldLabel, FieldRow, FieldError, Modal, TextInput } from '@rocket.chat/fuselage'; import { useMethod, useSetModal, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import type { ChangeEvent } from 'react'; import React, { useState } from 'react'; @@ -79,11 +79,11 @@ const RegisterWorkspaceTokenModal = ({ onClose, onStatusChange, ...props }: Regi
{`2. ${t('RegisterWorkspace_Token_Step_Two')}`} - {t('Registration_Token')} - + {t('Registration_Token')} + - - {error && {t('Token_Not_Recognized')}} + + {error && {t('Token_Not_Recognized')}} diff --git a/apps/meteor/client/views/admin/customEmoji/AddCustomEmoji.tsx b/apps/meteor/client/views/admin/customEmoji/AddCustomEmoji.tsx index eaeaccd3e395..8fae8501327a 100644 --- a/apps/meteor/client/views/admin/customEmoji/AddCustomEmoji.tsx +++ b/apps/meteor/client/views/admin/customEmoji/AddCustomEmoji.tsx @@ -1,4 +1,4 @@ -import { Box, Button, ButtonGroup, Margins, TextInput, Field, Icon } from '@rocket.chat/fuselage'; +import { Box, Button, ButtonGroup, Margins, TextInput, Field, FieldLabel, FieldRow, FieldError, Icon } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement, ChangeEvent } from 'react'; import React, { useCallback, useState } from 'react'; @@ -78,28 +78,28 @@ const AddCustomEmoji = ({ close, onChange, ...props }: AddCustomEmojiProps): Rea <> - {t('Name')} - + {t('Name')} + - - {errors.name && {t('error-the-field-is-required', { field: t('Name') })}} + + {errors.name && {t('error-the-field-is-required', { field: t('Name') })}} - {t('Aliases')} - + {t('Aliases')} + - - {errors.aliases && {t('Custom_Emoji_Error_Same_Name_And_Alias')}} + + {errors.aliases && {t('Custom_Emoji_Error_Same_Name_And_Alias')}} - + {t('Custom_Emoji')} {/* FIXME: replace to IconButton */} - - {errors.emoji && {t('error-the-field-is-required', { field: t('Custom_Emoji') })}} + + {errors.emoji && {t('error-the-field-is-required', { field: t('Custom_Emoji') })}} {newEmojiPreview && ( diff --git a/apps/meteor/client/views/admin/customEmoji/EditCustomEmoji.tsx b/apps/meteor/client/views/admin/customEmoji/EditCustomEmoji.tsx index e11b5722fe0a..f561001a20be 100644 --- a/apps/meteor/client/views/admin/customEmoji/EditCustomEmoji.tsx +++ b/apps/meteor/client/views/admin/customEmoji/EditCustomEmoji.tsx @@ -1,4 +1,16 @@ -import { Box, Button, ButtonGroup, Margins, TextInput, Field, FieldGroup, IconButton } from '@rocket.chat/fuselage'; +import { + Box, + Button, + ButtonGroup, + Margins, + TextInput, + Field, + FieldGroup, + FieldLabel, + FieldRow, + FieldError, + IconButton, +} from '@rocket.chat/fuselage'; import { useSetModal, useToastMessageDispatch, useAbsoluteUrl, useTranslation } from '@rocket.chat/ui-contexts'; import type { FC, ChangeEvent } from 'react'; import React, { useCallback, useState, useMemo, useEffect } from 'react'; @@ -134,24 +146,24 @@ const EditCustomEmoji: FC = ({ close, onChange, data, ...p - {t('Name')} - + {t('Name')} + - - {errors.name && {t('error-the-field-is-required', { field: t('Name') })}} + + {errors.name && {t('error-the-field-is-required', { field: t('Name') })}} - {t('Aliases')} - + {t('Aliases')} + - - {errors.aliases && {t('Custom_Emoji_Error_Same_Name_And_Alias')}} + + {errors.aliases && {t('Custom_Emoji_Error_Same_Name_And_Alias')}} - + {t('Custom_Emoji')} - + {newEmojiPreview && ( diff --git a/apps/meteor/client/views/admin/customSounds/AddCustomSound.tsx b/apps/meteor/client/views/admin/customSounds/AddCustomSound.tsx index bf391e8feae1..434cb1769db6 100644 --- a/apps/meteor/client/views/admin/customSounds/AddCustomSound.tsx +++ b/apps/meteor/client/views/admin/customSounds/AddCustomSound.tsx @@ -1,4 +1,4 @@ -import { Field, TextInput, Box, Icon, Margins, Button, ButtonGroup } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, TextInput, Box, Icon, Margins, Button, ButtonGroup } from '@rocket.chat/fuselage'; import { useToastMessageDispatch, useMethod, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement, FormEvent } from 'react'; import React, { useState, useCallback } from 'react'; @@ -86,17 +86,17 @@ const AddCustomSound = ({ goToNew, close, onChange, ...props }: AddCustomSoundPr <> - {t('Name')} - + {t('Name')} + ): void => setName(e.currentTarget.value)} placeholder={t('Name')} /> - + - {t('Sound_File_mp3')} + {t('Sound_File_mp3')} {/* FIXME: replace to IconButton */} diff --git a/apps/meteor/client/views/admin/customSounds/EditSound.tsx b/apps/meteor/client/views/admin/customSounds/EditSound.tsx index d1d214d15e20..44b728821c4c 100644 --- a/apps/meteor/client/views/admin/customSounds/EditSound.tsx +++ b/apps/meteor/client/views/admin/customSounds/EditSound.tsx @@ -1,4 +1,4 @@ -import { Box, Button, ButtonGroup, Margins, TextInput, Field, IconButton } from '@rocket.chat/fuselage'; +import { Box, Button, ButtonGroup, Margins, TextInput, Field, FieldLabel, FieldRow, IconButton } from '@rocket.chat/fuselage'; import { useSetModal, useToastMessageDispatch, useMethod, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement, SyntheticEvent } from 'react'; import React, { useCallback, useState, useMemo, useEffect } from 'react'; @@ -120,17 +120,17 @@ function EditSound({ close, onChange, data, ...props }: EditSoundProps): ReactEl <> - {t('Name')} - + {t('Name')} + ): void => setName(e.currentTarget.value)} placeholder={t('Name')} /> - + - {t('Sound_File_mp3')} + {t('Sound_File_mp3')} diff --git a/apps/meteor/client/views/admin/customUserStatus/CustomUserStatusForm.tsx b/apps/meteor/client/views/admin/customUserStatus/CustomUserStatusForm.tsx index 2c832e8299ec..9796438fde7e 100644 --- a/apps/meteor/client/views/admin/customUserStatus/CustomUserStatusForm.tsx +++ b/apps/meteor/client/views/admin/customUserStatus/CustomUserStatusForm.tsx @@ -1,6 +1,6 @@ import type { IUserStatus } from '@rocket.chat/core-typings'; import type { SelectOption } from '@rocket.chat/fuselage'; -import { FieldGroup, Button, ButtonGroup, TextInput, Field, Select } from '@rocket.chat/fuselage'; +import { FieldGroup, Button, ButtonGroup, TextInput, Field, FieldLabel, FieldRow, FieldError, Select } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useSetModal, useRoute, useToastMessageDispatch, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -92,23 +92,23 @@ const CustomUserStatusForm = ({ onClose, onReload, status }: CustomUserStatusFor - {t('Name')} - + {t('Name')} + - - {errors?.name && {t('error-the-field-is-required', { field: t('Name') })}} + + {errors?.name && {t('error-the-field-is-required', { field: t('Name') })}} - {t('Presence')} - + {t('Presence')} + [extension, extension]) || []} @@ -61,7 +61,7 @@ const AssignAgentModal: FC = ({ existingExtension, close placeholder={t('Select_an_option')} onChange={(value) => setExtension(String(value))} /> - + diff --git a/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.tsx index bd9de953eb30..b674e589d446 100644 --- a/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/ActionSettingInput.tsx @@ -1,4 +1,4 @@ -import { Button, Field } from '@rocket.chat/fuselage'; +import { Button, FieldRow, FieldHint } from '@rocket.chat/fuselage'; import type { ServerMethods, TranslationKey } from '@rocket.chat/ui-contexts'; import { useMethod, useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -29,12 +29,12 @@ function ActionSettingInput({ _id, actionText, value, disabled, sectionChanged } return ( <> - + - - {sectionChanged && {t('Save_to_enable_this_action')}} + + {sectionChanged && {t('Save_to_enable_this_action')}} ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/AssetSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/AssetSettingInput.tsx index 5871296cee6a..f3122a23295b 100644 --- a/apps/meteor/client/views/admin/settings/inputs/AssetSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/AssetSettingInput.tsx @@ -1,4 +1,4 @@ -import { Button, Field, Icon } from '@rocket.chat/fuselage'; +import { Button, FieldLabel, FieldRow, Icon } from '@rocket.chat/fuselage'; import { Random } from '@rocket.chat/random'; import { useToastMessageDispatch, useEndpoint, useTranslation, useUpload } from '@rocket.chat/ui-contexts'; import type { ChangeEventHandler, DragEvent, ReactElement, SyntheticEvent } from 'react'; @@ -58,10 +58,10 @@ function AssetSettingInput({ _id, label, value, asset, fileConstraints }: AssetS return ( <> - + {label} - - + +
{value?.url ? (
- + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/BooleanSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/BooleanSettingInput.tsx index acac16b5b7e8..308e781e8e46 100644 --- a/apps/meteor/client/views/admin/settings/inputs/BooleanSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/BooleanSettingInput.tsx @@ -1,4 +1,4 @@ -import { Field, ToggleSwitch } from '@rocket.chat/fuselage'; +import { FieldLabel, FieldRow, ToggleSwitch } from '@rocket.chat/fuselage'; import type { ReactElement, SyntheticEvent } from 'react'; import React from 'react'; @@ -30,7 +30,7 @@ function BooleanSettingInput({ }; return ( - + - + {label} - + {hasResetButton && } - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/CodeSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/CodeSettingInput.tsx index 2b615a63b8d5..85698b66e2b7 100644 --- a/apps/meteor/client/views/admin/settings/inputs/CodeSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/CodeSettingInput.tsx @@ -1,4 +1,4 @@ -import { Box, Field, Flex } from '@rocket.chat/fuselage'; +import { Box, FieldLabel, FieldHint, Flex } from '@rocket.chat/fuselage'; import type { ReactElement } from 'react'; import React from 'react'; @@ -43,12 +43,12 @@ function CodeSettingInput({ <> - + {label} - + {hasResetButton && } - {hint && {hint}} + {hint && {hint}} - + {label} - + {hasResetButton && } - + {editor === 'color' && ( @@ -104,9 +104,9 @@ function ColorSettingInput({ options={allowedTypes.map((type) => [type, t(type)])} /> - + - Variable name: {_id.replace(/theme-color-/, '@')} + Variable name: {_id.replace(/theme-color-/, '@')} ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/FontSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/FontSettingInput.tsx index 2d7a93b9c96f..35b255b4e756 100644 --- a/apps/meteor/client/views/admin/settings/inputs/FontSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/FontSettingInput.tsx @@ -1,4 +1,4 @@ -import { Box, Field, Flex, TextInput } from '@rocket.chat/fuselage'; +import { Box, FieldLabel, FieldRow, Flex, TextInput } from '@rocket.chat/fuselage'; import type { FormEventHandler, ReactElement } from 'react'; import React from 'react'; @@ -36,13 +36,13 @@ function FontSettingInput({ <> - + {label} - + {hasResetButton && } - + - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/GenericSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/GenericSettingInput.tsx index 46ffc61a8f3b..32425a57c698 100644 --- a/apps/meteor/client/views/admin/settings/inputs/GenericSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/GenericSettingInput.tsx @@ -1,4 +1,4 @@ -import { Box, Field, Flex, TextInput } from '@rocket.chat/fuselage'; +import { Box, FieldLabel, FieldRow, Flex, TextInput } from '@rocket.chat/fuselage'; import type { FormEventHandler, ReactElement } from 'react'; import React from 'react'; @@ -36,13 +36,13 @@ function GenericSettingInput({ <> - + {label} - + {hasResetButton && } - + - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/IntSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/IntSettingInput.tsx index 03f837117223..cd5abd54f481 100644 --- a/apps/meteor/client/views/admin/settings/inputs/IntSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/IntSettingInput.tsx @@ -1,4 +1,4 @@ -import { Box, Field, Flex, InputBox } from '@rocket.chat/fuselage'; +import { Box, FieldLabel, FieldRow, Flex, InputBox } from '@rocket.chat/fuselage'; import type { FormEventHandler, ReactElement } from 'react'; import React from 'react'; @@ -37,13 +37,13 @@ function IntSettingInput({ <> - + {label} - + {hasResetButton && } - + - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx index 770edd5c12a6..8bfe977aaf39 100644 --- a/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/LanguageSettingInput.tsx @@ -1,4 +1,4 @@ -import { Box, Field, Flex, Select } from '@rocket.chat/fuselage'; +import { Box, FieldLabel, FieldRow, Flex, Select } from '@rocket.chat/fuselage'; import { useLanguages } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; import React from 'react'; @@ -40,13 +40,13 @@ function LanguageSettingInput({ <> - + {label} - + {hasResetButton && } - + handleChange(String(value))} options={values.map(({ key, label }) => [key, label])} /> - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.tsx index 114503c959ed..bc8d8062d8a2 100644 --- a/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/MultiSelectSettingInput.tsx @@ -1,4 +1,4 @@ -import { Field, Flex, Box, MultiSelectFiltered, MultiSelect } from '@rocket.chat/fuselage'; +import { FieldLabel, Flex, Box, MultiSelectFiltered, MultiSelect } from '@rocket.chat/fuselage'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -45,9 +45,9 @@ function MultiSelectSettingInput({ <> - + {label} - + {hasResetButton && } diff --git a/apps/meteor/client/views/admin/settings/inputs/PasswordSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/PasswordSettingInput.tsx index 087d83b98a0d..b7d2c1d48d47 100644 --- a/apps/meteor/client/views/admin/settings/inputs/PasswordSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/PasswordSettingInput.tsx @@ -1,4 +1,4 @@ -import { Box, Field, Flex, PasswordInput } from '@rocket.chat/fuselage'; +import { Box, FieldLabel, FieldRow, Flex, PasswordInput } from '@rocket.chat/fuselage'; import type { EventHandler, ReactElement, SyntheticEvent } from 'react'; import React from 'react'; @@ -37,13 +37,13 @@ function PasswordSettingInput({ <> - + {label} - + {hasResetButton && } - + - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/RelativeUrlSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/RelativeUrlSettingInput.tsx index 0541ea81eb36..b94581706757 100644 --- a/apps/meteor/client/views/admin/settings/inputs/RelativeUrlSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/RelativeUrlSettingInput.tsx @@ -1,4 +1,4 @@ -import { Box, Field, Flex, UrlInput } from '@rocket.chat/fuselage'; +import { Box, FieldLabel, Flex, UrlInput } from '@rocket.chat/fuselage'; import { useAbsoluteUrl } from '@rocket.chat/ui-contexts'; import type { EventHandler, ReactElement, SyntheticEvent } from 'react'; import React from 'react'; @@ -40,9 +40,9 @@ function RelativeUrlSettingInput({ <> - + {label} - + {hasResetButton && } diff --git a/apps/meteor/client/views/admin/settings/inputs/RoomPickSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/RoomPickSettingInput.tsx index d44235afbde9..15423742ff91 100644 --- a/apps/meteor/client/views/admin/settings/inputs/RoomPickSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/RoomPickSettingInput.tsx @@ -1,5 +1,5 @@ import type { SettingValueRoomPick } from '@rocket.chat/core-typings'; -import { Box, Field, Flex } from '@rocket.chat/fuselage'; +import { Box, FieldLabel, FieldRow, Flex } from '@rocket.chat/fuselage'; import type { ReactElement } from 'react'; import React from 'react'; @@ -42,13 +42,13 @@ function RoomPickSettingInput({ <> - + {label} - + {hasResetButton && } - + - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx index 28014d65d375..a6fa88f7ffe7 100644 --- a/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/SelectSettingInput.tsx @@ -1,4 +1,4 @@ -import { Box, Field, Flex, Select } from '@rocket.chat/fuselage'; +import { Box, FieldLabel, FieldRow, Flex, Select } from '@rocket.chat/fuselage'; import type { TranslationKey } from '@rocket.chat/ui-contexts'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -43,13 +43,13 @@ function SelectSettingInput({ <> - + {label} - + {hasResetButton && } - + handleChange(String(value))} options={moment.tz.names().map((key) => [key, key])} /> - + ); } diff --git a/apps/meteor/client/views/admin/settings/inputs/StringSettingInput.tsx b/apps/meteor/client/views/admin/settings/inputs/StringSettingInput.tsx index 30b79e01683f..3d0ba78a127a 100644 --- a/apps/meteor/client/views/admin/settings/inputs/StringSettingInput.tsx +++ b/apps/meteor/client/views/admin/settings/inputs/StringSettingInput.tsx @@ -1,4 +1,4 @@ -import { Box, Field, Flex, TextAreaInput, TextInput } from '@rocket.chat/fuselage'; +import { Box, FieldLabel, FieldRow, Flex, TextAreaInput, TextInput } from '@rocket.chat/fuselage'; import type { EventHandler, ReactElement, SyntheticEvent } from 'react'; import React from 'react'; @@ -43,13 +43,13 @@ function StringSettingInput({ <> - + {label} - + {hasResetButton && } - + {multiline ? ( )} - + ); } diff --git a/apps/meteor/client/views/admin/users/AdminUserForm.tsx b/apps/meteor/client/views/admin/users/AdminUserForm.tsx index 334aca68b8f8..1912150b4a48 100644 --- a/apps/meteor/client/views/admin/users/AdminUserForm.tsx +++ b/apps/meteor/client/views/admin/users/AdminUserForm.tsx @@ -1,6 +1,10 @@ import type { AvatarObject, IUser, Serialized } from '@rocket.chat/core-typings'; import { Field, + FieldLabel, + FieldRow, + FieldError, + FieldHint, TextInput, TextAreaInput, PasswordInput, @@ -179,8 +183,8 @@ const UserForm = ({ userData, onReload, ...props }: AdminUserFormProps) => { )} - {t('Name')} - + {t('Name')} + { /> )} /> - + {errors?.name && ( - + {errors.name.message} - + )} - {t('Username')} - + {t('Username')} + { /> )} /> - + {errors?.username && ( - + {errors.username.message} - + )} - {t('Email')} - + {t('Email')} + { /> )} /> - + {errors?.email && ( - + {errors.email.message} - + )} - {t('Verified')} - + {t('Verified')} + } /> - + - {t('StatusMessage')} - + {t('StatusMessage')} + { /> )} /> - + {errors?.statusText && ( - + {errors.statusText.message} - + )} - {t('Bio')} - + {t('Bio')} + { /> )} /> - + {errors?.bio && ( - + {errors.bio.message} - + )} - {t('Nickname')} - + {t('Nickname')} + { } /> )} /> - + {!setRandomPassword && ( - {t('Password')} - + {t('Password')} + { /> )} /> - + {errors?.password && ( - + {errors.password.message} - + )} )} - {t('Require_password_change')} - + {t('Require_password_change')} + { /> )} /> - + - {t('Set_random_password_and_send_by_email')} - + {t('Set_random_password_and_send_by_email')} + { /> )} /> - + {!isSmtpEnabled && ( - )} - {t('Roles')} - + {t('Roles')} + {roleError && {roleError}} {!roleError && ( { )} /> )} - - {errors?.roles && {errors.roles.message}} + + {errors?.roles && {errors.roles.message}} - {t('Join_default_channels')} - + {t('Join_default_channels')} + { )} /> - + - {t('Send_welcome_email')} - + {t('Send_welcome_email')} + { /> )} /> - + {!isSmtpEnabled && ( - diff --git a/apps/meteor/client/views/e2e/EnterE2EPasswordModal.tsx b/apps/meteor/client/views/e2e/EnterE2EPasswordModal.tsx index 76d5f3b61e28..249ae6df5efa 100644 --- a/apps/meteor/client/views/e2e/EnterE2EPasswordModal.tsx +++ b/apps/meteor/client/views/e2e/EnterE2EPasswordModal.tsx @@ -1,4 +1,4 @@ -import { Box, PasswordInput, Field, FieldGroup } from '@rocket.chat/fuselage'; +import { Box, PasswordInput, Field, FieldGroup, FieldRow, FieldError } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -50,7 +50,7 @@ const EnterE2EPasswordModal = ({ - + - - {passwordError} + + {passwordError} diff --git a/apps/meteor/client/views/omnichannel/agents/AgentEdit.tsx b/apps/meteor/client/views/omnichannel/agents/AgentEdit.tsx index b6b536925ba1..aa5a917405b4 100644 --- a/apps/meteor/client/views/omnichannel/agents/AgentEdit.tsx +++ b/apps/meteor/client/views/omnichannel/agents/AgentEdit.tsx @@ -1,5 +1,17 @@ import type { ILivechatAgent, ILivechatDepartment, ILivechatDepartmentAgents } from '@rocket.chat/core-typings'; -import { Field, TextInput, Button, Box, MultiSelect, Icon, Select, ContextualbarFooter, ButtonGroup } from '@rocket.chat/fuselage'; +import { + Field, + FieldLabel, + FieldRow, + TextInput, + Button, + Box, + MultiSelect, + Icon, + Select, + ContextualbarFooter, + ButtonGroup, +} from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useToastMessageDispatch, useRoute, useSetting, useMethod, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts'; import type { FC, ReactElement } from 'react'; @@ -121,26 +133,26 @@ const AgentEdit: FC = ({ data, userDepartments, availableDepartm )} - {t('Name')} - + {t('Name')} + - + - {t('Username')} - + {t('Username')} + } /> - + - {t('Email')} - + {t('Email')} + } /> - + - {t('Departments')} - + {t('Departments')} + = ({ data, userDepartments, availableDepartm placeholder={t('Select_an_option')} onChange={handleDepartments} /> - + - {t('Status')} - + {t('Status')} + setChartName(String(value))} /> - + diff --git a/apps/meteor/client/views/omnichannel/analytics/DateRangePicker.tsx b/apps/meteor/client/views/omnichannel/analytics/DateRangePicker.tsx index b84996f168d4..40644b1f1b04 100644 --- a/apps/meteor/client/views/omnichannel/analytics/DateRangePicker.tsx +++ b/apps/meteor/client/views/omnichannel/analytics/DateRangePicker.tsx @@ -1,4 +1,4 @@ -import { Box, InputBox, Menu, Field } from '@rocket.chat/fuselage'; +import { Box, InputBox, Menu, Field, FieldLabel, FieldRow } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { Moment } from 'moment'; @@ -112,21 +112,21 @@ const DateRangePicker = ({ onChange = () => undefined, ...props }: DateRangePick - {t('Start')} - + {t('Start')} + - + - {t('End')} - + {t('End')} + - + diff --git a/apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx b/apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx index 9d5e176301a8..4983c5ca8837 100644 --- a/apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx +++ b/apps/meteor/client/views/omnichannel/appearance/AppearanceForm.tsx @@ -1,4 +1,16 @@ -import { Box, Field, TextInput, ToggleSwitch, Accordion, FieldGroup, InputBox, TextAreaInput, NumberInput } from '@rocket.chat/fuselage'; +import { + Box, + Field, + FieldLabel, + FieldRow, + TextInput, + ToggleSwitch, + Accordion, + FieldGroup, + InputBox, + TextAreaInput, + NumberInput, +} from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { FC, FormEvent } from 'react'; @@ -105,46 +117,46 @@ const AppearanceForm: FC = ({ values = {}, handlers = {} }) - {t('Title')} - + {t('Title')} + - + - {t('Title_bar_color')} - + {t('Title_bar_color')} + - + - {t('Message_Characther_Limit')} - + {t('Message_Characther_Limit')} + - + - + - + - {t('Show_agent_info')} - + {t('Show_agent_info')} + - + - {t('Show_agent_email')} - + {t('Show_agent_email')} + - + @@ -154,66 +166,66 @@ const AppearanceForm: FC = ({ values = {}, handlers = {} }) - {t('Display_offline_form')} - + {t('Display_offline_form')} + - + - {t('Offline_form_unavailable_message')} - + {t('Offline_form_unavailable_message')} + - + - {t('Offline_message')} - + {t('Offline_message')} + - + - {t('Title_offline')} - + {t('Title_offline')} + - + - {t('Title_bar_color_offline')} - + {t('Title_bar_color_offline')} + - + - {t('Email_address_to_send_offline_messages')} - + {t('Email_address_to_send_offline_messages')} + - + - {t('Offline_success_message')} - + {t('Offline_success_message')} + - + @@ -222,64 +234,64 @@ const AppearanceForm: FC = ({ values = {}, handlers = {} }) - {t('Enabled')} - + {t('Enabled')} + - + - {t('Show_name_field')} - + {t('Show_name_field')} + - + - {t('Show_email_field')} - + {t('Show_email_field')} + - + - {t('Livechat_registration_form_message')} - + {t('Livechat_registration_form_message')} + - + - {t('Conversation_finished_message')} - + {t('Conversation_finished_message')} + - + - {t('Conversation_finished_text')} - + {t('Conversation_finished_text')} + - + diff --git a/apps/meteor/client/views/omnichannel/currentChats/CustomFieldsList.tsx b/apps/meteor/client/views/omnichannel/currentChats/CustomFieldsList.tsx index e0b8a77381b4..803b74b9522d 100644 --- a/apps/meteor/client/views/omnichannel/currentChats/CustomFieldsList.tsx +++ b/apps/meteor/client/views/omnichannel/currentChats/CustomFieldsList.tsx @@ -1,5 +1,5 @@ import type { ILivechatCustomField } from '@rocket.chat/core-typings'; -import { Field, TextInput, Select } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, TextInput, Select } from '@rocket.chat/fuselage'; import { useTranslation, useRoute } from '@rocket.chat/ui-contexts'; import type { ReactElement, Dispatch, SetStateAction } from 'react'; import React, { useEffect } from 'react'; @@ -39,8 +39,8 @@ const CustomFieldsList = ({ setCustomFields, allCustomFields }: CustomFieldsList if (customField.type === 'select') { return ( - {customField.label} - + {customField.label} + [item, item])} /> )} /> - + ); } return ( - {customField.label} - + {customField.label} + - + ); })} diff --git a/apps/meteor/client/views/omnichannel/departments/DepartmentTags/index.tsx b/apps/meteor/client/views/omnichannel/departments/DepartmentTags/index.tsx index b1542f857316..cead6a0fb15f 100644 --- a/apps/meteor/client/views/omnichannel/departments/DepartmentTags/index.tsx +++ b/apps/meteor/client/views/omnichannel/departments/DepartmentTags/index.tsx @@ -1,4 +1,4 @@ -import { Button, Chip, Field, TextInput } from '@rocket.chat/fuselage'; +import { Button, Chip, FieldRow, FieldHint, TextInput } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { FormEvent } from 'react'; import React, { useCallback, useState } from 'react'; @@ -28,7 +28,7 @@ export const DepartmentTags = ({ error, value: tags, onChange }: DepartmentTagsP return ( <> - + {t('Add')} - + - {t('Conversation_closing_tags_description')} + {t('Conversation_closing_tags_description')} {tags?.length > 0 && ( - + {tags.map((tag, i) => ( {tag} ))} - + )} ); diff --git a/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx b/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx index 3a408bfa7507..46919307b052 100644 --- a/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx +++ b/apps/meteor/client/views/omnichannel/departments/EditDepartment.tsx @@ -2,6 +2,9 @@ import type { ILivechatDepartment, ILivechatDepartmentAgents, Serialized } from import { FieldGroup, Field, + FieldLabel, + FieldRow, + FieldError, TextInput, Box, Icon, @@ -240,16 +243,16 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen > - {t('Enabled')} - + {t('Enabled')} + - + - {t('Name')}* - + {t('Name')}* + - - {errors.name && {errors.name?.message}} + + {errors.name && {errors.name?.message}} - {t('Description')} - + {t('Description')} + - + - {t('Show_on_registration_page')} - + {t('Show_on_registration_page')} + - + - {t('Email')}* - + {t('Email')}* + validateEmail(email) || t('error-invalid-email-address'), })} /> - - {errors.email && {errors.email?.message}} + + {errors.email && {errors.email?.message}} - {t('Show_on_offline_page')} - + {t('Show_on_offline_page')} + - + - {t('Livechat_DepartmentOfflineMessageToChannel')} - + {t('Livechat_DepartmentOfflineMessageToChannel')} + )} /> - + {MaxChats && ( @@ -421,7 +424,7 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen {AutoCompleteDepartment && ( - {t('Fallback_forward_department')} + {t('Fallback_forward_department')} - {t('Request_tag_before_closing_chat')} - + {t('Request_tag_before_closing_chat')} + - + {requestTagBeforeClosingChat && ( - {t('Conversation_closing_tags')}* + {t('Conversation_closing_tags')}* )} /> - {errors.chatClosingTags && {errors.chatClosingTags?.message}} + {errors.chatClosingTags && {errors.chatClosingTags?.message}} )} @@ -475,7 +478,7 @@ function EditDepartment({ data, id, title, allowedToForwardData }: EditDepartmen - {t('Agents')}: + {t('Agents')}: diff --git a/apps/meteor/client/views/omnichannel/directory/chats/contextualBar/RoomEdit/RoomEdit.tsx b/apps/meteor/client/views/omnichannel/directory/chats/contextualBar/RoomEdit/RoomEdit.tsx index 433af2135068..89b7b4582fa5 100644 --- a/apps/meteor/client/views/omnichannel/directory/chats/contextualBar/RoomEdit/RoomEdit.tsx +++ b/apps/meteor/client/views/omnichannel/directory/chats/contextualBar/RoomEdit/RoomEdit.tsx @@ -1,5 +1,5 @@ import type { ILivechatVisitor, IOmnichannelRoom, Serialized } from '@rocket.chat/core-typings'; -import { Field, TextInput, ButtonGroup, Button } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, TextInput, ButtonGroup, Button } from '@rocket.chat/fuselage'; import { CustomFieldsForm } from '@rocket.chat/ui-client'; import { useToastMessageDispatch, useTranslation, useEndpoint } from '@rocket.chat/ui-contexts'; import { useQueryClient } from '@tanstack/react-query'; @@ -127,10 +127,10 @@ function RoomEdit({ room, visitor, reload, reloadInfo, onClose }: RoomEditProps) )} - {t('Topic')} - + {t('Topic')} + - + diff --git a/apps/meteor/client/views/omnichannel/directory/contacts/contextualBar/ContactNewEdit.tsx b/apps/meteor/client/views/omnichannel/directory/contacts/contextualBar/ContactNewEdit.tsx index afb609e5f801..a41c155c4f9d 100644 --- a/apps/meteor/client/views/omnichannel/directory/contacts/contextualBar/ContactNewEdit.tsx +++ b/apps/meteor/client/views/omnichannel/directory/contacts/contextualBar/ContactNewEdit.tsx @@ -1,5 +1,5 @@ import type { ILivechatVisitor, Serialized } from '@rocket.chat/core-typings'; -import { Field, TextInput, ButtonGroup, Button, ContextualbarContent } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, FieldError, TextInput, ButtonGroup, Button, ContextualbarContent } from '@rocket.chat/fuselage'; import { CustomFieldsForm } from '@rocket.chat/ui-client'; import { useToastMessageDispatch, useEndpoint, useTranslation } from '@rocket.chat/ui-contexts'; import { useQueryClient } from '@tanstack/react-query'; @@ -189,25 +189,25 @@ const ContactNewEdit = ({ id, data, close }: ContactNewEditProps): ReactElement <> - {t('Name')}* - + {t('Name')}* + - - {errors.name?.message} + + {errors.name?.message} - {t('Email')} - + {t('Email')} + - - {errors.email?.message} + + {errors.email?.message} - {t('Phone')} - + {t('Phone')} + - - {errors.phone?.message} + + {errors.phone?.message} {canViewCustomFields() && } {ContactManager && } diff --git a/apps/meteor/client/views/omnichannel/managers/AddManager.tsx b/apps/meteor/client/views/omnichannel/managers/AddManager.tsx index d6668d7f35d7..b4f56f78b62b 100644 --- a/apps/meteor/client/views/omnichannel/managers/AddManager.tsx +++ b/apps/meteor/client/views/omnichannel/managers/AddManager.tsx @@ -1,4 +1,4 @@ -import { Button, Box, Field } from '@rocket.chat/fuselage'; +import { Button, Box, Field, FieldLabel, FieldRow } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useToastMessageDispatch, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -34,13 +34,13 @@ const AddManager = ({ reload }: { reload: () => void }): ReactElement => { return ( - {t('Username')} - + {t('Username')} + - + ); diff --git a/apps/meteor/client/views/omnichannel/triggers/TriggersForm.tsx b/apps/meteor/client/views/omnichannel/triggers/TriggersForm.tsx index 72c8d30d973e..7c9476059411 100644 --- a/apps/meteor/client/views/omnichannel/triggers/TriggersForm.tsx +++ b/apps/meteor/client/views/omnichannel/triggers/TriggersForm.tsx @@ -1,5 +1,5 @@ import type { SelectOption } from '@rocket.chat/fuselage'; -import { Box, Field, TextInput, ToggleSwitch, Select, TextAreaInput } from '@rocket.chat/fuselage'; +import { Box, Field, FieldLabel, FieldRow, FieldError, TextInput, ToggleSwitch, Select, TextAreaInput } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ComponentProps, FC, FormEvent } from 'react'; @@ -138,55 +138,55 @@ const TriggersForm: FC = ({ values, handlers, className }) => <> - {t('Enabled')} - + {t('Enabled')} + - + - {t('Run_only_once_for_each_visitor')} - + {t('Run_only_once_for_each_visitor')} + - + - {t('Name')}* - + {t('Name')}* + - - {nameError} + + {nameError} - {t('Description')} - + {t('Description')} + - + - {t('Condition')} - + {t('Condition')} + = ({ values, handlers, className }) => onChange={handleActionSender} placeholder={t('Select_an_option')} /> - + {actionSender === 'custom' && ( - + - + )} - + - - {msgError} + + {msgError} ); diff --git a/apps/meteor/client/views/room/contextualBar/AutoTranslate/AutoTranslate.tsx b/apps/meteor/client/views/room/contextualBar/AutoTranslate/AutoTranslate.tsx index a15edebf8c16..6952b5b1dafe 100644 --- a/apps/meteor/client/views/room/contextualBar/AutoTranslate/AutoTranslate.tsx +++ b/apps/meteor/client/views/room/contextualBar/AutoTranslate/AutoTranslate.tsx @@ -1,4 +1,4 @@ -import { FieldGroup, Field, ToggleSwitch, Select } from '@rocket.chat/fuselage'; +import { FieldGroup, Field, FieldLabel, FieldRow, ToggleSwitch, Select } from '@rocket.chat/fuselage'; import type { SelectOption } from '@rocket.chat/fuselage'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement, ChangeEvent } from 'react'; @@ -41,14 +41,14 @@ const AutoTranslate = ({ - + - {t('Automatic_Translation')} - + {t('Automatic_Translation')} + - {t('Language')} - + {t('Language')} + setType(String(value))} placeholder={t('Type')} options={exportOptions} /> - + {type && type === 'file' && } diff --git a/apps/meteor/client/views/room/contextualBar/ExportMessages/FileExport.tsx b/apps/meteor/client/views/room/contextualBar/ExportMessages/FileExport.tsx index efbf60b69606..2085e11ea11d 100644 --- a/apps/meteor/client/views/room/contextualBar/ExportMessages/FileExport.tsx +++ b/apps/meteor/client/views/room/contextualBar/ExportMessages/FileExport.tsx @@ -1,6 +1,6 @@ import type { IRoom } from '@rocket.chat/core-typings'; import type { SelectOption } from '@rocket.chat/fuselage'; -import { Field, Select, ButtonGroup, Button, FieldGroup, InputBox } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, Select, ButtonGroup, Button, FieldGroup, InputBox } from '@rocket.chat/fuselage'; import { useToastMessageDispatch, useEndpoint, useTranslation } from '@rocket.chat/ui-contexts'; import type { FC, MouseEventHandler } from 'react'; import React, { useMemo } from 'react'; @@ -65,22 +65,22 @@ const FileExport: FC = ({ onCancel, rid }) => { return ( - {t('Date_From')} - + {t('Date_From')} + - + - {t('Date_to')} - + {t('Date_to')} + - + - {t('Output_format')} - + {t('Output_format')} + {children} - + ); diff --git a/apps/meteor/client/views/room/contextualBar/PruneMessages/PruneMessages.tsx b/apps/meteor/client/views/room/contextualBar/PruneMessages/PruneMessages.tsx index 9f64bbc6504b..709699ebd697 100644 --- a/apps/meteor/client/views/room/contextualBar/PruneMessages/PruneMessages.tsx +++ b/apps/meteor/client/views/room/contextualBar/PruneMessages/PruneMessages.tsx @@ -1,4 +1,4 @@ -import { Field, ButtonGroup, Button, CheckBox, Callout } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, FieldRow, ButtonGroup, Button, CheckBox, Callout } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -45,7 +45,7 @@ const PruneMessages = ({ callOutText, validateText, onClickClose, onClickPrune } - {t('Only_from_users')} + {t('Only_from_users')} - + - {t('Inclusive')} - + {t('Inclusive')} + - + - {t('RetentionPolicy_DoNotPrunePinned')} - + {t('RetentionPolicy_DoNotPrunePinned')} + - + - {t('RetentionPolicy_DoNotPruneDiscussion')} - + {t('RetentionPolicy_DoNotPruneDiscussion')} + - + - {t('RetentionPolicy_DoNotPruneThreads')} - + {t('RetentionPolicy_DoNotPruneThreads')} + - + - {t('Files_only')} - + {t('Files_only')} + {callOutText && !validateText && {callOutText}} {validateText && {validateText}} diff --git a/apps/meteor/client/views/room/contextualBar/PruneMessages/PruneMessagesDateTimeRow.tsx b/apps/meteor/client/views/room/contextualBar/PruneMessages/PruneMessagesDateTimeRow.tsx index e774311e5564..38bf1c233f5a 100644 --- a/apps/meteor/client/views/room/contextualBar/PruneMessages/PruneMessagesDateTimeRow.tsx +++ b/apps/meteor/client/views/room/contextualBar/PruneMessages/PruneMessagesDateTimeRow.tsx @@ -1,4 +1,4 @@ -import { Field, InputBox, Box, Margins } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, InputBox, Box, Margins } from '@rocket.chat/fuselage'; import type { ReactElement } from 'react'; import React from 'react'; import { useFormContext } from 'react-hook-form'; @@ -13,7 +13,7 @@ const PruneMessagesDateTimeRow = ({ label, field }: PruneMessagesDateTimeRowProp return ( - {label} + {label} diff --git a/apps/meteor/client/views/room/contextualBar/RoomMembers/AddUsers/AddUsers.tsx b/apps/meteor/client/views/room/contextualBar/RoomMembers/AddUsers/AddUsers.tsx index 7a8f0d1e699a..09eaca08cbc9 100644 --- a/apps/meteor/client/views/room/contextualBar/RoomMembers/AddUsers/AddUsers.tsx +++ b/apps/meteor/client/views/room/contextualBar/RoomMembers/AddUsers/AddUsers.tsx @@ -1,6 +1,6 @@ import type { IRoom } from '@rocket.chat/core-typings'; import { isRoomFederated } from '@rocket.chat/core-typings'; -import { Field, Button, ButtonGroup, FieldGroup } from '@rocket.chat/fuselage'; +import { Field, FieldLabel, Button, ButtonGroup, FieldGroup } from '@rocket.chat/fuselage'; import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; import { useToastMessageDispatch, useMethod, useTranslation } from '@rocket.chat/ui-contexts'; import type { ReactElement } from 'react'; @@ -65,7 +65,7 @@ const AddUsers = ({ rid, onClickBack, reload }: AddUsersProps): ReactElement => - {t('Choose_users')} + {t('Choose_users')} {isRoomFederated(room) ? ( - {t('Expiration_(Days)')} - + {t('Expiration_(Days)')} + )} /> - + - {t('Max_number_of_uses')} - + {t('Max_number_of_uses')} + )} /> - +