From db919f9b23b81c13b653303faab5500cc8a2564e Mon Sep 17 00:00:00 2001 From: rocketchat-github-ci Date: Tue, 5 Sep 2023 20:13:30 +0000 Subject: [PATCH 001/211] 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 002/211] 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 d418d0e752a69abecfe41ef84d1f7abf70a03d20 Mon Sep 17 00:00:00 2001 From: Aleksander Nicacio da Silva Date: Wed, 6 Sep 2023 12:45:10 -0300 Subject: [PATCH 003/211] 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 5da0b8cb7cab620c92205ff536c11cfc64d82c69 Mon Sep 17 00:00:00 2001 From: Diego Sampaio Date: Wed, 6 Sep 2023 15:02:39 -0300 Subject: [PATCH 004/211] 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 005/211] 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 006/211] 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 007/211] 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 008/211] 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 009/211] 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 010/211] 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 058/211] 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 059/211] 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 060/211] 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 061/211] 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 062/211] 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 063/211] 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 064/211] 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 065/211] 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 066/211] 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 067/211] 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 068/211] 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 069/211] 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 070/211] 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 071/211] 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 072/211] 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 073/211] 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 074/211] 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 075/211] 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 076/211] 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 077/211] 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 078/211] 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 079/211] 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 080/211] 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 081/211] 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 082/211] 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 083/211] 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 084/211] 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 085/211] 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 086/211] 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 087/211] 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 088/211] 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 089/211] 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 090/211] 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 091/211] 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 092/211] =?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 093/211] 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 094/211] 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 095/211] 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 096/211] 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 097/211] 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 098/211] 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 099/211] 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 100/211] 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 101/211] 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 102/211] 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 103/211] 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 104/211] 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 105/211] 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 106/211] 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 107/211] 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 108/211] 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 109/211] 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 110/211] 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 113/211] 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 114/211] 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 115/211] 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 116/211] 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 117/211] 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 118/211] 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 119/211] 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 120/211] 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 121/211] 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 122/211] 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 123/211] 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 124/211] 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 125/211] 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 126/211] 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 127/211] 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 128/211] 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 129/211] 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 130/211] 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 131/211] 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 132/211] 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 133/211] 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 134/211] 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 135/211] 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 136/211] 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 137/211] 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 138/211] 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 139/211] 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 140/211] 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 141/211] 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 142/211] 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 143/211] 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 144/211] 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 145/211] 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 146/211] 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 147/211] 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 148/211] 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 149/211] 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 150/211] 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 151/211] 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 152/211] 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 153/211] 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 154/211] 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 155/211] 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 156/211] 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 157/211] 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 158/211] 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 159/211] 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 160/211] 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')} + )} /> - + - - diff --git a/apps/meteor/client/views/hooks/roomActions/useDeleteRoom.tsx b/apps/meteor/client/views/hooks/roomActions/useDeleteRoom.tsx new file mode 100644 index 000000000000..be4728732284 --- /dev/null +++ b/apps/meteor/client/views/hooks/roomActions/useDeleteRoom.tsx @@ -0,0 +1,89 @@ +import type { IRoom, RoomAdminFieldsType } from '@rocket.chat/core-typings'; +import { isRoomFederated } from '@rocket.chat/core-typings'; +import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; +import { useSetModal, useToastMessageDispatch, useRouter, usePermission, useEndpoint, useTranslation } from '@rocket.chat/ui-contexts'; +import { useMutation } from '@tanstack/react-query'; +import React from 'react'; + +import GenericModal from '../../../components/GenericModal'; +import DeleteTeamModal from '../../teams/contextualBar/info/DeleteTeam'; + +export const useDeleteRoom = (room: IRoom | Pick, { reload }: { reload?: () => void } = {}) => { + const t = useTranslation(); + const router = useRouter(); + const setModal = useSetModal(); + const dispatchToastMessage = useToastMessageDispatch(); + const hasPermissionToDelete = usePermission(`delete-${room.t}`, room._id); + const canDeleteRoom = isRoomFederated(room) ? false : hasPermissionToDelete; + + const isAdminRoute = router.getRouteName() === 'admin-rooms'; + + const deleteRoomEndpoint = useEndpoint('POST', '/v1/rooms.delete'); + const deleteTeamEndpoint = useEndpoint('POST', '/v1/teams.delete'); + + const deleteRoomMutation = useMutation({ + mutationFn: deleteRoomEndpoint, + onSuccess: () => { + dispatchToastMessage({ type: 'success', message: t('Room_has_been_deleted') }); + if (isAdminRoute) { + return router.navigate('/admin/rooms'); + } + + return router.navigate('/home'); + }, + onError: (error) => { + dispatchToastMessage({ type: 'error', message: error }); + }, + onSettled: () => { + setModal(null); + reload?.(); + }, + }); + + const deleteTeamMutation = useMutation({ + mutationFn: deleteTeamEndpoint, + onSuccess: () => { + dispatchToastMessage({ type: 'success', message: t('Team_has_been_deleted') }); + if (isAdminRoute) { + return router.navigate('/admin/rooms'); + } + + return router.navigate('/home'); + }, + onError: (error) => { + dispatchToastMessage({ type: 'error', message: error }); + }, + onSettled: () => { + setModal(null); + reload?.(); + }, + }); + + const isDeleting = deleteTeamMutation.isLoading || deleteRoomMutation.isLoading; + + const handleDelete = useMutableCallback(() => { + const handleDeleteTeam = async (roomsToRemove: IRoom['_id'][]) => { + if (!room.teamId) { + return; + } + + deleteTeamMutation.mutateAsync({ teamId: room.teamId, ...(roomsToRemove.length && { roomsToRemove }) }); + }; + + if (room.teamMain && room.teamId) { + return setModal( setModal(null)} teamId={room.teamId} />); + } + + const handleDeleteRoom = async () => { + deleteRoomMutation.mutateAsync({ roomId: room._id }); + }; + + setModal( + setModal(null)} confirmText={t('Yes_delete_it')}> + {t('Delete_Room_Warning')} + , + ); + }); + + return { handleDelete, canDeleteRoom, isDeleting }; +}; diff --git a/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditChannel.js b/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditChannel.js deleted file mode 100644 index 22c84fbdebf1..000000000000 --- a/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditChannel.js +++ /dev/null @@ -1,514 +0,0 @@ -import { isRoomFederated } from '@rocket.chat/core-typings'; -import { - Field, - TextInput, - PasswordInput, - ToggleSwitch, - MultiSelect, - Accordion, - Callout, - NumberInput, - FieldGroup, - FieldLabel, - FieldRow, - FieldHint, - Button, - ButtonGroup, - Box, - TextAreaInput, -} from '@rocket.chat/fuselage'; -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; -import { - useSetModal, - useSetting, - usePermission, - useAtLeastOnePermission, - useRole, - useMethod, - useTranslation, - useRouter, -} from '@rocket.chat/ui-contexts'; -import React, { useCallback, useMemo, useRef } from 'react'; - -import { e2e } from '../../../../../../app/e2e/client/rocketchat.e2e'; -import { MessageTypesValues } from '../../../../../../app/lib/lib/MessageTypes'; -import { RoomSettingsEnum } from '../../../../../../definition/IRoomTypeConfig'; -import { - ContextualbarHeader, - ContextualbarBack, - ContextualbarTitle, - ContextualbarClose, - ContextualbarScrollableContent, - ContextualbarFooter, -} from '../../../../../components/Contextualbar'; -import GenericModal from '../../../../../components/GenericModal'; -import RawText from '../../../../../components/RawText'; -import RoomAvatarEditor from '../../../../../components/avatar/RoomAvatarEditor'; -import { useEndpointAction } from '../../../../../hooks/useEndpointAction'; -import { useForm } from '../../../../../hooks/useForm'; -import { roomCoordinator } from '../../../../../lib/rooms/roomCoordinator'; - -const typeMap = { - c: 'Channels', - p: 'Groups', - d: 'DMs', -}; - -const useInitialValues = (room, settings) => { - const { - t, - ro, - archived, - topic, - description, - announcement, - joinCodeRequired, - sysMes, - encrypted, - retention = {}, - reactWhenReadOnly, - } = room; - - const { retentionPolicyEnabled, maxAgeDefault } = settings; - - const retentionEnabledDefault = useSetting(`RetentionPolicy_AppliesTo${typeMap[room.t]}`); - const excludePinnedDefault = useSetting('RetentionPolicy_DoNotPrunePinned'); - const filesOnlyDefault = useSetting('RetentionPolicy_FilesOnly'); - - return useMemo( - () => ({ - roomName: t === 'd' ? room.usernames.join(' x ') : roomCoordinator.getRoomName(t, { type: t, ...room }), - roomType: t, - readOnly: !!ro, - reactWhenReadOnly, - archived: !!archived, - roomTopic: topic ?? '', - roomDescription: description ?? '', - roomAnnouncement: announcement ?? '', - roomAvatar: undefined, - joinCode: '', - joinCodeRequired: !!joinCodeRequired, - systemMessages: Array.isArray(sysMes) ? sysMes : [], - hideSysMes: !!sysMes?.length, - encrypted, - ...(retentionPolicyEnabled && { - retentionEnabled: retention.enabled ?? retentionEnabledDefault, - retentionOverrideGlobal: !!retention.overrideGlobal, - retentionMaxAge: Math.min(retention.maxAge, maxAgeDefault) || maxAgeDefault, - retentionExcludePinned: retention.excludePinned ?? excludePinnedDefault, - retentionFilesOnly: retention.filesOnly ?? filesOnlyDefault, - }), - }), - [ - announcement, - archived, - description, - excludePinnedDefault, - filesOnlyDefault, - joinCodeRequired, - maxAgeDefault, - retention.enabled, - retention.excludePinned, - retention.filesOnly, - retention.maxAge, - retention.overrideGlobal, - retentionEnabledDefault, - retentionPolicyEnabled, - ro, - room, - sysMes, - t, - topic, - encrypted, - reactWhenReadOnly, - ], - ); -}; - -const getCanChangeType = (room, canCreateChannel, canCreateGroup, isAdmin) => - (!room.default || isAdmin) && ((room.t === 'p' && canCreateChannel) || (room.t === 'c' && canCreateGroup)); - -function EditChannel({ room, onClickClose, onClickBack }) { - const t = useTranslation(); - - const setModal = useSetModal(); - - const retentionPolicyEnabled = useSetting('RetentionPolicy_Enabled'); - const maxAgeDefault = useSetting(`RetentionPolicy_MaxAge_${typeMap[room.t]}`) || 30; - - const saveData = useRef({}); - const router = useRouter(); - - const onChange = useCallback(({ initialValue, value, key }) => { - const { current } = saveData; - if (JSON.stringify(initialValue) !== JSON.stringify(value)) { - if (key === 'systemMessages' && value?.length > 0) { - current.hideSysMes = true; - } - current[key] = value; - } else { - delete current[key]; - } - }, []); - - const { values, handlers, hasUnsavedChanges, reset, commit } = useForm( - useInitialValues(room, { retentionPolicyEnabled, maxAgeDefault }), - onChange, - ); - - const sysMesOptions = useMemo(() => MessageTypesValues.map(({ key, i18nLabel }) => [key, t(i18nLabel)]), [t]); - - const { - roomName, - roomType, - readOnly, - encrypted, - roomAvatar, - archived, - roomTopic, - roomDescription, - roomAnnouncement, - reactWhenReadOnly, - joinCode, - joinCodeRequired, - systemMessages, - hideSysMes, - retentionEnabled, - retentionOverrideGlobal, - retentionMaxAge, - retentionExcludePinned, - retentionFilesOnly, - } = values; - - const { - handleJoinCode, - handleJoinCodeRequired, - handleSystemMessages, - handleEncrypted, - handleHideSysMes, - handleRoomName, - handleReadOnly, - handleArchived, - handleRoomAvatar, - handleReactWhenReadOnly, - handleRoomType, - handleRoomTopic, - handleRoomDescription, - handleRoomAnnouncement, - handleRetentionEnabled, - handleRetentionOverrideGlobal, - handleRetentionMaxAge, - handleRetentionExcludePinned, - handleRetentionFilesOnly, - } = handlers; - - const [ - canViewName, - canViewTopic, - canViewAnnouncement, - canViewArchived, - canViewDescription, - canViewType, - canViewReadOnly, - canViewHideSysMes, - canViewJoinCode, - canViewEncrypted, - ] = useMemo(() => { - const isAllowed = roomCoordinator.getRoomDirectives(room.t).allowRoomSettingChange || (() => {}); - return [ - isAllowed(room, RoomSettingsEnum.NAME), - isAllowed(room, RoomSettingsEnum.TOPIC), - isAllowed(room, RoomSettingsEnum.ANNOUNCEMENT), - isAllowed(room, RoomSettingsEnum.ARCHIVE_OR_UNARCHIVE), - isAllowed(room, RoomSettingsEnum.DESCRIPTION), - isAllowed(room, RoomSettingsEnum.TYPE), - isAllowed(room, RoomSettingsEnum.READ_ONLY), - isAllowed(room, RoomSettingsEnum.SYSTEM_MESSAGES), - isAllowed(room, RoomSettingsEnum.JOIN_CODE), - isAllowed(room, RoomSettingsEnum.REACT_WHEN_READ_ONLY), - isAllowed(room, RoomSettingsEnum.E2E), - ]; - }, [room]); - - const isAdmin = useRole('admin'); - - const canCreateChannel = usePermission('create-c'); - const canCreateGroup = usePermission('create-p'); - const canChangeType = getCanChangeType(room, canCreateChannel, canCreateGroup, isAdmin); - const canSetRo = usePermission('set-readonly', room._id); - const canSetReactWhenRo = usePermission('set-react-when-readonly', room._id); - const canEditRoomRetentionPolicy = usePermission('edit-room-retention-policy', room._id); - const canArchiveOrUnarchive = useAtLeastOnePermission( - useMemo(() => ['archive-room', 'unarchive-room'], []), - room._id, - ); - const canDelete = usePermission(`delete-${room.t}`); - const canToggleEncryption = usePermission('toggle-room-e2e-encryption', room._id) && (room.encrypted || e2e.isReady()); - - const changeArchivation = archived !== !!room.archived; - const archiveSelector = room.archived ? 'unarchive' : 'archive'; - const archiveMessage = room.archived ? 'Room_has_been_unarchived' : 'Room_has_been_archived'; - const saveAction = useEndpointAction('POST', '/v1/rooms.saveRoomSettings', { - successMessage: t('Room_updated_successfully'), - }); - const archiveAction = useEndpointAction('POST', '/v1/rooms.changeArchivationState', { successMessage: t(archiveMessage) }); - - const handleSave = useMutableCallback(async () => { - const { joinCodeRequired, hideSysMes, ...data } = saveData.current; - delete data.archived; - const save = () => - saveAction({ - rid: room._id, - ...data, - ...(joinCode && { joinCode: joinCodeRequired ? joinCode : '' }), - ...((data.systemMessages || !hideSysMes) && { - systemMessages: hideSysMes && systemMessages, - }), - }); - - const archive = () => archiveAction({ rid: room._id, action: archiveSelector }); - - await Promise.all([hasUnsavedChanges && save(), changeArchivation && archive()].filter(Boolean)); - saveData.current = {}; - commit(); - }); - - const deleteRoom = useMethod('eraseRoom'); - - const handleDelete = useMutableCallback(() => { - const onCancel = () => setModal(undefined); - const onConfirm = async () => { - await deleteRoom(room._id); - onCancel(); - router.navigate('/home'); - }; - - setModal( - - {t('Delete_Room_Warning')} - , - ); - }); - - const changeRoomType = useMutableCallback(() => { - handleRoomType(roomType === 'p' ? 'c' : 'p'); - }); - - const onChangeMaxAge = useMutableCallback((e) => { - handleRetentionMaxAge(Math.max(1, Number(e.currentTarget.value))); - }); - - const isFederated = useMemo(() => isRoomFederated(room), [room]); - - return ( - <> - - {onClickBack && } - {room.teamId ? t('edit-team') : t('edit-room')} - {onClickClose && } - - e.preventDefault())}> - - - - - {t('Name')} - - - - - {canViewDescription && ( - - {t('Description')} - - - - - )} - {canViewAnnouncement && ( - - {t('Announcement')} - - - - - )} - {canViewTopic && ( - - {t('Topic')} - - - - - )} - {canViewType && ( - - - {t('Private')} - - - - - {t('Teams_New_Private_Description_Enabled')} - - )} - {canViewReadOnly && ( - - - {t('Read_only')} - - - - - {t('Only_authorized_users_can_write_new_messages')} - - )} - {readOnly && ( - - - {t('React_when_read_only')} - - - - - {t('Only_authorized_users_can_react_to_messages')} - - )} - {canViewArchived && ( - - - {t('Room_archivation_state_true')} - - - - - - )} - {canViewJoinCode && ( - - - {t('Password_to_access')} - - - - - - - - - )} - {canViewHideSysMes && ( - - - {t('Hide_System_Messages')} - - - - - - - - - )} - {canViewEncrypted && ( - - - {t('Encrypted')} - - - - - - )} - {retentionPolicyEnabled && ( - - - - - - {t('RetentionPolicyRoom_Enabled')} - - - - - - - - {t('RetentionPolicyRoom_OverrideGlobal')} - - - - - - {retentionOverrideGlobal && ( - <> - - {t('RetentionPolicyRoom_ReadTheDocs')} - - - {t('RetentionPolicyRoom_MaxAge', { max: maxAgeDefault })} - - - - - - - {t('RetentionPolicyRoom_ExcludePinned')} - - - - - - - - {t('RetentionPolicyRoom_FilesOnly')} - - - - - - - )} - - - - )} - - - - - - - - - - - - ); -} - -export default EditChannel; diff --git a/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditChannelWithData.js b/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditChannelWithData.js deleted file mode 100644 index e64dcc17562a..000000000000 --- a/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditChannelWithData.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; - -import { useRoom } from '../../../contexts/RoomContext'; -import { useRoomToolbox } from '../../../contexts/RoomToolboxContext'; -import EditChannel from './EditChannel'; - -function EditChannelWithData({ onClickBack }) { - const room = useRoom(); - const { closeTab } = useRoomToolbox(); - - return ; -} - -export default EditChannelWithData; diff --git a/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx b/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx new file mode 100644 index 000000000000..b2c552fd3d87 --- /dev/null +++ b/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfo.tsx @@ -0,0 +1,487 @@ +import type { IRoomWithRetentionPolicy } from '@rocket.chat/core-typings'; +import { isRoomFederated } from '@rocket.chat/core-typings'; +import type { SelectOption } from '@rocket.chat/fuselage'; +import { + Field, + FieldRow, + FieldLabel, + FieldHint, + TextInput, + PasswordInput, + ToggleSwitch, + MultiSelect, + Accordion, + Callout, + NumberInput, + FieldGroup, + Button, + ButtonGroup, + Box, + TextAreaInput, +} from '@rocket.chat/fuselage'; +import { useMutableCallback, useUniqueId } from '@rocket.chat/fuselage-hooks'; +import type { TranslationKey } from '@rocket.chat/ui-contexts'; +import { useSetting, useTranslation, useToastMessageDispatch, useEndpoint } from '@rocket.chat/ui-contexts'; +import React, { useMemo } from 'react'; +import { useForm, Controller } from 'react-hook-form'; + +import { MessageTypesValues } from '../../../../../../app/lib/lib/MessageTypes'; +import { + ContextualbarHeader, + ContextualbarBack, + ContextualbarTitle, + ContextualbarClose, + ContextualbarScrollableContent, + ContextualbarFooter, +} from '../../../../../components/Contextualbar'; +import RawText from '../../../../../components/RawText'; +import RoomAvatarEditor from '../../../../../components/avatar/RoomAvatarEditor'; +import { getDirtyFields } from '../../../../../lib/getDirtyFields'; +import { useDeleteRoom } from '../../../../hooks/roomActions/useDeleteRoom'; +import { useEditRoomInitialValues } from './useEditRoomInitialValues'; +import { useEditRoomPermissions } from './useEditRoomPermissions'; + +type EditRoomInfoProps = { + room: IRoomWithRetentionPolicy; + onClickClose: () => void; + onClickBack: () => void; +}; + +const EditRoomInfo = ({ room, onClickClose, onClickBack }: EditRoomInfoProps) => { + const t = useTranslation(); + const dispatchToastMessage = useToastMessageDispatch(); + const isFederated = useMemo(() => isRoomFederated(room), [room]); + + const retentionPolicy = useSetting('RetentionPolicy_Enabled'); + const { handleDelete, canDeleteRoom } = useDeleteRoom(room); + const defaultValues = useEditRoomInitialValues(room); + + const { + watch, + reset, + control, + handleSubmit, + formState: { isDirty, dirtyFields, errors }, + } = useForm({ mode: 'onBlur', defaultValues }); + + const sysMesOptions: SelectOption[] = useMemo( + () => MessageTypesValues.map(({ key, i18nLabel }) => [key, t(i18nLabel as TranslationKey)]), + [t], + ); + + const { readOnly, archived, joinCodeRequired, hideSysMes, retentionEnabled, retentionMaxAge, retentionOverrideGlobal } = watch(); + + const { + canChangeType, + canSetReadOnly, + canSetReactWhenReadOnly, + canEditRoomRetentionPolicy, + canArchiveOrUnarchive, + canToggleEncryption, + canViewName, + canViewTopic, + canViewAnnouncement, + canViewArchived, + canViewDescription, + canViewType, + canViewReadOnly, + canViewHideSysMes, + canViewJoinCode, + canViewEncrypted, + } = useEditRoomPermissions(room); + + const changeArchiving = archived !== !!room.archived; + + const saveAction = useEndpoint('POST', '/v1/rooms.saveRoomSettings'); + const archiveAction = useEndpoint('POST', '/v1/rooms.changeArchivationState'); + + const handleUpdateRoomData = useMutableCallback(async ({ hideSysMes, ...formData }) => { + const data = getDirtyFields(formData, dirtyFields); + + try { + await saveAction({ + rid: room._id, + ...data, + ...(data.joinCode && { joinCode: joinCodeRequired ? data.joinCode : '' }), + ...((data.systemMessages || !hideSysMes) && { + systemMessages: hideSysMes && data.systemMessages, + }), + }); + + dispatchToastMessage({ type: 'success', message: t('Room_updated_successfully') }); + onClickClose(); + } catch (error) { + dispatchToastMessage({ type: 'error', message: error }); + } + }); + + const handleArchive = useMutableCallback(async () => { + try { + await archiveAction({ rid: room._id, action: room.archived ? 'unarchive' : 'archive' }); + dispatchToastMessage({ type: 'success', message: room.archived ? t('Room_has_been_unarchived') : t('Room_has_been_archived') }); + } catch (error) { + dispatchToastMessage({ type: 'error', message: error }); + } + }); + + const handleSave = useMutableCallback(async (data) => { + await Promise.all([isDirty && handleUpdateRoomData(data), changeArchiving && handleArchive()].filter(Boolean)); + }); + + const formId = useUniqueId(); + const roomNameField = useUniqueId(); + const roomDescriptionField = useUniqueId(); + const roomAnnouncementField = useUniqueId(); + const roomTopicField = useUniqueId(); + const roomTypeField = useUniqueId(); + const readOnlyField = useUniqueId(); + const reactWhenReadOnlyField = useUniqueId(); + const archivedField = useUniqueId(); + const joinCodeRequiredField = useUniqueId(); + const hideSysMesField = useUniqueId(); + const encryptedField = useUniqueId(); + const retentionEnabledField = useUniqueId(); + const retentionOverrideGlobalField = useUniqueId(); + const retentionMaxAgeField = useUniqueId(); + const retentionExcludePinnedField = useUniqueId(); + const retentionFilesOnlyField = useUniqueId(); + + return ( + <> + + {onClickBack && } + {room.teamId ? t('edit-team') : t('edit-room')} + {onClickClose && } + + +
+ + } + /> + + + + + {t('Name')} + + + } + /> + + {errors.roomName && {errors.roomName.message}} + + {canViewDescription && ( + + {t('Description')} + + } + /> + + + )} + {canViewAnnouncement && ( + + {t('Announcement')} + + } + /> + + + )} + {canViewTopic && ( + + {t('Topic')} + + } + /> + + + )} + {canViewType && ( + + + {t('Private')} + + ( + onChange(value === 'p' ? 'c' : 'p')} + aria-describedby={`${roomTypeField}-hint`} + /> + )} + /> + + + {t('Teams_New_Private_Description_Enabled')} + + )} + {canViewReadOnly && ( + + + {t('Read_only')} + + ( + + )} + /> + + + {t('Only_authorized_users_can_write_new_messages')} + + )} + {readOnly && ( + + + {t('React_when_read_only')} + + ( + + )} + /> + + + {t('Only_authorized_users_can_react_to_messages')} + + )} + {canViewArchived && ( + + + {t('Room_archivation_state_true')} + + ( + + )} + /> + + + + )} + {canViewJoinCode && ( + + + {t('Password_to_access')} + + ( + + )} + /> + + + + } + /> + + + )} + {canViewHideSysMes && ( + + + {t('Hide_System_Messages')} + + ( + + )} + /> + + + + ( + + )} + /> + + + )} + {canViewEncrypted && ( + + + {t('Encrypted')} + + ( + + )} + /> + + + + )} + + {retentionPolicy && ( + + + + + + {t('RetentionPolicyRoom_Enabled')} + + ( + + )} + /> + + + + + + {t('RetentionPolicyRoom_OverrideGlobal')} + + ( + + )} + /> + + + + {retentionOverrideGlobal && ( + <> + + {t('RetentionPolicyRoom_ReadTheDocs')} + + + {t('RetentionPolicyRoom_MaxAge', { max: retentionMaxAge })} + + ( + onChange(Math.max(1, Number(currentValue)))} + /> + )} + /> + + + + + {t('RetentionPolicyRoom_ExcludePinned')} + + ( + + )} + /> + + + + + + {t('RetentionPolicyRoom_FilesOnly')} + + ( + + )} + /> + + + + + )} + + + + )} +
+
+ + + + + + + + + + + ); +}; + +export default EditRoomInfo; diff --git a/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfoWithData.tsx b/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfoWithData.tsx new file mode 100644 index 000000000000..ad758c1bc8a6 --- /dev/null +++ b/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/EditRoomInfoWithData.tsx @@ -0,0 +1,15 @@ +import type { IRoomWithRetentionPolicy } from '@rocket.chat/core-typings'; +import React from 'react'; + +import { useRoom } from '../../../contexts/RoomContext'; +import { useRoomToolbox } from '../../../contexts/RoomToolboxContext'; +import EditRoomInfo from './EditRoomInfo'; + +const EditRoomInfoWithData = ({ onClickBack }: { onClickBack: () => void }) => { + const room = useRoom() as IRoomWithRetentionPolicy; + const { closeTab } = useRoomToolbox(); + + return ; +}; + +export default EditRoomInfoWithData; diff --git a/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/index.ts b/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/index.ts index 4083ad9a958f..d8b31e17800c 100644 --- a/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/index.ts +++ b/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/index.ts @@ -1 +1 @@ -export { default } from './EditChannelWithData'; +export { default } from './EditRoomInfoWithData'; diff --git a/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts b/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts new file mode 100644 index 000000000000..f36802bb9f56 --- /dev/null +++ b/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomInitialValues.ts @@ -0,0 +1,71 @@ +import type { IRoomWithRetentionPolicy } from '@rocket.chat/core-typings'; +import { useSetting } from '@rocket.chat/ui-contexts'; +import { useMemo } from 'react'; + +import { roomCoordinator } from '../../../../../lib/rooms/roomCoordinator'; + +const getPolicyRoomType = (roomType: IRoomWithRetentionPolicy['t']) => { + switch (roomType) { + case 'c': + return 'Channels'; + case 'p': + return 'Groups'; + case 'd': + return 'DMs'; + } +}; + +export const useEditRoomInitialValues = (room: IRoomWithRetentionPolicy) => { + const { t, ro, archived, topic, description, announcement, joinCodeRequired, sysMes, encrypted, retention, reactWhenReadOnly } = room; + + const retentionPolicyEnabled = useSetting('RetentionPolicy_Enabled'); + const maxAgeDefault = useSetting(`RetentionPolicy_MaxAge_${getPolicyRoomType(room.t)}`) || 30; + const retentionEnabledDefault = useSetting(`RetentionPolicy_AppliesTo${getPolicyRoomType(room.t)}`); + const excludePinnedDefault = useSetting('RetentionPolicy_DoNotPrunePinned'); + const filesOnlyDefault = useSetting('RetentionPolicy_FilesOnly'); + + return useMemo( + () => ({ + roomName: t === 'd' && room.usernames ? room.usernames.join(' x ') : roomCoordinator.getRoomName(t, room), + roomType: t, + readOnly: !!ro, + reactWhenReadOnly, + archived: !!archived, + roomTopic: topic ?? '', + roomDescription: description ?? '', + roomAnnouncement: announcement ?? '', + roomAvatar: undefined, + joinCode: '', + joinCodeRequired: !!joinCodeRequired, + systemMessages: Array.isArray(sysMes) ? sysMes : [], + hideSysMes: Array.isArray(sysMes) ? !!sysMes?.length : !!sysMes, + encrypted, + ...(retentionPolicyEnabled && { + retentionEnabled: retention?.enabled ?? retentionEnabledDefault, + retentionOverrideGlobal: !!retention?.overrideGlobal, + retentionMaxAge: Math.min(retention?.maxAge, maxAgeDefault) || maxAgeDefault, + retentionExcludePinned: retention?.excludePinned ?? excludePinnedDefault, + retentionFilesOnly: retention?.filesOnly ?? filesOnlyDefault, + }), + }), + [ + announcement, + archived, + description, + excludePinnedDefault, + filesOnlyDefault, + joinCodeRequired, + maxAgeDefault, + retention, + retentionEnabledDefault, + retentionPolicyEnabled, + ro, + room, + sysMes, + t, + topic, + encrypted, + reactWhenReadOnly, + ], + ); +}; diff --git a/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomPermissions.ts b/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomPermissions.ts new file mode 100644 index 000000000000..7b9e8c353941 --- /dev/null +++ b/apps/meteor/client/views/room/contextualBar/Info/EditRoomInfo/useEditRoomPermissions.ts @@ -0,0 +1,77 @@ +import type { IRoom, IRoomWithRetentionPolicy } from '@rocket.chat/core-typings'; +import { usePermission, useAtLeastOnePermission, useRole } from '@rocket.chat/ui-contexts'; +import { useMemo } from 'react'; + +import { e2e } from '../../../../../../app/e2e/client/rocketchat.e2e'; +import { RoomSettingsEnum } from '../../../../../../definition/IRoomTypeConfig'; +import { roomCoordinator } from '../../../../../lib/rooms/roomCoordinator'; + +const getCanChangeType = (room: IRoom | IRoomWithRetentionPolicy, canCreateChannel: boolean, canCreateGroup: boolean, isAdmin: boolean) => + (!room.default || isAdmin) && ((room.t === 'p' && canCreateChannel) || (room.t === 'c' && canCreateGroup)); + +export const useEditRoomPermissions = (room: IRoom | IRoomWithRetentionPolicy) => { + const isAdmin = useRole('admin'); + const canCreateChannel = usePermission('create-c'); + const canCreateGroup = usePermission('create-p'); + + const canChangeType = getCanChangeType(room, canCreateChannel, canCreateGroup, isAdmin); + const canSetReadOnly = usePermission('set-readonly', room._id); + const canSetReactWhenReadOnly = usePermission('set-react-when-readonly', room._id); + const canEditRoomRetentionPolicy = usePermission('edit-room-retention-policy', room._id); + const canArchiveOrUnarchive = useAtLeastOnePermission( + useMemo(() => ['archive-room', 'unarchive-room'], []), + room._id, + ); + const canToggleEncryption = usePermission('toggle-room-e2e-encryption', room._id) && (room.encrypted || e2e.isReady()); + + const [ + canViewName, + canViewTopic, + canViewAnnouncement, + canViewArchived, + canViewDescription, + canViewType, + canViewReadOnly, + canViewHideSysMes, + canViewJoinCode, + canViewEncrypted, + ] = useMemo(() => { + const isAllowed = + roomCoordinator.getRoomDirectives(room.t)?.allowRoomSettingChange || + (() => { + undefined; + }); + return [ + isAllowed(room, RoomSettingsEnum.NAME), + isAllowed(room, RoomSettingsEnum.TOPIC), + isAllowed(room, RoomSettingsEnum.ANNOUNCEMENT), + isAllowed(room, RoomSettingsEnum.ARCHIVE_OR_UNARCHIVE), + isAllowed(room, RoomSettingsEnum.DESCRIPTION), + isAllowed(room, RoomSettingsEnum.TYPE), + isAllowed(room, RoomSettingsEnum.READ_ONLY), + isAllowed(room, RoomSettingsEnum.SYSTEM_MESSAGES), + isAllowed(room, RoomSettingsEnum.JOIN_CODE), + isAllowed(room, RoomSettingsEnum.REACT_WHEN_READ_ONLY), + isAllowed(room, RoomSettingsEnum.E2E), + ]; + }, [room]); + + return { + canChangeType, + canSetReadOnly, + canSetReactWhenReadOnly, + canEditRoomRetentionPolicy, + canArchiveOrUnarchive, + canToggleEncryption, + canViewName, + canViewTopic, + canViewAnnouncement, + canViewArchived, + canViewDescription, + canViewType, + canViewReadOnly, + canViewHideSysMes, + canViewJoinCode, + canViewEncrypted, + }; +}; diff --git a/apps/meteor/client/views/room/contextualBar/Info/hooks/actions/useRoomDelete.tsx b/apps/meteor/client/views/room/contextualBar/Info/hooks/actions/useRoomDelete.tsx deleted file mode 100644 index b812e896bab9..000000000000 --- a/apps/meteor/client/views/room/contextualBar/Info/hooks/actions/useRoomDelete.tsx +++ /dev/null @@ -1,45 +0,0 @@ -import type { IRoom } from '@rocket.chat/core-typings'; -import { isRoomFederated } from '@rocket.chat/core-typings'; -import { useMutableCallback } from '@rocket.chat/fuselage-hooks'; -import { useSetModal, useToastMessageDispatch, useTranslation, useEndpoint, usePermission, useRouter } from '@rocket.chat/ui-contexts'; -import React from 'react'; - -import GenericModal from '../../../../../../components/GenericModal'; - -// TODO: resetState for TeamsChannels -export const useRoomDelete = (room: IRoom, resetState?: () => void) => { - const t = useTranslation(); - const setModal = useSetModal(); - const dispatchToastMessage = useToastMessageDispatch(); - const router = useRouter(); - - const hasPermissionToDelete = usePermission(room.t === 'c' ? 'delete-c' : 'delete-p', room._id); - const canDelete = isRoomFederated(room) ? false : hasPermissionToDelete; - - const deleteRoom = useEndpoint('POST', room.t === 'c' ? '/v1/channels.delete' : '/v1/groups.delete'); - - const handleDelete = useMutableCallback(() => { - const onConfirm = async () => { - try { - await deleteRoom({ roomId: room._id }); - dispatchToastMessage({ type: 'success', message: t('Room_has_been_deleted') }); - if (resetState) { - return resetState(); - } - - router.navigate('/home'); - } catch (error) { - dispatchToastMessage({ type: 'error', message: error }); - } - setModal(null); - }; - - setModal( - setModal(null)} confirmText={t('Yes_delete_it')}> - {t('Delete_Room_Warning')} - , - ); - }); - - return canDelete ? handleDelete : null; -}; diff --git a/apps/meteor/client/views/room/contextualBar/Info/hooks/useRoomActions.ts b/apps/meteor/client/views/room/contextualBar/Info/hooks/useRoomActions.ts index d0ab03bd9ee7..638cd23b66ed 100644 --- a/apps/meteor/client/views/room/contextualBar/Info/hooks/useRoomActions.ts +++ b/apps/meteor/client/views/room/contextualBar/Info/hooks/useRoomActions.ts @@ -1,10 +1,9 @@ -import { isRoomFederated } from '@rocket.chat/core-typings'; import type { IRoom } from '@rocket.chat/core-typings'; import { useTranslation } from '@rocket.chat/ui-contexts'; import { useMemo } from 'react'; +import { useDeleteRoom } from '../../../../hooks/roomActions/useDeleteRoom'; import { useRoomConvertToTeam } from './actions/useRoomConvertToTeam'; -import { useRoomDelete } from './actions/useRoomDelete'; import { useRoomHide } from './actions/useRoomHide'; import { useRoomLeave } from './actions/useRoomLeave'; import { useRoomMoveToTeam } from './actions/useRoomMoveToTeam'; @@ -16,11 +15,10 @@ type RoomActions = { export const useRoomActions = (room: IRoom, { onClickEnterRoom, onClickEdit }: RoomActions, resetState?: () => void) => { const t = useTranslation(); - const isFederated = isRoomFederated(room); const handleHide = useRoomHide(room); const handleLeave = useRoomLeave(room); - const handleDelete = useRoomDelete(room, resetState); + const { handleDelete, canDeleteRoom } = useDeleteRoom(room, { reload: resetState }); const handleMoveToTeam = useRoomMoveToTeam(room); const handleConvertToTeam = useRoomConvertToTeam(room); @@ -40,7 +38,7 @@ export const useRoomActions = (room: IRoom, { onClickEnterRoom, onClickEdit }: R action: onClickEdit, }, }), - ...(!isFederated && + ...(canDeleteRoom && handleDelete && { delete: { label: t('Delete'), @@ -77,7 +75,7 @@ export const useRoomActions = (room: IRoom, { onClickEnterRoom, onClickEdit }: R }, }), }), - [onClickEdit, t, handleDelete, handleMoveToTeam, handleConvertToTeam, handleHide, handleLeave, onClickEnterRoom, isFederated], + [onClickEdit, t, handleDelete, handleMoveToTeam, handleConvertToTeam, handleHide, handleLeave, onClickEnterRoom, canDeleteRoom], ); return memoizedActions; diff --git a/apps/meteor/client/views/teams/contextualBar/info/TeamsInfoWithData.js b/apps/meteor/client/views/teams/contextualBar/info/TeamsInfoWithData.js index 0b72b3f164a6..f5cb4a44c5d2 100644 --- a/apps/meteor/client/views/teams/contextualBar/info/TeamsInfoWithData.js +++ b/apps/meteor/client/views/teams/contextualBar/info/TeamsInfoWithData.js @@ -16,10 +16,10 @@ import { GenericModalDoNotAskAgain } from '../../../../components/GenericModal'; import { useDontAskAgain } from '../../../../hooks/useDontAskAgain'; import { useEndpointAction } from '../../../../hooks/useEndpointAction'; import { roomCoordinator } from '../../../../lib/rooms/roomCoordinator'; +import { useDeleteRoom } from '../../../hooks/roomActions/useDeleteRoom'; import { useRoom } from '../../../room/contexts/RoomContext'; import { useRoomToolbox } from '../../../room/contexts/RoomToolboxContext'; import ConvertToChannelModal from '../../ConvertToChannelModal'; -import DeleteTeamModal from './DeleteTeam'; import LeaveTeam from './LeaveTeam'; import TeamsInfo from './TeamsInfo'; @@ -56,7 +56,6 @@ const TeamsInfoWithLogic = ({ openEditing }) => { const setModal = useSetModal(); const closeModal = useMutableCallback(() => setModal()); - const deleteTeam = useEndpointAction('POST', '/v1/teams.delete'); const leaveTeam = useEndpointAction('POST', '/v1/teams.leave'); const convertTeamToChannel = useEndpointAction('POST', '/v1/teams.convertToChannel'); @@ -64,28 +63,11 @@ const TeamsInfoWithLogic = ({ openEditing }) => { const router = useRouter(); - const canDelete = usePermission('delete-team', room._id); const canEdit = usePermission('edit-team-channel', room._id); // const canLeave = usePermission('leave-team'); /* && room.cl !== false && joined */ - const onClickDelete = useMutableCallback(() => { - const onConfirm = async (deletedRooms) => { - const roomsToRemove = Array.isArray(deletedRooms) && deletedRooms.length > 0 ? deletedRooms : []; - - try { - await deleteTeam({ teamId: room.teamId, ...(roomsToRemove.length && { roomsToRemove }) }); - dispatchToastMessage({ type: 'success', message: t('Team_has_been_deleted') }); - router.navigate('/home'); - } catch (error) { - dispatchToastMessage({ type: 'error', message: error }); - } finally { - closeModal(); - } - }; - - setModal(); - }); + const { handleDelete, canDeleteRoom } = useDeleteRoom(room); const onClickLeave = useMutableCallback(() => { const onConfirm = async (roomsLeft) => { @@ -174,7 +156,7 @@ const TeamsInfoWithLogic = ({ openEditing }) => { retentionPolicy={retentionPolicyEnabled && retentionPolicy} onClickEdit={canEdit && openEditing} onClickClose={closeTab} - onClickDelete={canDelete && onClickDelete} + onClickDelete={canDeleteRoom && handleDelete} onClickLeave={/* canLeave && */ onClickLeave} onClickHide={/* joined && */ handleHide} onClickViewChannels={onClickViewChannels} From 54d8ad439251808e26fd999286236ceb6e041aa1 Mon Sep 17 00:00:00 2001 From: Noach Magedman Date: Fri, 13 Oct 2023 19:20:55 +0300 Subject: [PATCH 207/211] fix: Improve FileProxy Handling, set Content-Type (#30427) Co-authored-by: Diego Sampaio <8591547+sampaiodiego@users.noreply.github.com> --- .changeset/tough-apples-turn.md | 5 ++++ .../app/file-upload/server/lib/FileUpload.ts | 27 ++++++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 .changeset/tough-apples-turn.md diff --git a/.changeset/tough-apples-turn.md b/.changeset/tough-apples-turn.md new file mode 100644 index 000000000000..056a0645186e --- /dev/null +++ b/.changeset/tough-apples-turn.md @@ -0,0 +1,5 @@ +--- +"@rocket.chat/meteor": patch +--- + +Forward headers when using proxy for file uploads diff --git a/apps/meteor/app/file-upload/server/lib/FileUpload.ts b/apps/meteor/app/file-upload/server/lib/FileUpload.ts index 8f929a17fe34..e512e5d09bfe 100644 --- a/apps/meteor/app/file-upload/server/lib/FileUpload.ts +++ b/apps/meteor/app/file-upload/server/lib/FileUpload.ts @@ -562,7 +562,32 @@ export const FileUpload = { ) { res.setHeader('Content-Disposition', `${forceDownload ? 'attachment' : 'inline'}; filename="${encodeURI(fileName)}"`); - request.get(fileUrl, (fileRes) => fileRes.pipe(res)); + request.get(fileUrl, (fileRes) => { + if (fileRes.statusCode !== 200) { + res.setHeader('x-rc-proxyfile-status', String(fileRes.statusCode)); + res.setHeader('content-length', 0); + res.writeHead(500); + res.end(); + return; + } + + // eslint-disable-next-line prettier/prettier + const headersToProxy = [ + 'age', + 'cache-control', + 'content-length', + 'content-type', + 'date', + 'expired', + 'last-modified', + ]; + + headersToProxy.forEach((header) => { + fileRes.headers[header] && res.setHeader(header, String(fileRes.headers[header])); + }); + + fileRes.pipe(res); + }); }, generateJWTToFileUrls({ rid, userId, fileId }: { rid: string; userId: string; fileId: string }) { From 5da4636471037d563600553a287b821446c1f342 Mon Sep 17 00:00:00 2001 From: Douglas Fabris Date: Fri, 13 Oct 2023 18:31:06 -0300 Subject: [PATCH 208/211] refactor: Replace `useForm` in favor of RHF on `AppInstallPage` (#30634) --- .../views/marketplace/AppInstallPage.js | 74 ++++++++++--------- .../rocketchat-i18n/i18n/en.i18n.json | 1 + 2 files changed, 42 insertions(+), 33 deletions(-) diff --git a/apps/meteor/client/views/marketplace/AppInstallPage.js b/apps/meteor/client/views/marketplace/AppInstallPage.js index 77afd5361c88..f3b4f02b0c16 100644 --- a/apps/meteor/client/views/marketplace/AppInstallPage.js +++ b/apps/meteor/client/views/marketplace/AppInstallPage.js @@ -1,4 +1,5 @@ -import { Button, ButtonGroup, Icon, Field, FieldGroup, TextInput, Throbber } from '@rocket.chat/fuselage'; +import { Button, ButtonGroup, Icon, Field, FieldGroup, FieldLabel, FieldRow, TextInput } from '@rocket.chat/fuselage'; +import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useSetModal, useEndpoint, @@ -8,13 +9,13 @@ import { useRouter, useSearchParameter, } from '@rocket.chat/ui-contexts'; -import React, { useCallback, useEffect, useState } from 'react'; +import React, { useCallback, useState } from 'react'; +import { useForm, Controller } from 'react-hook-form'; import { AppClientOrchestratorInstance } from '../../../ee/client/apps/orchestrator'; import Page from '../../components/Page'; import { useAppsReload } from '../../contexts/hooks/useAppsReload'; import { useFileInput } from '../../hooks/useFileInput'; -import { useForm } from '../../hooks/useForm'; import AppPermissionsReviewModal from './AppPermissionsReviewModal'; import AppUpdateModal from './AppUpdateModal'; import AppInstallModal from './components/AppInstallModal/AppInstallModal'; @@ -48,22 +49,12 @@ function AppInstallPage() { const appCountQuery = useAppsCountQuery('private'); - const { values, handlers } = useForm({ - file: {}, - url: queryUrl, - }); + const { control, setValue, watch } = useForm({ defaultValues: { url: queryUrl || '' } }); + const { file, url } = watch(); - const { file, url } = values; + const canSave = !!url || !!file?.name; - const canSave = !!url || !!file.name; - - const { handleFile, handleUrl } = handlers; - - useEffect(() => { - queryUrl && handleUrl(queryUrl); - }, [queryUrl, handleUrl]); - - const [handleUploadButtonClick] = useFileInput(handleFile, 'app'); + const [handleUploadButtonClick] = useFileInput((value) => setValue('file', value), 'app'); const sendFile = async (permissionsGranted, appFile, appId) => { let app; @@ -200,35 +191,52 @@ function AppInstallPage() { }); }; + const urlField = useUniqueId(); + const fileField = useUniqueId(); + return ( - {t('App_Url_to_Install_From')} - - } /> - + {t('App_Url_to_Install_From')} + + ( + } {...field} /> + )} + /> + - {t('App_Url_to_Install_From_File')} - - - {t('Browse_Files')} - - } + {t('App_Url_to_Install_From_File')} + + ( + + {t('Browse_Files')} + + } + /> + )} /> - + diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 0a39692523eb..80ad18ad6743 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -2611,6 +2611,7 @@ "Install_FxOs_done": "Great! You can now use Rocket.Chat via the icon on your homescreen. Have fun with Rocket.Chat!", "Install_FxOs_error": "Sorry, that did not work as intended! The following error appeared:", "Install_FxOs_follow_instructions": "Please confirm the app installation on your device (press \"Install\" when prompted).", + "Installing": "Installing", "Install_package": "Install package", "Installation": "Installation", "Installed": "Installed", From 169da3a0c80199fd499e9b32a2a189ef91dda45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Jaeger=20Foresti?= <60678893+juliajforesti@users.noreply.github.com> Date: Sun, 15 Oct 2023 12:15:17 -0300 Subject: [PATCH 209/211] chore: improve `Tag` a11y link (#30636) --- .../RoomForeword/RoomForewordUsernameList.tsx | 5 +-- .../RoomForewordUsernameListItem.tsx | 15 ++++---- apps/meteor/package.json | 2 +- ee/packages/ui-theming/package.json | 2 +- ee/packages/ui-theming/src/palette.ts | 36 +++++++++---------- ee/packages/ui-theming/src/paletteDark.ts | 2 +- packages/fuselage-ui-kit/package.json | 2 +- packages/gazzodown/package.json | 2 +- packages/ui-client/package.json | 2 +- packages/ui-composer/package.json | 2 +- packages/ui-video-conf/package.json | 2 +- packages/uikit-playground/package.json | 2 +- yarn.lock | 24 ++++++------- 13 files changed, 48 insertions(+), 50 deletions(-) diff --git a/apps/meteor/client/views/room/body/RoomForeword/RoomForewordUsernameList.tsx b/apps/meteor/client/views/room/body/RoomForeword/RoomForewordUsernameList.tsx index b84a867d11d7..4677bb5e1ad3 100644 --- a/apps/meteor/client/views/room/body/RoomForeword/RoomForewordUsernameList.tsx +++ b/apps/meteor/client/views/room/body/RoomForeword/RoomForewordUsernameList.tsx @@ -1,4 +1,5 @@ import type { IUser } from '@rocket.chat/core-typings'; +import { Margins } from '@rocket.chat/fuselage'; import { useSetting } from '@rocket.chat/ui-contexts'; import type { VFC } from 'react'; import React from 'react'; @@ -11,7 +12,7 @@ type RoomForewordUsernameListProps = { usernames: Array = ({ usernames }) => { const useRealName = Boolean(useSetting('UI_Use_Real_Name')); return ( - <> + {usernames.map((username) => ( = ({ username useRealName={useRealName} /> ))} - + ); }; diff --git a/apps/meteor/client/views/room/body/RoomForeword/RoomForewordUsernameListItem.tsx b/apps/meteor/client/views/room/body/RoomForeword/RoomForewordUsernameListItem.tsx index fe148aa79d78..a0732b35d29d 100644 --- a/apps/meteor/client/views/room/body/RoomForeword/RoomForewordUsernameListItem.tsx +++ b/apps/meteor/client/views/room/body/RoomForeword/RoomForewordUsernameListItem.tsx @@ -1,5 +1,5 @@ import type { IUser } from '@rocket.chat/core-typings'; -import { Box, Icon, Tag, Skeleton } from '@rocket.chat/fuselage'; +import { Icon, Tag, Skeleton } from '@rocket.chat/fuselage'; import type { VFC } from 'react'; import React from 'react'; @@ -12,18 +12,15 @@ type RoomForewordUsernameListItemProps = { useRealName: boolean; }; -// TODO: Improve `Tag` a11y to be used as a link const RoomForewordUsernameListItem: VFC = ({ username, href, useRealName }) => { const { data, isLoading, isError } = useUserInfoQuery({ username }); return ( - - } className='mention-link' data-username={username} large> - {isLoading && } - {!isLoading && isError && username} - {!isLoading && !isError && getUserDisplayName(data?.user?.name, username, useRealName)} - - + } data-username={username} large href={href}> + {isLoading && } + {!isLoading && isError && username} + {!isLoading && !isError && getUserDisplayName(data?.user?.name, username, useRealName)} + ); }; diff --git a/apps/meteor/package.json b/apps/meteor/package.json index c1014a749158..3ee3366f47dd 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -236,7 +236,7 @@ "@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": "^0.32.2", + "@rocket.chat/fuselage": "^0.34.0", "@rocket.chat/fuselage-hooks": "^0.32.1", "@rocket.chat/fuselage-polyfills": "next", "@rocket.chat/fuselage-toastbar": "next", diff --git a/ee/packages/ui-theming/package.json b/ee/packages/ui-theming/package.json index 9508e2b8e41e..11aa5fd57ff8 100644 --- a/ee/packages/ui-theming/package.json +++ b/ee/packages/ui-theming/package.json @@ -4,7 +4,7 @@ "private": true, "devDependencies": { "@rocket.chat/css-in-js": "next", - "@rocket.chat/fuselage": "^0.32.2", + "@rocket.chat/fuselage": "^0.34.0", "@rocket.chat/fuselage-hooks": "^0.32.1", "@rocket.chat/icons": "^0.32.0", "@rocket.chat/ui-contexts": "workspace:~", diff --git a/ee/packages/ui-theming/src/palette.ts b/ee/packages/ui-theming/src/palette.ts index 39f8d3f2bfed..5d207d63bc21 100644 --- a/ee/packages/ui-theming/src/palette.ts +++ b/ee/packages/ui-theming/src/palette.ts @@ -46,8 +46,8 @@ export const palette = [ { name: 'font-white', token: 'white', color: '#FFFFFF' }, { name: 'font-disabled', token: 'N500', color: '#CBCED1' }, { name: 'font-annotation', token: 'N600', color: '#9EA2A8' }, - { name: 'font-hint', token: 'N700', color: '#6C727A' }, - { name: 'font-secondary-info', token: 'N700', color: '#6C727A' }, + { name: 'font-hint', token: 'N700', color: '#6C737A' }, + { name: 'font-secondary-info', token: 'N700', color: '#6C737A' }, { name: 'font-default', token: 'N800', color: '#2F343D' }, { name: 'font-titles-labels', token: 'N900', color: '#1F2329' }, { name: 'font-info', token: 'P600', color: '#095AD2' }, @@ -76,7 +76,7 @@ export const palette = [ { name: 'status-font-on-info', token: 'P600', color: '#095AD2' }, { name: 'status-font-on-success', token: 'S800', color: '#148660' }, { name: 'status-font-on-danger', token: 'D800', color: '#9B1325' }, - { name: 'status-font-on-warning', token: 'W900', color: '#B88D00' }, + { name: 'status-font-on-warning', token: 'W900', color: '#8E6300' }, { name: 'status-font-on-warning-2', token: 'N800', color: '#2F343D' }, { name: 'status-font-on-service-1', token: 'S1-800', color: '#974809' }, { name: 'status-font-on-service-2 ', token: 'S2-600', color: '#7F1B9F' }, @@ -88,22 +88,22 @@ export const palette = [ description: 'Badge Background', list: [ { name: 'badge-background-level-0', token: '', color: '#E4E7EA' }, - { name: 'badge-background-level-1', token: 'N700', color: '#6C727A' }, - { name: 'badge-background-level-2', token: '', color: '#1D74F5' }, + { name: 'badge-background-level-1', token: 'N700', color: '#6C737A' }, + { name: 'badge-background-level-2', token: '', color: '#156FF5' }, { name: 'badge-background-level-3', token: '', color: '#F38C39' }, - { name: 'badge-background-level-4', token: '', color: '#F5455C' }, + { name: 'badge-background-level-4', token: '', color: '#EC0D2A' }, ], }, { category: 'Status Bullet', description: 'Used to show user status', list: [ - { name: 'status-bullet-online', token: '', color: '#158D65' }, + { name: 'status-bullet-online', token: '', color: '#148660' }, { name: 'status-bullet-away', token: '', color: '#AC892F' }, - { name: 'status-bullet-busy', token: '', color: '#DA1F37' }, + { name: 'status-bullet-busy', token: '', color: '#D40C26' }, { name: 'status-bullet-disabled', token: '', color: '#F38C39' }, - { name: 'status-bullet-offline', token: '', color: '#AC892F' }, - { name: 'status-bullet-loading', token: '', color: '#9ea2a8' }, + { name: 'status-bullet-offline', token: '', color: '#6C737A' }, + { name: 'status-bullet-loading', token: '', color: '#6C737A' }, ], }, { @@ -122,7 +122,7 @@ export const palette = [ list: [ { name: 'button-background-primary-default', token: 'P500', color: '#156FF5' }, { name: 'button-background-primary-hover', token: 'P600', color: '#095AD2' }, - { name: 'button-background-primary-press', token: 'P700', color: '#095AD2' }, + { name: 'button-background-primary-press', token: 'P700', color: '#10529E' }, { name: 'button-background-primary-focus', token: 'P500', color: '#156FF5' }, { name: 'button-background-primary-keyfocus', token: 'P500', color: '#156FF5' }, { name: 'button-background-primary-disabled', token: 'P200', color: '#D1EBFE' }, @@ -133,7 +133,7 @@ export const palette = [ list: [ { name: 'button-background-secondary-default', token: 'N400', color: '#E4E7EA' }, { name: 'button-background-secondary-hover', token: 'N500', color: '#CBCED1' }, - { name: 'button-background-secondary-press', token: 'N600', color: '#CBCED1' }, + { name: 'button-background-secondary-press', token: 'N600', color: '#9EA2A8' }, { name: 'button-background-secondary-focus', token: 'N400', color: '#E4E7EA' }, { name: 'button-background-secondary-keyfocus', token: 'N400', color: '#E4E7EA' }, { name: 'button-background-secondary-disabled', token: 'N300', color: '#EEEFF1' }, @@ -144,7 +144,7 @@ export const palette = [ list: [ { name: 'button-background-secondary-danger-default', token: 'N400', color: '#E4E7EA' }, { name: 'button-background-secondary-danger-hover', token: 'N500', color: '#CBCED1' }, - { name: 'button-background-secondary-danger-press', token: 'N600', color: '#CBCED1' }, + { name: 'button-background-secondary-danger-press', token: 'N600', color: '#9EA2A8' }, { name: 'button-background-secondary-danger-focus', token: 'N400', color: '#E4E7EA' }, { name: 'button-background-secondary-danger-keyfocus', token: 'N400', color: '#E4E7EA' }, { name: 'button-background-secondary-danger-disabled', token: 'N300', color: '#EEEFF1' }, @@ -164,11 +164,11 @@ export const palette = [ { description: 'Success Background', list: [ - { name: 'button-background-success-default', token: '', color: '#158D65' }, + { name: 'button-background-success-default', token: '', color: '#148660' }, { name: 'button-background-success-hover', token: 'S900', color: '#106D4F' }, { name: 'button-background-success-press', token: 'S1000', color: '#0D5940' }, - { name: 'button-background-success-focus', token: '', color: '#158D65' }, - { name: 'button-background-success-keyfocus', token: '', color: '#158D65' }, + { name: 'button-background-success-focus', token: '', color: '#148660' }, + { name: 'button-background-success-keyfocus', token: '', color: '#148660' }, { name: 'button-background-success-disabled', token: 'S200', color: '#C0F6E4' }, ], }, @@ -179,7 +179,7 @@ export const palette = [ { name: 'button-font-on-primary-disabled', token: 'white', color: '#FFFFFF' }, { name: 'button-font-on-secondary', token: 'N900', color: '#1F2329' }, { name: 'button-font-on-secondary-disabled', token: 'N600', color: '#CBCED1' }, - { name: 'button-font-on-secondary-danger', token: 'D900', color: '#BB0B21' }, + { name: 'button-font-on-secondary-danger', token: '', color: '#BB0B21' }, { name: 'button-font-on-secondary-danger-disabled', token: 'D300', @@ -187,7 +187,7 @@ export const palette = [ }, { name: 'button-font-on-danger', token: 'white', color: '#FFFFFF' }, { name: 'button-font-on-danger-disabled', token: 'white', color: '#FFFFFF' }, - { name: 'button-font-on-success', token: '', color: '#EBECEF' }, + { name: 'button-font-on-success', token: '', color: '#FFFFFF' }, { name: 'button-font-on-success-disabled', token: 'white', color: '#FFFFFF' }, ], }, diff --git a/ee/packages/ui-theming/src/paletteDark.ts b/ee/packages/ui-theming/src/paletteDark.ts index cdb60efffeac..89ac7817be42 100644 --- a/ee/packages/ui-theming/src/paletteDark.ts +++ b/ee/packages/ui-theming/src/paletteDark.ts @@ -9,7 +9,7 @@ export const palette = [ { name: 'stroke-dark', token: 'N600', color: '#9EA2A8' }, { name: 'stroke-extra-dark', token: 'N400', color: '#CBCED1' }, { name: 'stroke-extra-light-highlight', token: '', color: '#87CBFC' }, - { name: 'stroke-highlight', token: '', color: '#3976D1' }, + { name: 'stroke-highlight', token: '', color: '#6292DA' }, { name: 'stroke-extra-light-error', token: '', color: '#F49AA6' }, { name: 'stroke-error', token: '', color: '#BB3E4E' }, ], diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 83ab677e2a9f..4555216c2d44 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -56,7 +56,7 @@ "devDependencies": { "@rocket.chat/apps-engine": "1.41.0-alpha.290", "@rocket.chat/eslint-config": "workspace:^", - "@rocket.chat/fuselage": "^0.32.2", + "@rocket.chat/fuselage": "^0.34.0", "@rocket.chat/fuselage-hooks": "^0.32.1", "@rocket.chat/fuselage-polyfills": "next", "@rocket.chat/icons": "^0.32.0", diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index 89136a296f9d..e891e5677c75 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": "^0.32.2", + "@rocket.chat/fuselage": "^0.34.0", "@rocket.chat/fuselage-tokens": "next", "@rocket.chat/message-parser": "next", "@rocket.chat/styled": "next", diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index fa227575ccc2..f8ef2d3a1e93 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -5,7 +5,7 @@ "devDependencies": { "@babel/core": "~7.22.9", "@rocket.chat/css-in-js": "next", - "@rocket.chat/fuselage": "^0.32.2", + "@rocket.chat/fuselage": "^0.34.0", "@rocket.chat/fuselage-hooks": "^0.32.1", "@rocket.chat/icons": "^0.32.0", "@rocket.chat/mock-providers": "workspace:^", diff --git a/packages/ui-composer/package.json b/packages/ui-composer/package.json index 1d5d478e17cd..b5c804b4a2ad 100644 --- a/packages/ui-composer/package.json +++ b/packages/ui-composer/package.json @@ -5,7 +5,7 @@ "devDependencies": { "@babel/core": "~7.22.9", "@rocket.chat/eslint-config": "workspace:^", - "@rocket.chat/fuselage": "^0.32.2", + "@rocket.chat/fuselage": "^0.34.0", "@rocket.chat/icons": "^0.32.0", "@storybook/addon-actions": "~6.5.16", "@storybook/addon-docs": "~6.5.16", diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index d253b61cc1b0..7ca7b1d86140 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -6,7 +6,7 @@ "@babel/core": "~7.22.9", "@rocket.chat/css-in-js": "next", "@rocket.chat/eslint-config": "workspace:^", - "@rocket.chat/fuselage": "^0.32.2", + "@rocket.chat/fuselage": "^0.34.0", "@rocket.chat/fuselage-hooks": "^0.32.1", "@rocket.chat/icons": "^0.32.0", "@rocket.chat/styled": "next", diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index 5e8e3bf2cc5c..5a8b1276defb 100644 --- a/packages/uikit-playground/package.json +++ b/packages/uikit-playground/package.json @@ -15,7 +15,7 @@ "@codemirror/tooltip": "^0.19.16", "@lezer/highlight": "^1.1.6", "@rocket.chat/css-in-js": "next", - "@rocket.chat/fuselage": "^0.32.2", + "@rocket.chat/fuselage": "^0.34.0", "@rocket.chat/fuselage-hooks": "^0.32.1", "@rocket.chat/fuselage-polyfills": "next", "@rocket.chat/fuselage-tokens": "next", diff --git a/yarn.lock b/yarn.lock index 7d75c388dc29..b4e4af200f30 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8273,7 +8273,7 @@ __metadata: dependencies: "@rocket.chat/apps-engine": 1.41.0-alpha.290 "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/fuselage": ^0.32.2 + "@rocket.chat/fuselage": ^0.34.0 "@rocket.chat/fuselage-hooks": ^0.32.1 "@rocket.chat/fuselage-polyfills": next "@rocket.chat/gazzodown": "workspace:^" @@ -8322,9 +8322,9 @@ __metadata: languageName: unknown linkType: soft -"@rocket.chat/fuselage@npm:^0.32.2": - version: 0.32.2 - resolution: "@rocket.chat/fuselage@npm:0.32.2" +"@rocket.chat/fuselage@npm:^0.34.0": + version: 0.34.0 + resolution: "@rocket.chat/fuselage@npm:0.34.0" dependencies: "@rocket.chat/css-in-js": ^0.31.25 "@rocket.chat/css-supports": ^0.31.25 @@ -8342,7 +8342,7 @@ __metadata: react: ^17.0.2 react-dom: ^17.0.2 react-virtuoso: 1.2.4 - checksum: 28e80385961b090c71d0897c22c3c799ca05d30285456d96d3ca5ff2a1a4ba02362644084e611bd3f2a376acdf4c2e75180b8aee196a63969a7d6559abd73d79 + checksum: 72cd1dd7ef13cc3b69fadac5c064a45cd2b65b8a221cde2e8149fa873ac6de89648c677caedb10979e5cf08d39b79f1d7a30caa6378bdeeb873414c7fbac5e6e languageName: node linkType: hard @@ -8353,7 +8353,7 @@ __metadata: "@babel/core": ~7.22.9 "@rocket.chat/core-typings": "workspace:^" "@rocket.chat/css-in-js": next - "@rocket.chat/fuselage": ^0.32.2 + "@rocket.chat/fuselage": ^0.34.0 "@rocket.chat/fuselage-tokens": next "@rocket.chat/message-parser": next "@rocket.chat/styled": next @@ -8706,7 +8706,7 @@ __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": ^0.32.2 + "@rocket.chat/fuselage": ^0.34.0 "@rocket.chat/fuselage-hooks": ^0.32.1 "@rocket.chat/fuselage-polyfills": next "@rocket.chat/fuselage-toastbar": next @@ -9569,7 +9569,7 @@ __metadata: dependencies: "@babel/core": ~7.22.9 "@rocket.chat/css-in-js": next - "@rocket.chat/fuselage": ^0.32.2 + "@rocket.chat/fuselage": ^0.34.0 "@rocket.chat/fuselage-hooks": ^0.32.1 "@rocket.chat/icons": ^0.32.0 "@rocket.chat/mock-providers": "workspace:^" @@ -9620,7 +9620,7 @@ __metadata: dependencies: "@babel/core": ~7.22.9 "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/fuselage": ^0.32.2 + "@rocket.chat/fuselage": ^0.34.0 "@rocket.chat/icons": ^0.32.0 "@storybook/addon-actions": ~6.5.16 "@storybook/addon-docs": ~6.5.16 @@ -9691,7 +9691,7 @@ __metadata: resolution: "@rocket.chat/ui-theming@workspace:ee/packages/ui-theming" dependencies: "@rocket.chat/css-in-js": next - "@rocket.chat/fuselage": ^0.32.2 + "@rocket.chat/fuselage": ^0.34.0 "@rocket.chat/fuselage-hooks": ^0.32.1 "@rocket.chat/icons": ^0.32.0 "@rocket.chat/ui-contexts": "workspace:~" @@ -9734,7 +9734,7 @@ __metadata: "@rocket.chat/css-in-js": next "@rocket.chat/emitter": next "@rocket.chat/eslint-config": "workspace:^" - "@rocket.chat/fuselage": ^0.32.2 + "@rocket.chat/fuselage": ^0.34.0 "@rocket.chat/fuselage-hooks": ^0.32.1 "@rocket.chat/icons": ^0.32.0 "@rocket.chat/styled": next @@ -9777,7 +9777,7 @@ __metadata: "@codemirror/tooltip": ^0.19.16 "@lezer/highlight": ^1.1.6 "@rocket.chat/css-in-js": next - "@rocket.chat/fuselage": ^0.32.2 + "@rocket.chat/fuselage": ^0.34.0 "@rocket.chat/fuselage-hooks": ^0.32.1 "@rocket.chat/fuselage-polyfills": next "@rocket.chat/fuselage-tokens": next From bbbbdacc51149c3f6651a1cf61bba9d60773fbf8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BAlia=20Jaeger=20Foresti?= <60678893+juliajforesti@users.noreply.github.com> Date: Mon, 16 Oct 2023 14:25:30 -0300 Subject: [PATCH 210/211] feat: add tooltip to badge mentions (#30590) --- .../RoomList/SideBarItemTemplateWithData.tsx | 28 ++++++++++++++++++- .../rocketchat-i18n/i18n/en.i18n.json | 8 ++++++ 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/apps/meteor/client/sidebar/RoomList/SideBarItemTemplateWithData.tsx b/apps/meteor/client/sidebar/RoomList/SideBarItemTemplateWithData.tsx index b96c54d4c955..f275ff2800d8 100644 --- a/apps/meteor/client/sidebar/RoomList/SideBarItemTemplateWithData.tsx +++ b/apps/meteor/client/sidebar/RoomList/SideBarItemTemplateWithData.tsx @@ -33,6 +33,30 @@ const getMessage = (room: IRoom, lastMessage: IMessage | undefined, t: ReturnTyp return `${lastMessage.u.name || lastMessage.u.username}: ${normalizeSidebarMessage(lastMessage, t)}`; }; +const getBadgeTitle = ( + userMentions: number, + threadUnread: number, + groupMentions: number, + unread: number, + t: ReturnType, +) => { + const title = [] as string[]; + if (userMentions) { + title.push(t('mentions_counter', { count: userMentions })); + } + if (threadUnread) { + title.push(t('threads_counter', { count: threadUnread })); + } + if (groupMentions) { + title.push(t('group_mentions_counter', { count: groupMentions })); + } + const count = unread - userMentions - groupMentions; + if (count > 0) { + title.push(t('unread_messages_counter', { count })); + } + return title.join(', '); +}; + type RoomListRowProps = { extended: boolean; t: ReturnType; @@ -137,10 +161,12 @@ function SideBarItemTemplateWithData({ const isUnread = unread > 0 || threadUnread; const showBadge = !hideUnreadStatus || (!hideMentionStatus && (Boolean(userMentions) || tunreadUser.length > 0)); + const badgeTitle = getBadgeTitle(userMentions, tunread.length, groupMentions, unread, t); + const badges = ( {showBadge && isUnread && ( - + {unread + tunread?.length} )} diff --git a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index 80ad18ad6743..001cdf080f7b 100644 --- a/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json +++ b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json @@ -6086,6 +6086,14 @@ "Filter_by_room": "Filter by room type", "Filter_by_visibility": "Filter by visibility", "Theme_Appearence": "Theme Appearence", + "mentions_counter": "{{count}} mention", + "mentions_counter_plural": "{{count}} mentions", + "threads_counter": "{{count}} unread threaded message", + "threads_counter_plural": "{{count}} unread threaded messages", + "group_mentions_counter": "{{count}} group mention", + "group_mentions_counter_plural": "{{count}} group mentions", + "unread_messages_counter": "{{count}} unread message", + "unread_messages_counter_plural": "{{count}} unread messages", "Premium": "Premium", "Premium_capability": "Premium capability" } \ No newline at end of file From b22da641303e3b22571519125de68311756ebf17 Mon Sep 17 00:00:00 2001 From: Kevin Aleman Date: Mon, 16 Oct 2023 11:50:45 -0600 Subject: [PATCH 211/211] refactor: Livechat functions to Typescript (#30631) --- .../app/apps/server/bridges/livechat.ts | 2 +- .../imports/server/rest/departments.ts | 10 +- .../meteor/app/livechat/server/api/v1/room.ts | 13 +- .../app/livechat/server/api/v1/videoCall.ts | 2 +- .../app/livechat/server/api/v1/visitor.ts | 2 +- .../server/hooks/saveContactLastChat.ts | 2 +- .../app/livechat/server/lib/Livechat.js | 125 +----------------- .../app/livechat/server/lib/LivechatTyped.ts | 111 +++++++++++++++- apps/meteor/lib/callbacks.ts | 3 +- .../server/services/omnichannel/service.ts | 2 +- packages/core-services/src/Events.ts | 4 +- packages/core-typings/src/ILivechatVisitor.ts | 2 +- .../src/models/ILivechatDepartmentModel.ts | 2 + 13 files changed, 137 insertions(+), 143 deletions(-) diff --git a/apps/meteor/app/apps/server/bridges/livechat.ts b/apps/meteor/app/apps/server/bridges/livechat.ts index 76a0545c8801..0ace08bb8446 100644 --- a/apps/meteor/app/apps/server/bridges/livechat.ts +++ b/apps/meteor/app/apps/server/bridges/livechat.ts @@ -288,7 +288,7 @@ export class AppLivechatBridge extends LivechatBridge { throw new Error('Could not get the message converter to process livechat room messages'); } - const livechatMessages = await Livechat.getRoomMessages({ rid: roomId }); + const livechatMessages = await LivechatTyped.getRoomMessages({ rid: roomId }); return Promise.all(livechatMessages.map((message) => messageConverter.convertMessage(message) as Promise)); } diff --git a/apps/meteor/app/livechat/imports/server/rest/departments.ts b/apps/meteor/app/livechat/imports/server/rest/departments.ts index 6540b67d79aa..095baefaa294 100644 --- a/apps/meteor/app/livechat/imports/server/rest/departments.ts +++ b/apps/meteor/app/livechat/imports/server/rest/departments.ts @@ -17,6 +17,7 @@ import { } from '../../../server/api/lib/departments'; import { DepartmentHelper } from '../../../server/lib/Departments'; import { Livechat } from '../../../server/lib/Livechat'; +import { Livechat as LivechatTs } from '../../../server/lib/LivechatTyped'; API.v1.addRoute( 'livechat/department', @@ -192,7 +193,7 @@ API.v1.addRoute( }, { async post() { - await Livechat.archiveDepartment(this.urlParams._id); + await LivechatTs.archiveDepartment(this.urlParams._id); return API.v1.success(); }, @@ -207,11 +208,8 @@ API.v1.addRoute( }, { async post() { - if (await Livechat.unarchiveDepartment(this.urlParams._id)) { - return API.v1.success(); - } - - return API.v1.failure(); + await LivechatTs.unarchiveDepartment(this.urlParams._id); + return API.v1.success(); }, }, ); diff --git a/apps/meteor/app/livechat/server/api/v1/room.ts b/apps/meteor/app/livechat/server/api/v1/room.ts index 86629e636bf8..8f6151797463 100644 --- a/apps/meteor/app/livechat/server/api/v1/room.ts +++ b/apps/meteor/app/livechat/server/api/v1/room.ts @@ -18,7 +18,7 @@ import { callbacks } from '../../../../../lib/callbacks'; import { i18n } from '../../../../../server/lib/i18n'; import { API } from '../../../../api/server'; import { isWidget } from '../../../../api/server/helpers/isWidget'; -import { canAccessRoomAsync } from '../../../../authorization/server'; +import { canAccessRoomAsync, roomAccessAttributes } from '../../../../authorization/server'; import { hasPermissionAsync } from '../../../../authorization/server/functions/hasPermission'; import { addUserToRoom } from '../../../../lib/server/functions/addUserToRoom'; import { settings as rcSettings } from '../../../../settings/server'; @@ -352,7 +352,12 @@ API.v1.addRoute( API.v1.addRoute( 'livechat/room.visitor', - { authRequired: true, permissionsRequired: ['view-l-room'], validateParams: isPUTLivechatRoomVisitorParams, deprecationVersion: '7.0.0' }, + { + authRequired: true, + permissionsRequired: ['change-livechat-room-visitor'], + validateParams: isPUTLivechatRoomVisitorParams, + deprecationVersion: '7.0.0', + }, { async put() { // This endpoint is deprecated and will be removed in future versions. @@ -363,7 +368,7 @@ API.v1.addRoute( throw new Error('invalid-visitor'); } - const room = await LivechatRooms.findOneById(rid, { _id: 1, v: 1 }); // TODO: check _id + const room = await LivechatRooms.findOneById(rid, { projection: { ...roomAccessAttributes, _id: 1, t: 1, v: 1 } }); // TODO: check _id if (!room) { throw new Error('invalid-room'); } @@ -373,7 +378,7 @@ API.v1.addRoute( throw new Error('invalid-room-visitor'); } - const roomAfterChange = await Livechat.changeRoomVisitor(this.userId, rid, visitor); + const roomAfterChange = await LivechatTyped.changeRoomVisitor(this.userId, room, visitor); if (!roomAfterChange) { return API.v1.failure(); diff --git a/apps/meteor/app/livechat/server/api/v1/videoCall.ts b/apps/meteor/app/livechat/server/api/v1/videoCall.ts index 5ce0ddc4ca37..52cd8738bec9 100644 --- a/apps/meteor/app/livechat/server/api/v1/videoCall.ts +++ b/apps/meteor/app/livechat/server/api/v1/videoCall.ts @@ -6,7 +6,7 @@ import { i18n } from '../../../../../server/lib/i18n'; import { API } from '../../../../api/server'; import { canSendMessageAsync } from '../../../../authorization/server/functions/canSendMessage'; import { settings as rcSettings } from '../../../../settings/server'; -import { Livechat } from '../../lib/Livechat'; +import { Livechat } from '../../lib/LivechatTyped'; import { settings } from '../lib/livechat'; API.v1.addRoute( diff --git a/apps/meteor/app/livechat/server/api/v1/visitor.ts b/apps/meteor/app/livechat/server/api/v1/visitor.ts index ae9d1ea4fd83..84f7b96e155d 100644 --- a/apps/meteor/app/livechat/server/api/v1/visitor.ts +++ b/apps/meteor/app/livechat/server/api/v1/visitor.ts @@ -174,7 +174,7 @@ API.v1.addRoute('livechat/visitor.callStatus', { if (!guest) { throw new Meteor.Error('invalid-token'); } - await Livechat.updateCallStatus(callId, rid, callStatus, guest); + await LivechatTyped.updateCallStatus(callId, rid, callStatus, guest); return API.v1.success({ token, callStatus }); }, }); diff --git a/apps/meteor/app/livechat/server/hooks/saveContactLastChat.ts b/apps/meteor/app/livechat/server/hooks/saveContactLastChat.ts index 7b4d9b89f14c..6f42a910417d 100644 --- a/apps/meteor/app/livechat/server/hooks/saveContactLastChat.ts +++ b/apps/meteor/app/livechat/server/hooks/saveContactLastChat.ts @@ -1,7 +1,7 @@ import { isOmnichannelRoom } from '@rocket.chat/core-typings'; import { callbacks } from '../../../../lib/callbacks'; -import { Livechat } from '../lib/Livechat'; +import { Livechat } from '../lib/LivechatTyped'; callbacks.add( 'livechat.newRoom', diff --git a/apps/meteor/app/livechat/server/lib/Livechat.js b/apps/meteor/app/livechat/server/lib/Livechat.js index c560f3dd7aa7..e1d6626c7ddb 100644 --- a/apps/meteor/app/livechat/server/lib/Livechat.js +++ b/apps/meteor/app/livechat/server/lib/Livechat.js @@ -4,7 +4,7 @@ import dns from 'dns'; import util from 'util'; -import { Message, VideoConf, api } from '@rocket.chat/core-services'; +import { Message } from '@rocket.chat/core-services'; import { Logger } from '@rocket.chat/logger'; import { LivechatVisitors, @@ -30,7 +30,6 @@ import { trim } from '../../../../lib/utils/stringUtils'; import { i18n } from '../../../../server/lib/i18n'; import { addUserRolesAsync } from '../../../../server/lib/roles/addUserRoles'; import { removeUserFromRolesAsync } from '../../../../server/lib/roles/removeUserFromRoles'; -import { canAccessRoomAsync, roomAccessAttributes } from '../../../authorization/server'; import { hasPermissionAsync } from '../../../authorization/server/functions/hasPermission'; import { FileUpload } from '../../../file-upload/server'; import { deleteMessage } from '../../../lib/server/functions/deleteMessage'; @@ -718,40 +717,6 @@ export const Livechat = { return ret; }, - async unarchiveDepartment(_id) { - check(_id, String); - - const department = await LivechatDepartmentRaw.findOneById(_id, { projection: { _id: 1 } }); - - if (!department) { - throw new Meteor.Error('department-not-found', 'Department not found', { - method: 'livechat:removeDepartment', - }); - } - - // TODO: these kind of actions should be on events instead of here - await LivechatDepartmentAgents.enableAgentsByDepartmentId(_id); - return LivechatDepartmentRaw.unarchiveDepartment(_id); - }, - - async archiveDepartment(_id) { - check(_id, String); - - const department = await LivechatDepartmentRaw.findOneById(_id, { projection: { _id: 1 } }); - - if (!department) { - throw new Meteor.Error('department-not-found', 'Department not found', { - method: 'livechat:removeDepartment', - }); - } - - await LivechatDepartmentAgents.disableAgentsByDepartmentId(_id); - await LivechatDepartmentRaw.archiveDepartment(_id); - - this.logger.debug({ msg: 'Running livechat.afterDepartmentArchived callback for department:', departmentId: _id }); - await callbacks.run('livechat.afterDepartmentArchived', department); - }, - showConnecting() { const { showConnecting } = RoutingManager.getConfig(); return showConnecting; @@ -767,28 +732,6 @@ export const Livechat = { }); }, - async getRoomMessages({ rid }) { - check(rid, String); - - const room = await Rooms.findOneById(rid, { projection: { t: 1 } }); - if (room?.t !== 'l') { - throw new Meteor.Error('invalid-room'); - } - - const ignoredMessageTypes = [ - 'livechat_navigation_history', - 'livechat_transcript_history', - 'command', - 'livechat-close', - 'livechat-started', - 'livechat_video_call', - ]; - - return Messages.findVisibleByRoomIdNotContainingTypes(rid, ignoredMessageTypes, { - sort: { ts: 1 }, - }).toArray(); - }, - async requestTranscript({ rid, email, subject, user }) { check(rid, String); check(email, String); @@ -892,20 +835,6 @@ export const Livechat = { }); }, - async notifyAgentStatusChanged(userId, status) { - callbacks.runAsync('livechat.agentStatusChanged', { userId, status }); - if (!settings.get('Livechat_show_agent_info')) { - return; - } - - await LivechatRooms.findOpenByAgent(userId).forEach((room) => { - void api.broadcast('omnichannel.room', room._id, { - type: 'agentStatus', - status, - }); - }); - }, - async allowAgentChangeServiceStatus(statusLivechat, agentId) { if (statusLivechat !== 'available') { return true; @@ -913,56 +842,4 @@ export const Livechat = { return businessHourManager.allowAgentChangeServiceStatus(agentId); }, - - notifyRoomVisitorChange(roomId, visitor) { - void api.broadcast('omnichannel.room', roomId, { - type: 'visitorData', - visitor, - }); - }, - - async changeRoomVisitor(userId, roomId, visitor) { - const user = await Users.findOneById(userId); - if (!user) { - throw new Error('error-user-not-found'); - } - - if (!(await hasPermissionAsync(userId, 'change-livechat-room-visitor'))) { - throw new Error('error-not-authorized'); - } - - const room = await LivechatRooms.findOneById(roomId, { ...roomAccessAttributes, _id: 1, t: 1 }); - - if (!room) { - throw new Meteor.Error('invalid-room'); - } - - if (!(await canAccessRoomAsync(room, user))) { - throw new Error('error-not-allowed'); - } - - await LivechatRooms.changeVisitorByRoomId(room._id, visitor); - - Livechat.notifyRoomVisitorChange(room._id, visitor); - - return LivechatRooms.findOneById(roomId); - }, - async updateLastChat(contactId, lastChat) { - const updateUser = { - $set: { - lastChat, - }, - }; - await LivechatVisitors.updateById(contactId, updateUser); - }, - async updateCallStatus(callId, rid, status, user) { - await Rooms.setCallStatus(rid, status); - if (status === 'ended' || status === 'declined') { - if (await VideoConf.declineLivechatCall(callId)) { - return; - } - - return updateMessage({ _id: callId, msg: status, actionLinks: [], webRtcCallEndTs: new Date() }, user); - } - }, }; diff --git a/apps/meteor/app/livechat/server/lib/LivechatTyped.ts b/apps/meteor/app/livechat/server/lib/LivechatTyped.ts index c443bc7873c7..afb649488300 100644 --- a/apps/meteor/app/livechat/server/lib/LivechatTyped.ts +++ b/apps/meteor/app/livechat/server/lib/LivechatTyped.ts @@ -1,4 +1,4 @@ -import { Message } from '@rocket.chat/core-services'; +import { Message, VideoConf, api } from '@rocket.chat/core-services'; import type { IOmnichannelRoom, IOmnichannelRoomClosingInfo, @@ -23,6 +23,7 @@ import { Users, LivechatDepartmentAgents, ReadReceipts, + Rooms, } from '@rocket.chat/models'; import { Random } from '@rocket.chat/random'; import { serverFetch as fetch } from '@rocket.chat/server-fetch'; @@ -32,8 +33,10 @@ import type { FindCursor, UpdateFilter } from 'mongodb'; import { Apps, AppEvents } from '../../../../ee/server/apps'; import { callbacks } from '../../../../lib/callbacks'; import { i18n } from '../../../../server/lib/i18n'; +import { canAccessRoomAsync } from '../../../authorization/server'; import { hasRoleAsync } from '../../../authorization/server/functions/hasRole'; import { sendMessage } from '../../../lib/server/functions/sendMessage'; +import { updateMessage } from '../../../lib/server/functions/updateMessage'; import * as Mailer from '../../../mailer/server/api'; import { metrics } from '../../../metrics/server'; import { settings } from '../../../settings/server'; @@ -808,6 +811,112 @@ class LivechatClass { return true; } + + async updateCallStatus(callId: string, rid: string, status: 'ended' | 'declined', user: IUser | ILivechatVisitor) { + await Rooms.setCallStatus(rid, status); + if (status === 'ended' || status === 'declined') { + if (await VideoConf.declineLivechatCall(callId)) { + return; + } + + return updateMessage({ _id: callId, msg: status, actionLinks: [], webRtcCallEndTs: new Date(), rid }, user as unknown as IUser); + } + } + + async updateLastChat(contactId: string, lastChat: Required) { + const updateUser = { + $set: { + lastChat, + }, + }; + await LivechatVisitors.updateById(contactId, updateUser); + } + + notifyRoomVisitorChange(roomId: string, visitor: ILivechatVisitor) { + void api.broadcast('omnichannel.room', roomId, { + type: 'visitorData', + visitor, + }); + } + + async changeRoomVisitor(userId: string, room: IOmnichannelRoom, visitor: ILivechatVisitor) { + const user = await Users.findOneById(userId, { projection: { _id: 1 } }); + if (!user) { + throw new Error('error-user-not-found'); + } + + if (!(await canAccessRoomAsync(room, user))) { + throw new Error('error-not-allowed'); + } + + await LivechatRooms.changeVisitorByRoomId(room._id, visitor); + + this.notifyRoomVisitorChange(room._id, visitor); + + return LivechatRooms.findOneById(room._id); + } + + async notifyAgentStatusChanged(userId: string, status?: UserStatus) { + if (!status) { + return; + } + + void callbacks.runAsync('livechat.agentStatusChanged', { userId, status }); + if (!settings.get('Livechat_show_agent_info')) { + return; + } + + await LivechatRooms.findOpenByAgent(userId).forEach((room) => { + void api.broadcast('omnichannel.room', room._id, { + type: 'agentStatus', + status, + }); + }); + } + + async getRoomMessages({ rid }: { rid: string }) { + const room = await Rooms.findOneById(rid, { projection: { t: 1 } }); + if (room?.t !== 'l') { + throw new Meteor.Error('invalid-room'); + } + + const ignoredMessageTypes: MessageTypesValues[] = [ + 'livechat_navigation_history', + 'livechat_transcript_history', + 'command', + 'livechat-close', + 'livechat-started', + 'livechat_video_call', + ]; + + return Messages.findVisibleByRoomIdNotContainingTypes(rid, ignoredMessageTypes, { + sort: { ts: 1 }, + }).toArray(); + } + + async archiveDepartment(_id: string) { + const department = await LivechatDepartment.findOneById(_id, { projection: { _id: 1 } }); + + if (!department) { + throw new Error('department-not-found'); + } + + await Promise.all([LivechatDepartmentAgents.disableAgentsByDepartmentId(_id), LivechatDepartment.archiveDepartment(_id)]); + + await callbacks.run('livechat.afterDepartmentArchived', department); + } + + async unarchiveDepartment(_id: string) { + const department = await LivechatDepartment.findOneById(_id, { projection: { _id: 1 } }); + + if (!department) { + throw new Meteor.Error('department-not-found'); + } + + // TODO: these kind of actions should be on events instead of here + await Promise.all([LivechatDepartmentAgents.enableAgentsByDepartmentId(_id), LivechatDepartment.unarchiveDepartment(_id)]); + return true; + } } export const Livechat = new LivechatClass(); diff --git a/apps/meteor/lib/callbacks.ts b/apps/meteor/lib/callbacks.ts index 169144cc2788..4d59f52e9cd6 100644 --- a/apps/meteor/lib/callbacks.ts +++ b/apps/meteor/lib/callbacks.ts @@ -18,6 +18,7 @@ import type { ILivechatTagRecord, TransferData, AtLeast, + UserStatus, } from '@rocket.chat/core-typings'; import type { FilterOperators } from 'mongodb'; @@ -52,7 +53,7 @@ interface EventLikeCallbackSignatures { 'livechat.saveRoom': (room: IRoom) => void; 'livechat:afterReturnRoomAsInquiry': (params: { room: IRoom }) => void; 'livechat.setUserStatusLivechat': (params: { userId: IUser['_id']; status: OmnichannelAgentStatus }) => void; - 'livechat.agentStatusChanged': (params: { userId: IUser['_id']; status: OmnichannelAgentStatus }) => void; + 'livechat.agentStatusChanged': (params: { userId: IUser['_id']; status: UserStatus }) => void; 'livechat.onNewAgentCreated': (agentId: string) => void; 'livechat.afterTakeInquiry': (inq: InquiryWithAgentInfo, agent: { agentId: string; username: string }) => void; 'livechat.afterAgentRemoved': (params: { agent: Pick }) => void; diff --git a/apps/meteor/server/services/omnichannel/service.ts b/apps/meteor/server/services/omnichannel/service.ts index 7f35de104e1c..61c22505ca98 100644 --- a/apps/meteor/server/services/omnichannel/service.ts +++ b/apps/meteor/server/services/omnichannel/service.ts @@ -2,7 +2,7 @@ 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 { Livechat } from '../../../app/livechat/server/lib/LivechatTyped'; import { RoutingManager } from '../../../app/livechat/server/lib/RoutingManager'; import { settings } from '../../../app/settings/server'; import { OmnichannelQueue } from './queue'; diff --git a/packages/core-services/src/Events.ts b/packages/core-services/src/Events.ts index 88ca1034b9c9..e2a7f624d8df 100644 --- a/packages/core-services/src/Events.ts +++ b/packages/core-services/src/Events.ts @@ -32,6 +32,7 @@ import type { ILivechatInquiryRecord, ILivechatAgent, IBanner, + ILivechatVisitor, } from '@rocket.chat/core-typings'; import type { AutoUpdateRecord } from './types/IMeteor'; @@ -242,7 +243,8 @@ export type EventSignatures = { data: | { type: 'agentStatus'; status: string } | { type: 'queueData'; data: { [k: string]: unknown } | undefined } - | { type: 'agentData'; data: ILivechatAgent | undefined | { hiddenInfo: boolean } }, + | { type: 'agentData'; data: ILivechatAgent | undefined | { hiddenInfo: boolean } } + | { type: 'visitorData'; visitor: ILivechatVisitor }, ): void; // Send all events from here diff --git a/packages/core-typings/src/ILivechatVisitor.ts b/packages/core-typings/src/ILivechatVisitor.ts index e80d63ab15d0..21819cc23f24 100644 --- a/packages/core-typings/src/ILivechatVisitor.ts +++ b/packages/core-typings/src/ILivechatVisitor.ts @@ -7,7 +7,7 @@ export interface IVisitorPhone { export interface IVisitorLastChat { _id: string; - ts: string; + ts: Date; } export interface ILivechatVisitorConnectionData { diff --git a/packages/model-typings/src/models/ILivechatDepartmentModel.ts b/packages/model-typings/src/models/ILivechatDepartmentModel.ts index a074d5c31126..75fe0f54b2eb 100644 --- a/packages/model-typings/src/models/ILivechatDepartmentModel.ts +++ b/packages/model-typings/src/models/ILivechatDepartmentModel.ts @@ -71,4 +71,6 @@ export interface ILivechatDepartmentModel extends IBaseModel; countArchived(): Promise; findEnabledInIds(departmentsIds: string[], options?: FindOptions): FindCursor; + archiveDepartment(_id: string): Promise; + unarchiveDepartment(_id: string): Promise; }