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 new file mode 100644 index 000000000000..bf2911665af5 --- /dev/null +++ b/.changeset/pre.json @@ -0,0 +1,163 @@ +{ + "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", + "chilled-flies-fold", + "chilled-phones-give", + "cool-students-tan", + "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", + "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", + "tame-pens-occur", + "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/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/.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/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/CHANGELOG.md b/apps/meteor/CHANGELOG.md index 51ff6d4d1826..db7855b84991 100644 --- a/apps/meteor/CHANGELOG.md +++ b/apps/meteor/CHANGELOG.md @@ -1,5 +1,249 @@ # @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 + +- 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 +- 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 +- 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` +- 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 +- 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 +- 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 [ead7c7bef2] +- 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-rc.0 + - @rocket.chat/rest-typings@6.4.0-rc.0 + - @rocket.chat/fuselage-ui-kit@2.0.0-rc.0 + - @rocket.chat/model-typings@0.1.0-rc.0 + - @rocket.chat/core-services@0.2.0-rc.0 + - @rocket.chat/ui-client@2.0.0-rc.0 + - @rocket.chat/ui-contexts@2.0.0-rc.0 + - @rocket.chat/ui-theming@0.1.0-rc.0 + - @rocket.chat/i18n@0.0.2-rc.0 + - @rocket.chat/web-ui-registration@2.0.0-rc.0 + - @rocket.chat/api-client@0.1.5-rc.0 + - @rocket.chat/omnichannel-services@0.0.11-rc.0 + - @rocket.chat/pdf-worker@0.0.11-rc.0 + - @rocket.chat/presence@0.0.11-rc.0 + - @rocket.chat/cron@0.0.7-rc.0 + - @rocket.chat/gazzodown@2.0.0-rc.0 + - @rocket.chat/models@0.0.11-rc.0 + - @rocket.chat/ui-video-conf@2.0.0-rc.0 + - @rocket.chat/base64@1.0.12 + - @rocket.chat/instance-status@0.0.11-rc.0 + - @rocket.chat/random@1.2.1 + - @rocket.chat/sha256@1.0.9 + - @rocket.chat/ui-composer@0.0.1 +## 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 + +- 4cb0b6ba6f: Bump @rocket.chat/meteor version. +- Bump @rocket.chat/meteor version. +- f75564c449: Fix a bug that prevented the error message from being shown in the private app installation page +- 03923405e8: Fixed selected departments not being displayed due to pagination +- 92d25b9c7a: 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. + +- Updated dependencies [92d25b9c7a] + - @rocket.chat/model-typings@0.0.11 + - @rocket.chat/omnichannel-services@0.0.11 + - @rocket.chat/models@0.0.11 + - @rocket.chat/presence@0.0.11 + - @rocket.chat/core-services@0.1.5 + - @rocket.chat/cron@0.0.7 + - @rocket.chat/instance-status@0.0.11 + - @rocket.chat/core-typings@6.3.5 + - @rocket.chat/rest-typings@6.3.5 + - @rocket.chat/api-client@0.1.5 + - @rocket.chat/pdf-worker@0.0.11 + - @rocket.chat/gazzodown@1.0.5 + - @rocket.chat/ui-contexts@1.0.5 + - @rocket.chat/fuselage-ui-kit@1.0.5 + - @rocket.chat/ui-theming@0.0.1 + - @rocket.chat/ui-client@1.0.5 + - @rocket.chat/ui-video-conf@1.0.5 + - @rocket.chat/web-ui-registration@1.0.5 + ## 6.3.4 ### Patch Changes 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/app/lib/server/functions/saveUser.js b/apps/meteor/app/lib/server/functions/saveUser.js index f912626c833e..42438be4ab7a 100644 --- a/apps/meteor/app/lib/server/functions/saveUser.js +++ b/apps/meteor/app/lib/server/functions/saveUser.js @@ -15,6 +15,7 @@ import * as Mailer from '../../../mailer/server/api'; import { settings } from '../../../settings/server'; import { safeGetMeteorUser } from '../../../utils/server/functions/safeGetMeteorUser'; import { validateEmailDomain } from '../lib'; +import { generatePassword } from '../lib/generatePassword'; import { passwordPolicy } from '../lib/passwordPolicy'; import { checkEmailAvailability } from './checkEmailAvailability'; import { checkUsernameAvailability } from './checkUsernameAvailability'; @@ -344,7 +345,7 @@ export const saveUser = async function (userId, userData) { if (userData.hasOwnProperty('setRandomPassword')) { if (userData.setRandomPassword) { - userData.password = passwordPolicy.generatePassword(); + userData.password = generatePassword(); userData.requirePasswordChange = true; sendPassword = true; } diff --git a/apps/meteor/app/lib/server/lib/generatePassword.ts b/apps/meteor/app/lib/server/lib/generatePassword.ts new file mode 100644 index 000000000000..bf8d2474b7a7 --- /dev/null +++ b/apps/meteor/app/lib/server/lib/generatePassword.ts @@ -0,0 +1,31 @@ +import generator from 'generate-password'; + +import { passwordPolicy } from './passwordPolicy'; + +export const generatePassword = (): string => { + const policies = passwordPolicy.getPasswordPolicy(); + + const maxLength: number = (policies.policy.find(([key]) => key === 'get-password-policy-maxLength')?.[1]?.maxLength as number) || -1; + const minLength: number = (policies.policy.find(([key]) => key === 'get-password-policy-minLength')?.[1]?.minLength as number) || -1; + + const length = Math.min(Math.max(minLength, 12), maxLength > 0 ? maxLength : Number.MAX_SAFE_INTEGER); + + if (policies.enabled) { + for (let i = 0; i < 10; i++) { + const password = generator.generate({ + length, + ...(policies.policy && { numbers: true }), + ...(policies.policy.some(([key]) => key === 'get-password-policy-mustContainAtLeastOneSpecialCharacter') && { symbols: true }), + ...(policies.policy.some(([key]) => key === 'get-password-policy-mustContainAtLeastOneLowercase') && { lowercase: true }), + ...(policies.policy.some(([key]) => key === 'get-password-policy-mustContainAtLeastOneUppercase') && { uppercase: true }), + strict: true, + }); + + if (passwordPolicy.validate(password)) { + return password; + } + } + } + + return generator.generate({ length: 17 }); +}; diff --git a/apps/meteor/app/lib/server/lib/passwordPolicy.js b/apps/meteor/app/lib/server/lib/passwordPolicy.js deleted file mode 100644 index 57490d1712c1..000000000000 --- a/apps/meteor/app/lib/server/lib/passwordPolicy.js +++ /dev/null @@ -1,32 +0,0 @@ -import { settings } from '../../../settings/server'; -import PasswordPolicy from './PasswordPolicyClass'; - -export const passwordPolicy = new PasswordPolicy(); - -settings.watch('Accounts_Password_Policy_Enabled', (value) => { - passwordPolicy.enabled = value; -}); -settings.watch('Accounts_Password_Policy_MinLength', (value) => { - passwordPolicy.minLength = value; -}); -settings.watch('Accounts_Password_Policy_MaxLength', (value) => { - passwordPolicy.maxLength = value; -}); -settings.watch('Accounts_Password_Policy_ForbidRepeatingCharacters', (value) => { - passwordPolicy.forbidRepeatingCharacters = value; -}); -settings.watch('Accounts_Password_Policy_ForbidRepeatingCharactersCount', (value) => { - passwordPolicy.forbidRepeatingCharactersCount = value; -}); -settings.watch('Accounts_Password_Policy_AtLeastOneLowercase', (value) => { - passwordPolicy.mustContainAtLeastOneLowercase = value; -}); -settings.watch('Accounts_Password_Policy_AtLeastOneUppercase', (value) => { - passwordPolicy.mustContainAtLeastOneUppercase = value; -}); -settings.watch('Accounts_Password_Policy_AtLeastOneNumber', (value) => { - passwordPolicy.mustContainAtLeastOneNumber = value; -}); -settings.watch('Accounts_Password_Policy_AtLeastOneSpecialCharacter', (value) => { - passwordPolicy.mustContainAtLeastOneSpecialCharacter = value; -}); diff --git a/apps/meteor/app/lib/server/lib/passwordPolicy.ts b/apps/meteor/app/lib/server/lib/passwordPolicy.ts new file mode 100644 index 000000000000..b40447ca56ab --- /dev/null +++ b/apps/meteor/app/lib/server/lib/passwordPolicy.ts @@ -0,0 +1,64 @@ +import { PasswordPolicy } from '@rocket.chat/password-policies'; + +import { settings } from '../../../settings/server'; + +const enabled = false; +const minLength = -1; +const maxLength = -1; +const forbidRepeatingCharacters = false; +const forbidRepeatingCharactersCount = 3; +const mustContainAtLeastOneLowercase = false; +const mustContainAtLeastOneUppercase = false; +const mustContainAtLeastOneNumber = false; +const mustContainAtLeastOneSpecialCharacter = false; + +export let passwordPolicy = new PasswordPolicy({ + enabled, + minLength, + maxLength, + forbidRepeatingCharacters, + forbidRepeatingCharactersCount, + mustContainAtLeastOneLowercase, + mustContainAtLeastOneUppercase, + mustContainAtLeastOneNumber, + mustContainAtLeastOneSpecialCharacter, + throwError: true, +}); + +settings.watchMultiple( + [ + 'Accounts_Password_Policy_Enabled', + 'Accounts_Password_Policy_MinLength', + 'Accounts_Password_Policy_MaxLength', + 'Accounts_Password_Policy_ForbidRepeatingCharacters', + 'Accounts_Password_Policy_ForbidRepeatingCharactersCount', + 'Accounts_Password_Policy_AtLeastOneLowercase', + 'Accounts_Password_Policy_AtLeastOneUppercase', + 'Accounts_Password_Policy_AtLeastOneNumber', + 'Accounts_Password_Policy_AtLeastOneSpecialCharacter', + ], + ([ + enabled, + minLength, + maxLength, + forbidRepeatingCharacters, + forbidRepeatingCharactersCount, + mustContainAtLeastOneLowercase, + mustContainAtLeastOneUppercase, + mustContainAtLeastOneNumber, + mustContainAtLeastOneSpecialCharacter, + ]) => { + passwordPolicy = new PasswordPolicy({ + enabled: Boolean(enabled), + minLength: Number(minLength), + maxLength: Number(maxLength), + forbidRepeatingCharacters: Boolean(forbidRepeatingCharacters), + forbidRepeatingCharactersCount: Number(forbidRepeatingCharactersCount), + mustContainAtLeastOneLowercase: Boolean(mustContainAtLeastOneLowercase), + mustContainAtLeastOneUppercase: Boolean(mustContainAtLeastOneUppercase), + mustContainAtLeastOneNumber: Boolean(mustContainAtLeastOneNumber), + mustContainAtLeastOneSpecialCharacter: Boolean(mustContainAtLeastOneSpecialCharacter), + throwError: true, + }); + }, +); 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/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/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/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/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/client/views/admin/info/DeploymentCard.tsx b/apps/meteor/client/views/admin/info/DeploymentCard.tsx index f1f3dde6aec0..7a95e7aae018 100644 --- a/apps/meteor/client/views/admin/info/DeploymentCard.tsx +++ b/apps/meteor/client/views/admin/info/DeploymentCard.tsx @@ -65,7 +65,8 @@ 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}
{t('PID')} 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, 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; 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/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/ee/server/services/CHANGELOG.md b/apps/meteor/ee/server/services/CHANGELOG.md index 7966239693fd..6d032b37f4ae 100644 --- a/apps/meteor/ee/server/services/CHANGELOG.md +++ b/apps/meteor/ee/server/services/CHANGELOG.md @@ -1,5 +1,63 @@ # rocketchat-services +## 1.1.7-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.7-rc.0 + +### 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 [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [93d4912e17] + - @rocket.chat/core-typings@6.4.0-rc.0 + - @rocket.chat/rest-typings@6.4.0-rc.0 + - @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 + +- @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 + +- Updated dependencies [92d25b9c7a] + - @rocket.chat/model-typings@0.0.11 + - @rocket.chat/models@0.0.11 + - @rocket.chat/core-services@0.1.5 + - @rocket.chat/core-typings@6.3.5 + - @rocket.chat/rest-typings@6.3.5 + ## 1.1.4 ### Patch Changes diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index a80d29269c88..3466067fd742 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.4", + "version": "1.1.7-rc.1", "description": "Rocket.Chat Authorization service", "main": "index.js", "scripts": { @@ -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 4b4d1275656e..030b77fd7814 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", @@ -236,27 +236,28 @@ "@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:^", "@rocket.chat/presence": "workspace:^", @@ -269,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/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json b/apps/meteor/packages/rocketchat-i18n/i18n/en.i18n.json index a0f6d0e0c6a8..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", @@ -5665,6 +5661,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/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/methods/getPasswordPolicy.ts b/apps/meteor/server/methods/getPasswordPolicy.ts index 7201999ff677..cc35f1cfb514 100644 --- a/apps/meteor/server/methods/getPasswordPolicy.ts +++ b/apps/meteor/server/methods/getPasswordPolicy.ts @@ -28,6 +28,9 @@ Meteor.methods({ method: 'getPasswordPolicy', }); } - return passwordPolicy.getPasswordPolicy(); + return passwordPolicy.getPasswordPolicy() as { + enabled: boolean; + policy: [name: TranslationKey, options?: Record][]; + }; }, }); 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/accounts.ts b/apps/meteor/server/settings/accounts.ts index a7592829578d..ccc87b0ffd24 100644 --- a/apps/meteor/server/settings/accounts.ts +++ b/apps/meteor/server/settings/accounts.ts @@ -745,50 +745,60 @@ export const createAccountSettings = () => await this.section('Password_Policy', async function () { await this.add('Accounts_Password_Policy_Enabled', false, { type: 'boolean', + public: true, }); const enableQuery = { _id: 'Accounts_Password_Policy_Enabled', value: true, + public: true, }; await this.add('Accounts_Password_Policy_MinLength', 7, { type: 'int', + public: true, enableQuery, }); await this.add('Accounts_Password_Policy_MaxLength', -1, { type: 'int', + public: true, enableQuery, }); await this.add('Accounts_Password_Policy_ForbidRepeatingCharacters', true, { type: 'boolean', + public: true, enableQuery, }); await this.add('Accounts_Password_Policy_ForbidRepeatingCharactersCount', 3, { type: 'int', + public: true, enableQuery, }); await this.add('Accounts_Password_Policy_AtLeastOneLowercase', true, { type: 'boolean', + public: true, enableQuery, }); await this.add('Accounts_Password_Policy_AtLeastOneUppercase', true, { type: 'boolean', + public: true, enableQuery, }); await this.add('Accounts_Password_Policy_AtLeastOneNumber', true, { type: 'boolean', + public: true, enableQuery, }); await this.add('Accounts_Password_Policy_AtLeastOneSpecialCharacter', true, { type: 'boolean', + public: true, enableQuery, }); }); 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', 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, + }); }); 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); 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'); + }); + }); + }); + }); + }); }); diff --git a/apps/meteor/tests/unit/app/lib/server.tests.js b/apps/meteor/tests/unit/app/lib/server.tests.js deleted file mode 100644 index f77b5a4d1cb8..000000000000 --- a/apps/meteor/tests/unit/app/lib/server.tests.js +++ /dev/null @@ -1,277 +0,0 @@ -import { expect } from 'chai'; -import proxyquire from 'proxyquire'; - -const { default: PasswordPolicyClass } = proxyquire.noCallThru().load('../../../../app/lib/server/lib/PasswordPolicyClass', { - 'meteor/meteor': { - Meteor: { - absoluteUrl() { - return 'http://localhost:3000/'; - }, - }, - }, - '@rocket.chat/random': { - Random: { - id: () => 1, - }, - }, -}); - -describe('PasswordPolicyClass', () => { - describe('Default options', () => { - const passwordPolice = new PasswordPolicyClass(); - it('should be disabled', () => { - expect(passwordPolice.enabled).to.be.equal(false); - }); - it('should have minLength = -1', () => { - expect(passwordPolice.minLength).to.be.equal(-1); - }); - it('should have maxLength = -1', () => { - expect(passwordPolice.maxLength).to.be.equal(-1); - }); - it('should have forbidRepeatingCharacters = false', () => { - expect(passwordPolice.forbidRepeatingCharacters).to.be.false; - }); - it('should have forbidRepeatingCharactersCount = 3', () => { - expect(passwordPolice.forbidRepeatingCharactersCount).to.be.equal(3); - }); - it('should have mustContainAtLeastOneLowercase = false', () => { - expect(passwordPolice.mustContainAtLeastOneLowercase).to.be.false; - }); - it('should have mustContainAtLeastOneUppercase = false', () => { - expect(passwordPolice.mustContainAtLeastOneUppercase).to.be.false; - }); - it('should have mustContainAtLeastOneNumber = false', () => { - expect(passwordPolice.mustContainAtLeastOneNumber).to.be.false; - }); - it('should have mustContainAtLeastOneSpecialCharacter = false', () => { - expect(passwordPolice.mustContainAtLeastOneSpecialCharacter).to.be.false; - }); - - describe('Password tests with default options', () => { - it('should allow all passwords', () => { - const passwordPolice = new PasswordPolicyClass({ throwError: false }); - expect(passwordPolice.validate()).to.be.equal(false); - expect(passwordPolice.validate('')).to.be.equal(false); - expect(passwordPolice.validate(' ')).to.be.equal(false); - expect(passwordPolice.validate('a')).to.be.equal(true); - expect(passwordPolice.validate('aaaaaaaaa')).to.be.equal(true); - }); - }); - }); - - describe('Password tests with options', () => { - it('should not allow non string or empty', () => { - const passwordPolice = new PasswordPolicyClass({ - enabled: true, - throwError: false, - }); - expect(passwordPolice.validate()).to.be.false; - expect(passwordPolice.validate(1)).to.be.false; - expect(passwordPolice.validate(true)).to.be.false; - expect(passwordPolice.validate(new Date())).to.be.false; - expect(passwordPolice.validate(new Function())).to.be.false; - expect(passwordPolice.validate('')).to.be.false; - }); - - it('should restrict by minLength', () => { - const passwordPolice = new PasswordPolicyClass({ - enabled: true, - minLength: 5, - throwError: false, - }); - - expect(passwordPolice.validate('1')).to.be.false; - expect(passwordPolice.validate('1234')).to.be.false; - expect(passwordPolice.validate('12345')).to.be.true; - expect(passwordPolice.validate(' ')).to.be.false; - }); - - it('should restrict by maxLength', () => { - const passwordPolice = new PasswordPolicyClass({ - enabled: true, - maxLength: 5, - throwError: false, - }); - - expect(passwordPolice.validate('1')).to.be.true; - expect(passwordPolice.validate('12345')).to.be.true; - expect(passwordPolice.validate('123456')).to.be.false; - expect(passwordPolice.validate(' ')).to.be.false; - }); - - it('should allow repeated characters', () => { - const passwordPolice = new PasswordPolicyClass({ - enabled: true, - forbidRepeatingCharacters: false, - throwError: false, - }); - - expect(passwordPolice.validate('1')).to.be.true; - expect(passwordPolice.validate('12345')).to.be.true; - expect(passwordPolice.validate('123456')).to.be.true; - expect(passwordPolice.validate(' ')).to.be.false; - expect(passwordPolice.validate('11111111111111')).to.be.true; - }); - - it('should restrict repeated characters', () => { - const passwordPolice = new PasswordPolicyClass({ - enabled: true, - forbidRepeatingCharacters: true, - forbidRepeatingCharactersCount: 3, - throwError: false, - }); - - expect(passwordPolice.validate('1')).to.be.true; - expect(passwordPolice.validate('11')).to.be.true; - expect(passwordPolice.validate('111')).to.be.true; - expect(passwordPolice.validate('1111')).to.be.false; - expect(passwordPolice.validate(' ')).to.be.false; - expect(passwordPolice.validate('123456')).to.be.true; - }); - - it('should restrict repeated characters customized', () => { - const passwordPolice = new PasswordPolicyClass({ - enabled: true, - forbidRepeatingCharacters: true, - forbidRepeatingCharactersCount: 5, - throwError: false, - }); - - expect(passwordPolice.validate('1')).to.be.true; - expect(passwordPolice.validate('11')).to.be.true; - expect(passwordPolice.validate('111')).to.be.true; - expect(passwordPolice.validate('1111')).to.be.true; - expect(passwordPolice.validate('11111')).to.be.true; - expect(passwordPolice.validate('111111')).to.be.false; - expect(passwordPolice.validate(' ')).to.be.false; - expect(passwordPolice.validate('123456')).to.be.true; - }); - - it('should contain one lowercase', () => { - const passwordPolice = new PasswordPolicyClass({ - enabled: true, - mustContainAtLeastOneLowercase: true, - throwError: false, - }); - - expect(passwordPolice.validate('a')).to.be.true; - expect(passwordPolice.validate('aa')).to.be.true; - expect(passwordPolice.validate('A')).to.be.false; - expect(passwordPolice.validate(' ')).to.be.false; - expect(passwordPolice.validate('123456')).to.be.false; - expect(passwordPolice.validate('AAAAA')).to.be.false; - expect(passwordPolice.validate('AAAaAAA')).to.be.true; - }); - - it('should contain one uppercase', () => { - const passwordPolice = new PasswordPolicyClass({ - enabled: true, - mustContainAtLeastOneUppercase: true, - throwError: false, - }); - - expect(passwordPolice.validate('a')).to.be.false; - expect(passwordPolice.validate('aa')).to.be.false; - expect(passwordPolice.validate('A')).to.be.true; - expect(passwordPolice.validate(' ')).to.be.false; - expect(passwordPolice.validate('123456')).to.be.false; - expect(passwordPolice.validate('AAAAA')).to.be.true; - expect(passwordPolice.validate('AAAaAAA')).to.be.true; - }); - - it('should contain one number', () => { - const passwordPolice = new PasswordPolicyClass({ - enabled: true, - mustContainAtLeastOneNumber: true, - throwError: false, - }); - - expect(passwordPolice.validate('a')).to.be.false; - expect(passwordPolice.validate('aa')).to.be.false; - expect(passwordPolice.validate('A')).to.be.false; - expect(passwordPolice.validate(' ')).to.be.false; - expect(passwordPolice.validate('123456')).to.be.true; - expect(passwordPolice.validate('AAAAA')).to.be.false; - expect(passwordPolice.validate('AAAaAAA')).to.be.false; - expect(passwordPolice.validate('AAAa1AAA')).to.be.true; - }); - - it('should contain one special character', () => { - const passwordPolice = new PasswordPolicyClass({ - enabled: true, - mustContainAtLeastOneSpecialCharacter: true, - throwError: false, - }); - - expect(passwordPolice.validate('a')).to.be.false; - expect(passwordPolice.validate('aa')).to.be.false; - expect(passwordPolice.validate('A')).to.be.false; - expect(passwordPolice.validate(' ')).to.be.false; - expect(passwordPolice.validate('123456')).to.be.false; - expect(passwordPolice.validate('AAAAA')).to.be.false; - expect(passwordPolice.validate('AAAaAAA')).to.be.false; - expect(passwordPolice.validate('AAAa1AAA')).to.be.false; - expect(passwordPolice.validate('AAAa@AAA')).to.be.true; - }); - }); - - describe('Password generator', () => { - it('should return a random password', () => { - const passwordPolice = new PasswordPolicyClass({ - enabled: true, - throwError: false, - }); - - expect(passwordPolice.generatePassword()).to.not.be.undefined; - }); - }); - - describe('Password Policy', () => { - it('should return a correct password policy', () => { - const passwordPolice = new PasswordPolicyClass({ - enabled: true, - throwError: false, - minLength: 10, - maxLength: 20, - forbidRepeatingCharacters: true, - forbidRepeatingCharactersCount: 4, - mustContainAtLeastOneLowercase: true, - mustContainAtLeastOneUppercase: true, - mustContainAtLeastOneNumber: true, - mustContainAtLeastOneSpecialCharacter: true, - }); - - const policy = passwordPolice.getPasswordPolicy(); - - expect(policy).to.not.be.undefined; - expect(policy.enabled).to.be.true; - expect(policy.policy.length).to.be.equal(8); - expect(policy.policy[0][0]).to.be.equal('get-password-policy-minLength'); - expect(policy.policy[0][1].minLength).to.be.equal(10); - }); - - it('should return correct values if policy is disabled', () => { - const passwordPolice = new PasswordPolicyClass({ - enabled: false, - }); - - const policy = passwordPolice.getPasswordPolicy(); - - expect(policy.enabled).to.be.false; - expect(policy.policy.length).to.be.equal(0); - }); - - it('should return correct values if policy is enabled but no specifiers exists', () => { - const passwordPolice = new PasswordPolicyClass({ - enabled: true, - }); - - const policy = passwordPolice.getPasswordPolicy(); - - expect(policy.enabled).to.be.true; - // even when no policy is specified, forbidRepeatingCharactersCount is still configured - // since its default value is 3 - expect(policy.policy.length).to.be.equal(1); - }); - }); -}); diff --git a/ee/apps/account-service/CHANGELOG.md b/ee/apps/account-service/CHANGELOG.md index 89607251a0fd..269ce5961b3f 100644 --- a/ee/apps/account-service/CHANGELOG.md +++ b/ee/apps/account-service/CHANGELOG.md @@ -1,5 +1,63 @@ # @rocket.chat/account-service +## 0.2.7-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.7-rc.0 + +### 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 [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [93d4912e17] + - @rocket.chat/core-typings@6.4.0-rc.0 + - @rocket.chat/rest-typings@6.4.0-rc.0 + - @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 + +- @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 + +- Updated dependencies [92d25b9c7a] + - @rocket.chat/model-typings@0.0.11 + - @rocket.chat/models@0.0.11 + - @rocket.chat/core-services@0.1.5 + - @rocket.chat/core-typings@6.3.5 + - @rocket.chat/rest-typings@6.3.5 + ## 0.2.4 ### Patch Changes diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index 39dce6f462f9..5eaf101e2561 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.4", + "version": "0.2.7-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 9873537590d3..469f334a1914 100644 --- a/ee/apps/authorization-service/CHANGELOG.md +++ b/ee/apps/authorization-service/CHANGELOG.md @@ -1,5 +1,63 @@ # @rocket.chat/authorization-service +## 0.2.7-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.7-rc.0 + +### 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 [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [93d4912e17] + - @rocket.chat/core-typings@6.4.0-rc.0 + - @rocket.chat/rest-typings@6.4.0-rc.0 + - @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 + +- @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 + +- Updated dependencies [92d25b9c7a] + - @rocket.chat/model-typings@0.0.11 + - @rocket.chat/models@0.0.11 + - @rocket.chat/core-services@0.1.5 + - @rocket.chat/core-typings@6.3.5 + - @rocket.chat/rest-typings@6.3.5 + ## 0.2.4 ### Patch Changes diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index b2a595366474..67541bcffc22 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.4", + "version": "0.2.7-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 b2a64786913b..31ecba3b2705 100644 --- a/ee/apps/ddp-streamer/CHANGELOG.md +++ b/ee/apps/ddp-streamer/CHANGELOG.md @@ -1,5 +1,73 @@ # @rocket.chat/ddp-streamer +## 0.1.7-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.7-rc.0 + +### 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 [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [b8f3d5014f] +- Updated dependencies [93d4912e17] + - @rocket.chat/core-typings@6.4.0-rc.0 + - @rocket.chat/rest-typings@6.4.0-rc.0 + - @rocket.chat/model-typings@0.1.0-rc.0 + - @rocket.chat/core-services@0.2.0-rc.0 + - @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 + +- @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 + +- Updated dependencies [92d25b9c7a] + - @rocket.chat/model-typings@0.0.11 + - @rocket.chat/models@0.0.11 + - @rocket.chat/core-services@0.1.5 + - @rocket.chat/instance-status@0.0.11 + - @rocket.chat/core-typings@6.3.5 + - @rocket.chat/rest-typings@6.3.5 + - @rocket.chat/ui-contexts@1.0.5 + ## 0.1.4 ### Patch Changes diff --git a/ee/apps/ddp-streamer/Dockerfile b/ee/apps/ddp-streamer/Dockerfile index 83f1eb282c87..9a3f9ef9c582 100644 --- a/ee/apps/ddp-streamer/Dockerfile +++ b/ee/apps/ddp-streamer/Dockerfile @@ -16,6 +16,9 @@ COPY ./packages/core-typings/dist packages/core-typings/dist COPY ./packages/rest-typings/package.json packages/rest-typings/package.json COPY ./packages/rest-typings/dist packages/rest-typings/dist +COPY ./packages/password-policies/package.json packages/password-policies/package.json +COPY ./packages/password-policies/dist packages/password-policies/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/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index f6eb59fedcfd..9b6e9120ac64 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.4", + "version": "0.1.7-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 78829550a937..3792b27f8777 100644 --- a/ee/apps/omnichannel-transcript/CHANGELOG.md +++ b/ee/apps/omnichannel-transcript/CHANGELOG.md @@ -1,5 +1,41 @@ # @rocket.chat/omnichannel-transcript +## 0.2.7-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.7-rc.0 + +### 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 [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0-rc.0 + - @rocket.chat/model-typings@0.1.0-rc.0 + - @rocket.chat/core-services@0.2.0-rc.0 + - @rocket.chat/omnichannel-services@0.0.11-rc.0 + - @rocket.chat/pdf-worker@0.0.11-rc.0 + - @rocket.chat/models@0.0.11-rc.0 + ## 0.2.4 ### Patch Changes diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index 94faf82d74e7..d49a70a5ba97 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.4", + "version": "0.2.7-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 08a27bb77ced..41ae24166a9d 100644 --- a/ee/apps/presence-service/CHANGELOG.md +++ b/ee/apps/presence-service/CHANGELOG.md @@ -1,5 +1,59 @@ # @rocket.chat/presence-service +## 0.2.7-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.7-rc.0 + +### 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 [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0-rc.0 + - @rocket.chat/model-typings@0.1.0-rc.0 + - @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 + +- @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 + +- Updated dependencies [92d25b9c7a] + - @rocket.chat/model-typings@0.0.11 + - @rocket.chat/models@0.0.11 + - @rocket.chat/presence@0.0.11 + - @rocket.chat/core-services@0.1.5 + - @rocket.chat/core-typings@6.3.5 + ## 0.2.4 ### Patch Changes diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index a79ea33b6406..7c7e148ba935 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.4", + "version": "0.2.7-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 2bd7874719e4..9e91d31dfa00 100644 --- a/ee/apps/queue-worker/CHANGELOG.md +++ b/ee/apps/queue-worker/CHANGELOG.md @@ -1,5 +1,59 @@ # @rocket.chat/queue-worker +## 0.2.7-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.7-rc.0 + +### 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 [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0-rc.0 + - @rocket.chat/model-typings@0.1.0-rc.0 + - @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 + +- @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 + +- Updated dependencies [92d25b9c7a] + - @rocket.chat/model-typings@0.0.11 + - @rocket.chat/omnichannel-services@0.0.11 + - @rocket.chat/models@0.0.11 + - @rocket.chat/core-services@0.1.5 + - @rocket.chat/core-typings@6.3.5 + ## 0.2.4 ### Patch Changes diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index 8eb8b299105b..f94aef6bc2cb 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.4", + "version": "0.2.7-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 9f5da36d15f5..fcb6517da230 100644 --- a/ee/apps/stream-hub-service/CHANGELOG.md +++ b/ee/apps/stream-hub-service/CHANGELOG.md @@ -1,5 +1,55 @@ # @rocket.chat/stream-hub-service +## 0.2.7-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.7-rc.0 + +### 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 [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0-rc.0 + - @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 + +- @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 + +- Updated dependencies [92d25b9c7a] + - @rocket.chat/model-typings@0.0.11 + - @rocket.chat/models@0.0.11 + - @rocket.chat/core-services@0.1.5 + - @rocket.chat/core-typings@6.3.5 + ## 0.2.4 ### Patch Changes diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index 469b6bc8feda..a204e8e472cc 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.4", + "version": "0.2.7-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 5ecdabd24205..223cbcb9626e 100644 --- a/ee/packages/api-client/CHANGELOG.md +++ b/ee/packages/api-client/CHANGELOG.md @@ -1,5 +1,44 @@ # @rocket.chat/api-client +## 0.1.7-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/rest-typings@6.4.0-rc.1 + +## 0.1.7-rc.0 + +### 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 [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- 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 + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/rest-typings@6.3.6 + +## 0.1.5 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.5 +- @rocket.chat/rest-typings@6.3.5 + ## 0.1.4 ### Patch Changes diff --git a/ee/packages/api-client/package.json b/ee/packages/api-client/package.json index 987659f45ddf..963df9c96db5 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.4", + "version": "0.1.7-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 a4af639fe331..8b2691b5445f 100644 --- a/ee/packages/ddp-client/CHANGELOG.md +++ b/ee/packages/ddp-client/CHANGELOG.md @@ -1,5 +1,45 @@ # @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 + +- 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 [9496f1eb97] +- 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 + +- @rocket.chat/rest-typings@6.3.6 +- @rocket.chat/api-client@0.1.6 + +## 0.1.5 + +### Patch Changes + +- @rocket.chat/rest-typings@6.3.5 +- @rocket.chat/api-client@0.1.5 + ## 0.1.4 ### Patch Changes diff --git a/ee/packages/ddp-client/package.json b/ee/packages/ddp-client/package.json index 350937874a54..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.1.4", + "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 1d7bc3c6daaa..1465f2f6b96d 100644 --- a/ee/packages/omnichannel-services/CHANGELOG.md +++ b/ee/packages/omnichannel-services/CHANGELOG.md @@ -1,5 +1,67 @@ # @rocket.chat/omnichannel-services +## 0.0.13-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.13-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.13-rc.1 + +## 0.0.13-rc.0 + +### 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 [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [93d4912e17] + - @rocket.chat/core-typings@6.4.0-rc.0 + - @rocket.chat/rest-typings@6.4.0-rc.0 + - @rocket.chat/model-typings@0.1.0-rc.0 + - @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 + +- @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 + +- Updated dependencies [92d25b9c7a] + - @rocket.chat/model-typings@0.0.11 + - @rocket.chat/models@0.0.11 + - @rocket.chat/core-services@0.1.5 + - @rocket.chat/core-typings@6.3.5 + - @rocket.chat/rest-typings@6.3.5 + - @rocket.chat/pdf-worker@0.0.11 + ## 0.0.10 ### Patch Changes diff --git a/ee/packages/omnichannel-services/package.json b/ee/packages/omnichannel-services/package.json index 3b85bb71988b..969ac8d4517e 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.10", + "version": "0.0.13-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 7dee5be2c4df..624f93717870 100644 --- a/ee/packages/pdf-worker/CHANGELOG.md +++ b/ee/packages/pdf-worker/CHANGELOG.md @@ -1,5 +1,35 @@ # @rocket.chat/pdf-worker +## 0.0.13-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 + +## 0.0.13-rc.0 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0-rc.0 +## 0.0.12 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 + +## 0.0.11 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.5 + ## 0.0.10 ### Patch Changes diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index a089448057a6..aeeb4c16303e 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.10", + "version": "0.0.13-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 c5c3dbaf9adc..df81eb37e1e0 100644 --- a/ee/packages/presence/CHANGELOG.md +++ b/ee/packages/presence/CHANGELOG.md @@ -1,5 +1,45 @@ # @rocket.chat/presence +## 0.0.13-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.13-rc.0 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [982ef6f459] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [19aec23cda] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [61128364d6] +- Updated dependencies [d45365436e] + - @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 + +- @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 + +- @rocket.chat/models@0.0.11 +- @rocket.chat/core-services@0.1.5 +- @rocket.chat/core-typings@6.3.5 + ## 0.0.10 ### Patch Changes diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 18bc8371997b..63b1c585ec6a 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/presence", - "version": "0.0.10", + "version": "0.0.13-rc.1", "private": true, "devDependencies": { "@babel/core": "~7.22.9", 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 } diff --git a/ee/packages/ui-theming/CHANGELOG.md b/ee/packages/ui-theming/CHANGELOG.md new file mode 100644 index 000000000000..746a406ad105 --- /dev/null +++ b/ee/packages/ui-theming/CHANGELOG.md @@ -0,0 +1,7 @@ +# @rocket.chat/ui-theming + +## 0.1.0-rc.0 + +### Minor Changes + +- 357a3a50fa: feat: high-contrast theme diff --git a/ee/packages/ui-theming/package.json b/ee/packages/ui-theming/package.json index b390d1563a53..a378fee8f896 100644 --- a/ee/packages/ui-theming/package.json +++ b/ee/packages/ui-theming/package.json @@ -1,12 +1,12 @@ { "name": "@rocket.chat/ui-theming", - "version": "0.0.1", + "version": "0.1.0-rc.0", "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/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' }, ], 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, diff --git a/packages/core-services/CHANGELOG.md b/packages/core-services/CHANGELOG.md index f432cc857e7f..b2df91a73bd7 100644 --- a/packages/core-services/CHANGELOG.md +++ b/packages/core-services/CHANGELOG.md @@ -1,5 +1,53 @@ # @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 + +- 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 [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [93d4912e17] + - @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 + +- @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 + +- @rocket.chat/models@0.0.11 +- @rocket.chat/core-typings@6.3.5 +- @rocket.chat/rest-typings@6.3.5 + ## 0.1.4 ### Patch Changes diff --git a/packages/core-services/package.json b/packages/core-services/package.json index f9468b62edb3..f4e05cf08e5b 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.4", + "version": "0.2.0-rc.1", "private": true, "devDependencies": { "@babel/core": "~7.22.9", @@ -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/CHANGELOG.md b/packages/core-typings/CHANGELOG.md index 832aceb8ac06..c6075ce782ba 100644 --- a/packages/core-typings/CHANGELOG.md +++ b/packages/core-typings/CHANGELOG.md @@ -1,5 +1,25 @@ # @rocket.chat/core-typings +## 6.4.0-rc.1 + +## 6.4.0-rc.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 + +### 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.3.6 + +## 6.3.5 + ## 6.3.4 ## 6.3.3 diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index b727aa01dcdc..b582e15f3118 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.4", + "version": "6.4.0-rc.1", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", @@ -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/cron/CHANGELOG.md b/packages/cron/CHANGELOG.md index 9699a8f01631..d763a70fc093 100644 --- a/packages/cron/CHANGELOG.md +++ b/packages/cron/CHANGELOG.md @@ -1,5 +1,40 @@ # @rocket.chat/cron +## 0.0.9-rc.1 + +### Patch Changes + +- @rocket.chat/core-typings@6.4.0-rc.1 +- @rocket.chat/models@0.0.11-rc.1 + +## 0.0.9-rc.0 + +### Patch Changes + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [61128364d6] +- Updated dependencies [d45365436e] + - @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 + +- @rocket.chat/core-typings@6.3.6 +- @rocket.chat/models@0.0.12 + +## 0.0.7 + +### Patch Changes + +- @rocket.chat/models@0.0.11 +- @rocket.chat/core-typings@6.3.5 + ## 0.0.6 ### Patch Changes diff --git a/packages/cron/package.json b/packages/cron/package.json index 2ef55db12b8a..ed418ed4dc5b 100644 --- a/packages/cron/package.json +++ b/packages/cron/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/cron", - "version": "0.0.6", + "version": "0.0.9-rc.1", "private": true, "devDependencies": { "@types/jest": "~29.5.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(); diff --git a/packages/eslint-config/CHANGELOG.md b/packages/eslint-config/CHANGELOG.md new file mode 100644 index 000000000000..59cacad3f786 --- /dev/null +++ b/packages/eslint-config/CHANGELOG.md @@ -0,0 +1,7 @@ +# @rocket.chat/eslint-config + +## 0.6.0-rc.0 + +### Minor Changes + +- 0f56aacc4d: Unpublished changes in ESLint config diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 6c29a7d200a7..1ef1e593f7d5 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/eslint-config", - "version": "0.5.2", + "version": "0.6.0-rc.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 0ec8fb25ca1f..a59fee43ac19 100644 --- a/packages/fuselage-ui-kit/CHANGELOG.md +++ b/packages/fuselage-ui-kit/CHANGELOG.md @@ -1,5 +1,47 @@ # 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 + +- 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-rc.0 + - @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 + +- @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 + +- @rocket.chat/gazzodown@1.0.5 +- @rocket.chat/ui-contexts@1.0.5 +- @rocket.chat/ui-video-conf@1.0.5 + ## 1.0.4 ### Patch Changes diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 70e9f21727d9..fe0d4f02a5cf 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.4", + "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": { @@ -39,16 +39,16 @@ }, "peerDependencies": { "@rocket.chat/apps-engine": "*", - "@rocket.chat/eslint-config": "*", + "@rocket.chat/eslint-config": "0.6.0-rc.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": "1.0.4", + "@rocket.chat/ui-contexts": "2.0.0-rc.1", "@rocket.chat/ui-kit": "*", - "@rocket.chat/ui-video-conf": "1.0.4", + "@rocket.chat/ui-video-conf": "2.0.0-rc.1", "@tanstack/react-query": "*", "react": "*", "react-dom": "*" @@ -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/CHANGELOG.md b/packages/gazzodown/CHANGELOG.md index 3e208b86242d..8eb779c96326 100644 --- a/packages/gazzodown/CHANGELOG.md +++ b/packages/gazzodown/CHANGELOG.md @@ -1,5 +1,46 @@ # @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 + +- Updated dependencies [239a34e877] +- Updated dependencies [203304782f] +- Updated dependencies [4186eecf05] +- Updated dependencies [ba24f3c21f] +- Updated dependencies [ebab8c4dd8] +- Updated dependencies [074db3b419] +- Updated dependencies [61128364d6] +- Updated dependencies [d45365436e] +- Updated dependencies [b8f3d5014f] +- Updated dependencies [ee3815fce4] + - @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 + +- @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 + +- @rocket.chat/core-typings@6.3.5 +- @rocket.chat/ui-contexts@1.0.5 +- @rocket.chat/ui-client@1.0.5 + ## 1.0.4 ### Patch Changes diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index 3e8988200c13..db80f6e36266 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -1,12 +1,12 @@ { "name": "@rocket.chat/gazzodown", - "version": "1.0.4", + "version": "2.0.0-rc.1", "private": true, "devDependencies": { "@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", @@ -65,14 +65,14 @@ "/dist" ], "peerDependencies": { - "@rocket.chat/core-typings": "6.3.4", + "@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": "*", - "@rocket.chat/ui-contexts": "*", + "@rocket.chat/ui-client": "2.0.0-rc.1", + "@rocket.chat/ui-contexts": "2.0.0-rc.1", "katex": "*", "react": "*" }, diff --git a/packages/i18n/CHANGELOG.md b/packages/i18n/CHANGELOG.md new file mode 100644 index 000000000000..88d629fae65c --- /dev/null +++ b/packages/i18n/CHANGELOG.md @@ -0,0 +1,7 @@ +# @rocket.chat/i18n + +## 0.0.2-rc.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. diff --git a/packages/i18n/package.json b/packages/i18n/package.json index 830807b7a12b..da2dae7600ac 100644 --- a/packages/i18n/package.json +++ b/packages/i18n/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/i18n", - "version": "0.0.1", + "version": "0.0.2-rc.0", "private": true, "devDependencies": { "@babel/core": "~7.22.10", diff --git a/packages/instance-status/CHANGELOG.md b/packages/instance-status/CHANGELOG.md index 20b229fbc24c..b060e21ba05a 100644 --- a/packages/instance-status/CHANGELOG.md +++ b/packages/instance-status/CHANGELOG.md @@ -1,5 +1,28 @@ # @rocket.chat/instance-status +## 0.0.13-rc.1 + +### Patch Changes + +- @rocket.chat/models@0.0.13-rc.1 + +## 0.0.13-rc.0 + +### Patch Changes + +- @rocket.chat/models@0.0.13-rc.0 +## 0.0.12 + +### Patch Changes + +- @rocket.chat/models@0.0.12 + +## 0.0.11 + +### Patch Changes + +- @rocket.chat/models@0.0.11 + ## 0.0.10 ### Patch Changes diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index d7d8bbb50d46..6fe5e2ecbd36 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.10", + "version": "0.0.13-rc.1", "private": true, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/packages/livechat/CHANGELOG.md b/packages/livechat/CHANGELOG.md index 3a8732997c2c..08ebfcb6dc18 100644 --- a/packages/livechat/CHANGELOG.md +++ b/packages/livechat/CHANGELOG.md @@ -1,5 +1,25 @@ # @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 + +- 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-rc.0 + - @rocket.chat/random@1.2.1 + ## 1.13.4 ### Patch Changes diff --git a/packages/livechat/package.json b/packages/livechat/package.json index 5857e427fc61..bf151cdad809 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/livechat", - "version": "1.13.4", + "version": "1.14.0-rc.1", "files": [ "/build" ], @@ -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/livechat/src/components/FilesDropTarget/index.js b/packages/livechat/src/components/FilesDropTarget/index.js deleted file mode 100644 index 589cdd8ecde9..000000000000 --- a/packages/livechat/src/components/FilesDropTarget/index.js +++ /dev/null @@ -1,107 +0,0 @@ -import { Component } from 'preact'; - -import { createClassName } from '../../helpers/createClassName'; -import styles from './styles.scss'; - -const escapeForRegExp = (string) => string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); - -export class FilesDropTarget extends Component { - state = { - dragLevel: 0, - }; - - handleInputRef = (ref) => { - this.input = ref; - }; - - handleDragOver = (event) => { - event.preventDefault(); - }; - - handleDragEnter = (event) => { - event.preventDefault(); - this.setState({ dragLevel: this.state.dragLevel + 1 }); - }; - - handleDragLeave = (event) => { - event.preventDefault(); - this.setState({ dragLevel: this.state.dragLevel - 1 }); - }; - - handleDrop = (event) => { - event.preventDefault(); - - let { dragLevel } = this.state; - if (dragLevel === 0) { - return; - } - - dragLevel = 0; - this.setState({ dragLevel }); - - this.handleUpload(event.dataTransfer.files); - }; - - handleInputChange = (event) => { - this.handleUpload(event.currentTarget.files); - }; - - handleUpload = (files) => { - const { accept, multiple, onUpload } = this.props; - - if (!onUpload) { - return; - } - - let filteredFiles = Array.from(files); - - if (accept) { - const acceptMatchers = accept.split(',').map((acceptString) => { - if (acceptString.charAt(0) === '.') { - return ({ name }) => new RegExp(`${escapeForRegExp(acceptString)}$`, 'i').test(name); - } - - const matchTypeOnly = /^(.+)\/\*$/i.exec(acceptString); - if (matchTypeOnly) { - return ({ type }) => new RegExp(`^${escapeForRegExp(matchTypeOnly[1])}/.*$`, 'i').test(type); - } - - return ({ type }) => 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); - }; - - browse = () => { - this.input.click(); - }; - - render = ({ overlayed, overlayText, accept, multiple, className, style = {}, children }, { dragLevel }) => ( -
0 }, [className])} - style={style} - > - - {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 ? ( diff --git a/packages/mock-providers/CHANGELOG.md b/packages/mock-providers/CHANGELOG.md new file mode 100644 index 000000000000..448ae0b742a4 --- /dev/null +++ b/packages/mock-providers/CHANGELOG.md @@ -0,0 +1,9 @@ +# @rocket.chat/mock-providers + +## 0.0.2-rc.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 [b8f3d5014f] + - @rocket.chat/i18n@0.0.2-rc.0 diff --git a/packages/mock-providers/package.json b/packages/mock-providers/package.json index d739e442879e..d5bc013d9a18 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.1", + "version": "0.0.2-rc.0", "private": true, "dependencies": { "@rocket.chat/i18n": "workspace:~", diff --git a/packages/model-typings/CHANGELOG.md b/packages/model-typings/CHANGELOG.md index 836eb3a1dcc8..bf8c21bf1eeb 100644 --- a/packages/model-typings/CHANGELOG.md +++ b/packages/model-typings/CHANGELOG.md @@ -1,5 +1,52 @@ # @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 + +- 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 [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0-rc.0 +## 0.0.12 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 + +## 0.0.11 + +### Patch Changes + +- 92d25b9c7a: 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. + + - @rocket.chat/core-typings@6.3.5 + ## 0.0.10 ### Patch Changes diff --git a/packages/model-typings/package.json b/packages/model-typings/package.json index bacc3023e5f4..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.0.10", + "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 230aa3158fbd..f116a2b9f4fa 100644 --- a/packages/models/CHANGELOG.md +++ b/packages/models/CHANGELOG.md @@ -1,5 +1,36 @@ # @rocket.chat/models +## 0.0.13-rc.1 + +### Patch Changes + +- @rocket.chat/model-typings@0.1.0-rc.1 + +## 0.0.13-rc.0 + +### 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-rc.0 +## 0.0.12 + +### Patch Changes + +- @rocket.chat/model-typings@0.0.12 + +## 0.0.11 + +### Patch Changes + +- Updated dependencies [92d25b9c7a] + - @rocket.chat/model-typings@0.0.11 + ## 0.0.10 ### Patch Changes diff --git a/packages/models/package.json b/packages/models/package.json index c075c8132582..8ac94514b627 100644 --- a/packages/models/package.json +++ b/packages/models/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/models", - "version": "0.0.10", + "version": "0.0.13-rc.1", "private": true, "devDependencies": { "@types/jest": "~29.5.3", diff --git a/packages/password-policies/.eslintrc.json b/packages/password-policies/.eslintrc.json new file mode 100644 index 000000000000..15f2cd4817e1 --- /dev/null +++ b/packages/password-policies/.eslintrc.json @@ -0,0 +1,8 @@ +{ + "extends": ["@rocket.chat/eslint-config"], + "plugins": ["jest"], + "env": { + "jest/globals": true + }, + "ignorePatterns": ["**/dist"] +} diff --git a/packages/password-policies/jest.config.ts b/packages/password-policies/jest.config.ts new file mode 100644 index 000000000000..959a31a7c6bf --- /dev/null +++ b/packages/password-policies/jest.config.ts @@ -0,0 +1,3 @@ +export default { + preset: 'ts-jest', +}; diff --git a/packages/password-policies/package.json b/packages/password-policies/package.json new file mode 100644 index 000000000000..52fa766671db --- /dev/null +++ b/packages/password-policies/package.json @@ -0,0 +1,26 @@ +{ + "name": "@rocket.chat/password-policies", + "version": "0.0.1", + "private": true, + "devDependencies": { + "@types/chai": "^4.3.5", + "@types/jest": "~29.5.3", + "chai": "^4.3.7", + "eslint": "~8.45.0", + "jest": "~29.6.1", + "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", + "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" + ] +} diff --git a/apps/meteor/app/lib/server/lib/PasswordPolicyClass.js b/packages/password-policies/src/PasswordPolicyClass.ts similarity index 61% rename from apps/meteor/app/lib/server/lib/PasswordPolicyClass.js rename to packages/password-policies/src/PasswordPolicyClass.ts index 99dc0d6fabf5..8212df18002c 100644 --- a/apps/meteor/app/lib/server/lib/PasswordPolicyClass.js +++ b/packages/password-policies/src/PasswordPolicyClass.ts @@ -1,8 +1,45 @@ -import { Random } from '@rocket.chat/random'; -import generator from 'generate-password'; -import { Meteor } from 'meteor/meteor'; +import { PasswordPolicyError } from './PasswordPolicyError'; + +type PasswordPolicyType = { + enabled: boolean; + policy: [name: string, options?: Record][]; +}; + +type ValidationMessageType = { + name: string; + isValid: boolean; + limit?: number; +}; + +export class PasswordPolicy { + private regex: { + forbiddingRepeatingCharacters: RegExp; + mustContainAtLeastOneLowercase: RegExp; + mustContainAtLeastOneUppercase: RegExp; + mustContainAtLeastOneNumber: RegExp; + mustContainAtLeastOneSpecialCharacter: RegExp; + }; + + private enabled: boolean; + + private minLength: number; + + private maxLength: number; + + private forbidRepeatingCharacters: boolean; + + private mustContainAtLeastOneLowercase: boolean; + + private mustContainAtLeastOneUppercase: boolean; + + private mustContainAtLeastOneNumber: boolean; + + private mustContainAtLeastOneSpecialCharacter: boolean; + + private throwError: boolean; + + private forbidRepeatingCharactersCount: number; -class PasswordPolicy { constructor({ enabled = false, minLength = -1, @@ -14,14 +51,7 @@ class PasswordPolicy { mustContainAtLeastOneNumber = false, mustContainAtLeastOneSpecialCharacter = false, throwError = true, - } = {}) { - this.regex = { - mustContainAtLeastOneLowercase: new RegExp('[a-z]'), - mustContainAtLeastOneUppercase: new RegExp('[A-Z]'), - mustContainAtLeastOneNumber: new RegExp('[0-9]'), - mustContainAtLeastOneSpecialCharacter: new RegExp('[^A-Za-z0-9 ]'), - }; - + }) { this.enabled = enabled; this.minLength = minLength; this.maxLength = maxLength; @@ -32,27 +62,103 @@ class PasswordPolicy { this.mustContainAtLeastOneNumber = mustContainAtLeastOneNumber; this.mustContainAtLeastOneSpecialCharacter = mustContainAtLeastOneSpecialCharacter; this.throwError = throwError; - } - set forbidRepeatingCharactersCount(value) { - this._forbidRepeatingCharactersCount = value; - this.regex.forbiddingRepeatingCharacters = new RegExp(`(.)\\1{${this.forbidRepeatingCharactersCount},}`); - } - - get forbidRepeatingCharactersCount() { - return this._forbidRepeatingCharactersCount; + this.regex = { + forbiddingRepeatingCharacters: new RegExp(`(.)\\1{${forbidRepeatingCharactersCount},}`), + mustContainAtLeastOneLowercase: new RegExp('[a-z]'), + mustContainAtLeastOneUppercase: new RegExp('[A-Z]'), + mustContainAtLeastOneNumber: new RegExp('[0-9]'), + mustContainAtLeastOneSpecialCharacter: new RegExp('[^A-Za-z0-9 ]'), + }; } - error(error, message, reasons) { + error( + error: string, + message: string, + reasons?: { + error: string; + message: string; + }[], + ) { if (this.throwError) { - throw new Meteor.Error(error, message, reasons); + throw new PasswordPolicyError(message, error, reasons); } return false; } - validate(password) { - const reasons = []; + sendValidationMessage(password: string): { + name: string; + isValid: boolean; + limit?: number; + }[] { + const validationReturn: ValidationMessageType[] = []; + + if (!this.enabled) { + return []; + } + + if (this.minLength >= 1) { + validationReturn.push({ + name: 'get-password-policy-minLength', + isValid: !(password.length < this.minLength), + limit: this.minLength, + }); + } + + if (this.maxLength >= 1) { + validationReturn.push({ + name: 'get-password-policy-maxLength', + isValid: !(password.length > this.maxLength), + limit: this.maxLength, + }); + } + + if (this.forbidRepeatingCharacters) { + validationReturn.push({ + name: 'get-password-policy-forbidRepeatingCharactersCount', + isValid: !this.regex.forbiddingRepeatingCharacters.test(password), + limit: this.forbidRepeatingCharactersCount, + }); + } + + if (this.mustContainAtLeastOneLowercase) { + validationReturn.push({ + name: 'get-password-policy-mustContainAtLeastOneLowercase', + isValid: this.regex.mustContainAtLeastOneLowercase.test(password), + }); + } + + if (this.mustContainAtLeastOneUppercase) { + validationReturn.push({ + name: 'get-password-policy-mustContainAtLeastOneUppercase', + isValid: this.regex.mustContainAtLeastOneUppercase.test(password), + }); + } + + if (this.mustContainAtLeastOneNumber) { + validationReturn.push({ + name: 'get-password-policy-mustContainAtLeastOneNumber', + isValid: this.regex.mustContainAtLeastOneNumber.test(password), + }); + } + + if (this.mustContainAtLeastOneSpecialCharacter) { + validationReturn.push({ + name: 'get-password-policy-mustContainAtLeastOneSpecialCharacter', + isValid: this.regex.mustContainAtLeastOneSpecialCharacter.test(password), + }); + } + + return validationReturn; + } + + validate(password: string) { + const reasons: { + error: string; + message: string; + }[] = []; + if (typeof password !== 'string' || !password.trim().length) { return this.error('error-password-policy-not-met', "The password provided does not meet the server's password policy."); } @@ -117,11 +223,12 @@ class PasswordPolicy { return true; } - getPasswordPolicy() { - const data = { + getPasswordPolicy(): PasswordPolicyType { + const data: PasswordPolicyType = { enabled: false, policy: [], }; + if (this.enabled) { data.enabled = true; if (this.minLength >= 1) { @@ -154,31 +261,4 @@ class PasswordPolicy { } return data; } - - generatePassword() { - if (this.enabled) { - for (let i = 0; i < 10; i++) { - const password = this._generatePassword(); - if (this.validate(password)) { - return password; - } - } - } - - return Random.id(); - } - - _generatePassword() { - const length = Math.min(Math.max(this.minLength, 12), this.maxLength > 0 ? this.maxLength : Number.MAX_SAFE_INTEGER); - return generator.generate({ - length, - ...(this.mustContainAtLeastOneNumber && { numbers: true }), - ...(this.mustContainAtLeastOneSpecialCharacter && { symbols: true }), - ...(this.mustContainAtLeastOneLowercase && { lowercase: true }), - ...(this.mustContainAtLeastOneUppercase && { uppercase: true }), - strict: true, - }); - } } - -export default PasswordPolicy; diff --git a/packages/password-policies/src/PasswordPolicyError.ts b/packages/password-policies/src/PasswordPolicyError.ts new file mode 100644 index 000000000000..ea58d0e83b07 --- /dev/null +++ b/packages/password-policies/src/PasswordPolicyError.ts @@ -0,0 +1,11 @@ +export class PasswordPolicyError extends Error { + public error: string; + + public details?: { error: string; message: string }[] | undefined; + + constructor(message: string, error: string, details?: { error: string; message: string }[]) { + super(message); + this.error = error; + this.details = details; + } +} diff --git a/packages/password-policies/src/index.ts b/packages/password-policies/src/index.ts new file mode 100644 index 000000000000..ce94042e029a --- /dev/null +++ b/packages/password-policies/src/index.ts @@ -0,0 +1 @@ +export { PasswordPolicy } from './PasswordPolicyClass'; diff --git a/packages/password-policies/tests/passwordPolicyClass.test.ts b/packages/password-policies/tests/passwordPolicyClass.test.ts new file mode 100644 index 000000000000..4cda16e3dd27 --- /dev/null +++ b/packages/password-policies/tests/passwordPolicyClass.test.ts @@ -0,0 +1,223 @@ +import { expect } from 'chai'; + +import { PasswordPolicy } from '../src/PasswordPolicyClass'; + +describe('PasswordPolicy', () => { + describe('Password tests with default options', () => { + it('should allow all passwords', () => { + const passwordPolicy = new PasswordPolicy({ throwError: false }); + expect(passwordPolicy.validate(null as any)).to.be.equal(false); + expect(passwordPolicy.validate(undefined as any)).to.be.equal(false); + expect(passwordPolicy.validate('')).to.be.equal(false); + expect(passwordPolicy.validate(' ')).to.be.equal(false); + expect(passwordPolicy.validate('a')).to.be.equal(true); + expect(passwordPolicy.validate('aaaaaaaaa')).to.be.equal(true); + }); + }); + + describe('Password tests with options', () => { + it('should not allow non string or empty', () => { + const passwordPolicy = new PasswordPolicy({ + enabled: true, + throwError: false, + }); + expect(passwordPolicy.validate(null as any)).to.be.equal(false); + expect(passwordPolicy.validate(undefined as any)).to.be.false; + expect(passwordPolicy.validate(1 as any)).to.be.false; + expect(passwordPolicy.validate(true as any)).to.be.false; + expect(passwordPolicy.validate(new Date() as any)).to.be.false; + expect(passwordPolicy.validate(new Function() as any)).to.be.false; + expect(passwordPolicy.validate('')).to.be.false; + }); + + it('should restrict by minLength', () => { + const passwordPolicy = new PasswordPolicy({ + enabled: true, + minLength: 5, + throwError: false, + }); + + expect(passwordPolicy.validate('1')).to.be.false; + expect(passwordPolicy.validate('1234')).to.be.false; + expect(passwordPolicy.validate('12345')).to.be.true; + expect(passwordPolicy.validate(' ')).to.be.false; + }); + + it('should restrict by maxLength', () => { + const passwordPolicy = new PasswordPolicy({ + enabled: true, + maxLength: 5, + throwError: false, + }); + + expect(passwordPolicy.validate('1')).to.be.true; + expect(passwordPolicy.validate('12345')).to.be.true; + expect(passwordPolicy.validate('123456')).to.be.false; + expect(passwordPolicy.validate(' ')).to.be.false; + }); + + it('should allow repeated characters', () => { + const passwordPolicy = new PasswordPolicy({ + enabled: true, + forbidRepeatingCharacters: false, + throwError: false, + }); + + expect(passwordPolicy.validate('1')).to.be.true; + expect(passwordPolicy.validate('12345')).to.be.true; + expect(passwordPolicy.validate('123456')).to.be.true; + expect(passwordPolicy.validate(' ')).to.be.false; + expect(passwordPolicy.validate('11111111111111')).to.be.true; + }); + + it('should restrict repeated characters', () => { + const passwordPolicy = new PasswordPolicy({ + enabled: true, + forbidRepeatingCharacters: true, + forbidRepeatingCharactersCount: 3, + throwError: false, + }); + + expect(passwordPolicy.validate('1')).to.be.true; + expect(passwordPolicy.validate('11')).to.be.true; + expect(passwordPolicy.validate('111')).to.be.true; + expect(passwordPolicy.validate('1111')).to.be.false; + expect(passwordPolicy.validate(' ')).to.be.false; + expect(passwordPolicy.validate('123456')).to.be.true; + }); + + it('should restrict repeated characters customized', () => { + const passwordPolicy = new PasswordPolicy({ + enabled: true, + forbidRepeatingCharacters: true, + forbidRepeatingCharactersCount: 5, + throwError: false, + }); + + expect(passwordPolicy.validate('1')).to.be.true; + expect(passwordPolicy.validate('11')).to.be.true; + expect(passwordPolicy.validate('111')).to.be.true; + expect(passwordPolicy.validate('1111')).to.be.true; + expect(passwordPolicy.validate('11111')).to.be.true; + expect(passwordPolicy.validate('111111')).to.be.false; + expect(passwordPolicy.validate(' ')).to.be.false; + expect(passwordPolicy.validate('123456')).to.be.true; + }); + + it('should contain one lowercase', () => { + const passwordPolicy = new PasswordPolicy({ + enabled: true, + mustContainAtLeastOneLowercase: true, + throwError: false, + }); + + expect(passwordPolicy.validate('a')).to.be.true; + expect(passwordPolicy.validate('aa')).to.be.true; + expect(passwordPolicy.validate('A')).to.be.false; + expect(passwordPolicy.validate(' ')).to.be.false; + expect(passwordPolicy.validate('123456')).to.be.false; + expect(passwordPolicy.validate('AAAAA')).to.be.false; + expect(passwordPolicy.validate('AAAaAAA')).to.be.true; + }); + + it('should contain one uppercase', () => { + const passwordPolicy = new PasswordPolicy({ + enabled: true, + mustContainAtLeastOneUppercase: true, + throwError: false, + }); + + expect(passwordPolicy.validate('a')).to.be.false; + expect(passwordPolicy.validate('aa')).to.be.false; + expect(passwordPolicy.validate('A')).to.be.true; + expect(passwordPolicy.validate(' ')).to.be.false; + expect(passwordPolicy.validate('123456')).to.be.false; + expect(passwordPolicy.validate('AAAAA')).to.be.true; + expect(passwordPolicy.validate('AAAaAAA')).to.be.true; + }); + + it('should contain one number', () => { + const passwordPolicy = new PasswordPolicy({ + enabled: true, + mustContainAtLeastOneNumber: true, + throwError: false, + }); + + expect(passwordPolicy.validate('a')).to.be.false; + expect(passwordPolicy.validate('aa')).to.be.false; + expect(passwordPolicy.validate('A')).to.be.false; + expect(passwordPolicy.validate(' ')).to.be.false; + expect(passwordPolicy.validate('123456')).to.be.true; + expect(passwordPolicy.validate('AAAAA')).to.be.false; + expect(passwordPolicy.validate('AAAaAAA')).to.be.false; + expect(passwordPolicy.validate('AAAa1AAA')).to.be.true; + }); + + it('should contain one special character', () => { + const passwordPolicy = new PasswordPolicy({ + enabled: true, + mustContainAtLeastOneSpecialCharacter: true, + throwError: false, + }); + + expect(passwordPolicy.validate('a')).to.be.false; + expect(passwordPolicy.validate('aa')).to.be.false; + expect(passwordPolicy.validate('A')).to.be.false; + expect(passwordPolicy.validate(' ')).to.be.false; + expect(passwordPolicy.validate('123456')).to.be.false; + expect(passwordPolicy.validate('AAAAA')).to.be.false; + expect(passwordPolicy.validate('AAAaAAA')).to.be.false; + expect(passwordPolicy.validate('AAAa1AAA')).to.be.false; + expect(passwordPolicy.validate('AAAa@AAA')).to.be.true; + }); + }); + + describe('Password Policy', () => { + it('should return a correct password policy', () => { + const passwordPolicy = new PasswordPolicy({ + enabled: true, + throwError: false, + minLength: 10, + maxLength: 20, + forbidRepeatingCharacters: true, + forbidRepeatingCharactersCount: 4, + mustContainAtLeastOneLowercase: true, + mustContainAtLeastOneUppercase: true, + mustContainAtLeastOneNumber: true, + mustContainAtLeastOneSpecialCharacter: true, + }); + + const policy = passwordPolicy.getPasswordPolicy(); + + expect(policy).to.not.be.undefined; + expect(policy.enabled).to.be.true; + expect(policy.policy.length).to.be.equal(8); + expect(policy.policy[0][0]).to.be.equal('get-password-policy-minLength'); + expect(policy.policy[0][1]?.minLength).to.be.equal(10); + }); + + it('should return correct values if policy is disabled', () => { + const passwordPolicy = new PasswordPolicy({ + enabled: false, + }); + + const policy = passwordPolicy.getPasswordPolicy(); + + expect(policy.enabled).to.be.false; + expect(policy.policy.length).to.be.equal(0); + }); + + it('should return correct values if policy is enabled but no specifiers exists', () => { + const passwordPolicy = new PasswordPolicy({ + enabled: true, + }); + + const policy = passwordPolicy.getPasswordPolicy(); + + expect(policy.enabled).to.be.true; + // even when no policy is specified, forbidRepeatingCharactersCount is still configured + // since its default value is 3 + expect(policy.policy.length).to.be.equal(1); + }); + }); +}); diff --git a/packages/password-policies/tsconfig.json b/packages/password-policies/tsconfig.json new file mode 100644 index 000000000000..e2be47cf5499 --- /dev/null +++ b/packages/password-policies/tsconfig.json @@ -0,0 +1,8 @@ +{ + "extends": "../../tsconfig.base.client.json", + "compilerOptions": { + "rootDir": "./src", + "outDir": "./dist" + }, + "include": ["./src/**/*"] +} diff --git a/packages/release-action/CHANGELOG.md b/packages/release-action/CHANGELOG.md index ee73fe152636..23416df8c835 100644 --- a/packages/release-action/CHANGELOG.md +++ b/packages/release-action/CHANGELOG.md @@ -1,5 +1,16 @@ # @rocket.chat/release-action +## 2.2.0-rc.0 + +### Minor Changes + +- f93648a5df: Add back "Engine Versions" to the release notes + +### Patch Changes + +- Updated dependencies [0f56aacc4d] + - @rocket.chat/eslint-config@0.6.0-rc.0 + ## 2.1.0 ### Minor Changes diff --git a/packages/release-action/package.json b/packages/release-action/package.json index 769795a56240..c227df3f2d0f 100644 --- a/packages/release-action/package.json +++ b/packages/release-action/package.json @@ -1,6 +1,6 @@ { "name": "@rocket.chat/release-action", - "version": "2.1.0", + "version": "2.2.0-rc.0", "private": true, "scripts": { "build": "tsc", diff --git a/packages/rest-typings/CHANGELOG.md b/packages/rest-typings/CHANGELOG.md index 62f05e378e4e..479c5baac925 100644 --- a/packages/rest-typings/CHANGELOG.md +++ b/packages/rest-typings/CHANGELOG.md @@ -1,5 +1,47 @@ # @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 + +- 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 +- 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 [61128364d6] +- Updated dependencies [d45365436e] + - @rocket.chat/core-typings@6.4.0-rc.0 +## 6.3.6 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.6 + +## 6.3.5 + +### Patch Changes + +- @rocket.chat/core-typings@6.3.5 + ## 6.3.4 ### Patch Changes diff --git a/packages/rest-typings/package.json b/packages/rest-typings/package.json index 45bb773b7dee..cc12bd6d901d 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.4", + "version": "6.4.0-rc.1", "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", "@types/jest": "~29.5.3", @@ -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/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; + }; }; diff --git a/packages/ui-client/CHANGELOG.md b/packages/ui-client/CHANGELOG.md index fa6ebadcedfa..4141b97d6ff1 100644 --- a/packages/ui-client/CHANGELOG.md +++ b/packages/ui-client/CHANGELOG.md @@ -1,5 +1,36 @@ # @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 + +- 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-rc.0 +## 1.0.6 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.6 + +## 1.0.5 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.5 + ## 1.0.4 ### Patch Changes diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index adf07e87c9a0..9fc0b7f3617c 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -1,13 +1,13 @@ { "name": "@rocket.chat/ui-client", - "version": "1.0.4", + "version": "2.0.0-rc.1", "private": true, "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", @@ -61,7 +61,7 @@ "@rocket.chat/fuselage": "*", "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", - "@rocket.chat/ui-contexts": "1.0.4", + "@rocket.chat/ui-contexts": "2.0.0-rc.1", "react": "~17.0.2" }, "volta": { diff --git a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.stories.tsx b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.stories.tsx index fe3be924ab18..412305be13e9 100644 --- a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.stories.tsx +++ b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.stories.tsx @@ -3,46 +3,42 @@ import type { ComponentMeta, ComponentStory } from '@storybook/react'; import { PasswordVerifier } from './PasswordVerifier'; -type Response = { - enabled: boolean; - policy: [ - name: string, - value?: - | { - [x: string]: number; - } - | undefined, - ][]; -}; - export default { title: 'Components/PasswordVerifier', component: PasswordVerifier, -} as ComponentMeta; - -const response: Response = { - enabled: true, - policy: [ - ['get-password-policy-minLength', { minLength: 10 }], - ['get-password-policy-forbidRepeatingCharactersCount', { maxRepeatingChars: 3 }], - ['get-password-policy-mustContainAtLeastOneLowercase'], - ['get-password-policy-mustContainAtLeastOneUppercase'], - ['get-password-policy-mustContainAtLeastOneNumber'], - ['get-password-policy-mustContainAtLeastOneSpecialCharacter'], + decorators: [ + mockAppRoot() + .withSetting('Accounts_Password_Policy_Enabled', 'true') + .withSetting('Accounts_Password_Policy_MinLength', '12') + .withSetting('Accounts_Password_Policy_MaxLength', '24') + .withSetting('Accounts_Password_Policy_ForbidRepeatingCharacters', 'true') + .withSetting('Accounts_Password_Policy_ForbidRepeatingCharactersCount', '3') + .withSetting('Accounts_Password_Policy_AtLeastOneLowercase', 'true') + .withSetting('Accounts_Password_Policy_AtLeastOneUppercase', 'true') + .withSetting('Accounts_Password_Policy_AtLeastOneNumber', 'true') + .withSetting('Accounts_Password_Policy_AtLeastOneSpecialCharacter', 'true') + .withSetting('Language', 'en') + .withTranslations('en', 'core', { Password_must_have: 'Password must have:' }) + .withTranslations('en', 'core', { 'get-password-policy-minLength-label': 'At least {{limit}} characters' }) + .withTranslations('en', 'core', { 'get-password-policy-maxLength-label': 'At most {{limit}} characters' }) + .withTranslations('en', 'core', { + 'get-password-policy-forbidRepeatingCharactersCount-label': 'Max. {{limit}} repeating characters', + }) + .withTranslations('en', 'core', { + 'get-password-policy-mustContainAtLeastOneLowercase-label': 'At least one lowercase letter', + }) + .withTranslations('en', 'core', { + 'get-password-policy-mustContainAtLeastOneUppercase-label': 'At least one uppercase letter', + }) + .withTranslations('en', 'core', { 'get-password-policy-mustContainAtLeastOneNumber-label': 'At least one number' }) + .withTranslations('en', 'core', { + 'get-password-policy-mustContainAtLeastOneSpecialCharacter-label': 'At least one symbol', + }) + .buildStoryDecorator(), ], -}; - -const Wrapper = mockAppRoot() - .withEndpoint('GET', '/v1/pw.getPolicy', () => response) - .build(); - -export const Default: ComponentStory = (args) => ( - - - -); + args: { + password: '123', + }, +} as ComponentMeta; -Default.storyName = 'PasswordVerifier'; -Default.args = { - password: 'asd', -}; +export const Default: ComponentStory = (args) => ; diff --git a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.tsx b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.tsx index 9599f43c6cbb..bf53360a2351 100644 --- a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.tsx +++ b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifier.tsx @@ -1,4 +1,4 @@ -import { Box, Skeleton } from '@rocket.chat/fuselage'; +import { Box } from '@rocket.chat/fuselage'; import { useUniqueId } from '@rocket.chat/fuselage-hooks'; import { useVerifyPassword } from '@rocket.chat/ui-contexts'; import { useTranslation } from 'react-i18next'; @@ -10,15 +10,17 @@ type PasswordVerifierProps = { id?: string; }; +type PasswordVerificationProps = { + name: string; + isValid: boolean; + limit?: number; +}[]; + export const PasswordVerifier = ({ password, id }: PasswordVerifierProps) => { const { t } = useTranslation(); const uniqueId = useUniqueId(); - const { data: passwordVerifications, isLoading } = useVerifyPassword(password || ''); - - if (isLoading) { - return ; - } + const passwordVerifications: PasswordVerificationProps = useVerifyPassword(password || ''); if (!passwordVerifications?.length) { return null; diff --git a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifiers.spec.tsx b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifiers.spec.tsx index cd2a5175e59f..cb2efaca19f5 100644 --- a/packages/ui-client/src/components/PasswordVerifier/PasswordVerifiers.spec.tsx +++ b/packages/ui-client/src/components/PasswordVerifier/PasswordVerifiers.spec.tsx @@ -1,51 +1,24 @@ import { mockAppRoot } from '@rocket.chat/mock-providers'; -import { passwordVerificationsTemplate } from '@rocket.chat/ui-contexts/dist/hooks/useVerifyPassword'; import { render, waitFor } from '@testing-library/react'; import { PasswordVerifier } from './PasswordVerifier'; -type Response = { - enabled: boolean; - policy: [ - name: string, - value?: - | { - [x: string]: number; - } - | undefined, - ][]; -}; - afterEach(() => { // restore the spy created with spyOn jest.restoreAllMocks(); }); it('should render no policy if its disabled ', () => { - const response: Response = { - enabled: false, - policy: [], - }; - const { queryByRole } = render(, { - wrapper: mockAppRoot() - .withEndpoint('GET', '/v1/pw.getPolicy', () => response) - .build(), + wrapper: mockAppRoot().withSetting('Accounts_Password_Policy_Enabled', 'true').build(), }); expect(queryByRole('list')).toBeNull(); }); it('should render no policy if its enabled but empty', async () => { - const response: Response = { - enabled: true, - policy: [], - }; - const { queryByRole, queryByTestId } = render(, { - wrapper: mockAppRoot() - .withEndpoint('GET', '/v1/pw.getPolicy', () => response) - .build(), + wrapper: mockAppRoot().build(), }); await waitFor(() => { @@ -55,14 +28,10 @@ it('should render no policy if its enabled but empty', async () => { }); it('should render policy list if its enabled and not empty', async () => { - const response: Response = { - enabled: true, - policy: [['get-password-policy-minLength', { minLength: 10 }]], - }; - const { queryByRole, queryByTestId } = render(, { wrapper: mockAppRoot() - .withEndpoint('GET', '/v1/pw.getPolicy', () => response) + .withSetting('Accounts_Password_Policy_Enabled', 'true') + .withSetting('Accounts_Password_Policy_MinLength', '6') .build(), }); @@ -75,14 +44,17 @@ it('should render policy list if its enabled and not empty', async () => { }); it('should render all the policies when all policies are enabled', async () => { - const response: Response = { - enabled: true, - policy: Object.keys(passwordVerificationsTemplate).map((item) => [item]), - }; - const { queryByTestId, queryAllByRole } = render(, { wrapper: mockAppRoot() - .withEndpoint('GET', '/v1/pw.getPolicy', () => response) + .withSetting('Accounts_Password_Policy_Enabled', 'true') + .withSetting('Accounts_Password_Policy_MinLength', '6') + .withSetting('Accounts_Password_Policy_MaxLength', '24') + .withSetting('Accounts_Password_Policy_ForbidRepeatingCharacters', 'true') + .withSetting('Accounts_Password_Policy_ForbidRepeatingCharactersCount', '3') + .withSetting('Accounts_Password_Policy_AtLeastOneLowercase', 'true') + .withSetting('Accounts_Password_Policy_AtLeastOneUppercase', 'true') + .withSetting('Accounts_Password_Policy_AtLeastOneNumber', 'true') + .withSetting('Accounts_Password_Policy_AtLeastOneSpecialCharacter', 'true') .build(), }); @@ -90,18 +62,14 @@ it('should render all the policies when all policies are enabled', async () => { expect(queryByTestId('password-verifier-skeleton')).toBeNull(); }); - expect(queryAllByRole('listitem').length).toEqual(response.policy.length); + expect(queryAllByRole('listitem').length).toEqual(7); }); it("should render policy as invalid if password doesn't match the requirements", async () => { - const response: Response = { - enabled: true, - policy: [['get-password-policy-minLength', { minLength: 10 }]], - }; - const { queryByTestId, getByRole } = render(, { wrapper: mockAppRoot() - .withEndpoint('GET', '/v1/pw.getPolicy', () => response) + .withSetting('Accounts_Password_Policy_Enabled', 'true') + .withSetting('Accounts_Password_Policy_MinLength', '10') .build(), }); @@ -113,14 +81,10 @@ it("should render policy as invalid if password doesn't match the requirements", }); it('should render policy as valid if password matches the requirements', async () => { - const response: Response = { - enabled: true, - policy: [['get-password-policy-minLength', { minLength: 2 }]], - }; - const { queryByTestId, getByRole } = render(, { wrapper: mockAppRoot() - .withEndpoint('GET', '/v1/pw.getPolicy', () => response) + .withSetting('Accounts_Password_Policy_Enabled', 'true') + .withSetting('Accounts_Password_Policy_MinLength', '2') .build(), }); diff --git a/packages/ui-client/src/hooks/useValidatePassword.spec.ts b/packages/ui-client/src/hooks/useValidatePassword.spec.ts index 5d1c5a635c52..275e4ab8d6f5 100644 --- a/packages/ui-client/src/hooks/useValidatePassword.spec.ts +++ b/packages/ui-client/src/hooks/useValidatePassword.spec.ts @@ -3,64 +3,32 @@ import { renderHook } from '@testing-library/react-hooks'; import { useValidatePassword } from './useValidatePassword'; -type Response = { - enabled: boolean; - policy: [ - name: string, - value?: - | { - [x: string]: number; - } - | undefined, - ][]; -}; +const settingsMockWrapper = mockAppRoot() + .withSetting('Accounts_Password_Policy_Enabled', 'true') + .withSetting('Accounts_Password_Policy_MinLength', '6') + .withSetting('Accounts_Password_Policy_MaxLength', '24') + .withSetting('Accounts_Password_Policy_ForbidRepeatingCharacters', 'true') + .withSetting('Accounts_Password_Policy_ForbidRepeatingCharactersCount', '3') + .withSetting('Accounts_Password_Policy_AtLeastOneLowercase', 'true') + .withSetting('Accounts_Password_Policy_AtLeastOneUppercase', 'true') + .withSetting('Accounts_Password_Policy_AtLeastOneNumber', 'true') + .withSetting('Accounts_Password_Policy_AtLeastOneSpecialCharacter', 'true') + .build(); it("should return `false` if password doesn't match all the requirements", async () => { - const response: Response = { - enabled: true, - policy: [['get-password-policy-minLength', { minLength: 8 }]], - }; - - const { result, waitForValueToChange } = renderHook(async () => useValidatePassword('secret'), { - wrapper: mockAppRoot() - .withEndpoint('GET', '/v1/pw.getPolicy', () => response) - .build(), + const { result } = renderHook(async () => useValidatePassword('secret'), { + wrapper: settingsMockWrapper, }); - await waitForValueToChange(() => result.current); const res = await result.current; expect(res).toBeFalsy(); }); it('should return `true` if password matches all the requirements', async () => { - const response: Response = { - enabled: true, - policy: [['get-password-policy-minLength', { minLength: 8 }]], - }; - - const { result, waitForValueToChange } = renderHook(async () => useValidatePassword('secret-password'), { - wrapper: mockAppRoot() - .withEndpoint('GET', '/v1/pw.getPolicy', () => response) - .build(), + const { result } = renderHook(async () => useValidatePassword('5kgnGPq^&t4DSYW!SH#4N'), { + wrapper: settingsMockWrapper, }); - await waitForValueToChange(() => result.current); const res = await result.current; expect(res).toBeTruthy(); }); - -it('should return `undefined` if password validation is still loading', async () => { - const response: Response = { - enabled: true, - policy: [['get-password-policy-minLength', { minLength: 8 }]], - }; - - const { result } = renderHook(async () => useValidatePassword('secret-password'), { - wrapper: mockAppRoot() - .withEndpoint('GET', '/v1/pw.getPolicy', () => response) - .build(), - }); - - const res = await result.current; - expect(res).toBeUndefined(); -}); diff --git a/packages/ui-client/src/hooks/useValidatePassword.ts b/packages/ui-client/src/hooks/useValidatePassword.ts index 3402bbaf8435..9098d13009e1 100644 --- a/packages/ui-client/src/hooks/useValidatePassword.ts +++ b/packages/ui-client/src/hooks/useValidatePassword.ts @@ -1,8 +1,14 @@ import { useVerifyPassword } from '@rocket.chat/ui-contexts'; import { useMemo } from 'react'; -export const useValidatePassword = (password: string) => { - const { data: passwordVerifications, isLoading } = useVerifyPassword(password); +type passwordVerificationsType = { + name: string; + isValid: boolean; + limit?: number; +}[]; - return useMemo(() => (isLoading ? undefined : passwordVerifications.every(({ isValid }) => isValid)), [isLoading, passwordVerifications]); +export const useValidatePassword = (password: string): boolean => { + const passwordVerifications: passwordVerificationsType = useVerifyPassword(password); + + return useMemo(() => passwordVerifications.every(({ isValid }) => isValid), [passwordVerifications]); }; 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/CHANGELOG.md b/packages/ui-contexts/CHANGELOG.md index af1cef5bcba6..fa432dfd6c66 100644 --- a/packages/ui-contexts/CHANGELOG.md +++ b/packages/ui-contexts/CHANGELOG.md @@ -1,5 +1,55 @@ # @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 + +- 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 [61128364d6] +- Updated dependencies [9496f1eb97] +- Updated dependencies [d45365436e] +- Updated dependencies [93d4912e17] + - @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 + +- @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 + +- @rocket.chat/core-typings@6.3.5 +- @rocket.chat/rest-typings@6.3.5 +- @rocket.chat/ddp-client@0.1.5 + ## 1.0.4 ### Patch Changes diff --git a/packages/ui-contexts/package.json b/packages/ui-contexts/package.json index d25295fe2d97..ce84a75089b3 100644 --- a/packages/ui-contexts/package.json +++ b/packages/ui-contexts/package.json @@ -1,11 +1,11 @@ { "name": "@rocket.chat/ui-contexts", - "version": "1.0.4", + "version": "2.0.0-rc.1", "private": true, "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", @@ -29,6 +29,9 @@ "react": "~17.0.2", "use-sync-external-store": "^1.2.0" }, + "dependencies": { + "@rocket.chat/password-policies": "workspace:^" + }, "volta": { "extends": "../../package.json" }, diff --git a/packages/ui-contexts/src/hooks/usePasswordPolicy.ts b/packages/ui-contexts/src/hooks/usePasswordPolicy.ts deleted file mode 100644 index ca259a215586..000000000000 --- a/packages/ui-contexts/src/hooks/usePasswordPolicy.ts +++ /dev/null @@ -1,9 +0,0 @@ -import { useQuery } from '@tanstack/react-query'; - -import { useEndpoint } from './useEndpoint'; - -export const usePasswordPolicy = () => { - const getPasswordPolicy = useEndpoint('GET', '/v1/pw.getPolicy'); - - return useQuery(['login', 'password-policy'], async () => getPasswordPolicy()); -}; diff --git a/packages/ui-contexts/src/hooks/useVerifyPassword.ts b/packages/ui-contexts/src/hooks/useVerifyPassword.ts index 71985e44887f..f1244b2552c6 100644 --- a/packages/ui-contexts/src/hooks/useVerifyPassword.ts +++ b/packages/ui-contexts/src/hooks/useVerifyPassword.ts @@ -1,69 +1,47 @@ -import { useCallback, useMemo } from 'react'; +import { PasswordPolicy } from '@rocket.chat/password-policies'; +import { useMemo } from 'react'; -import { usePasswordPolicy } from './usePasswordPolicy'; - -export const passwordVerificationsTemplate: Record boolean> = { - 'get-password-policy-minLength': (password: string, minLength?: number) => Boolean(minLength && password.length >= minLength), - 'get-password-policy-maxLength': (password: string, maxLength?: number) => Boolean(maxLength && password.length <= maxLength), - 'get-password-policy-forbidRepeatingCharactersCount': (password: string, maxRepeatingChars?: number) => { - const repeatingCharsHash = {} as Record; - - for (let i = 0; i < password.length; i++) { - const currentChar = password[i]; - - if (repeatingCharsHash[currentChar]) { - repeatingCharsHash[currentChar]++; - if (repeatingCharsHash[currentChar] === maxRepeatingChars) return false; - } else { - repeatingCharsHash[currentChar] = 1; - } - } - - return true; - }, - 'get-password-policy-mustContainAtLeastOneLowercase': (password: string) => /[a-z]/.test(password), - 'get-password-policy-mustContainAtLeastOneUppercase': (password: string) => /[A-Z]/.test(password), - 'get-password-policy-mustContainAtLeastOneNumber': (password: string) => /[0-9]/.test(password), - 'get-password-policy-mustContainAtLeastOneSpecialCharacter': (password: string) => /[^A-Za-z0-9\s]/.test(password), -}; +import { useSetting } from './useSetting'; type PasswordVerifications = { isValid: boolean; limit?: number; name: string }[]; -type PasswordPolicies = [key: string, value?: Record][]; - -export const useVerifyPasswordByPolices = (policies?: PasswordPolicies) => { - return useCallback( - (password: string): PasswordVerifications => { - if (!policies) { - return []; - } - return policies - .map(([name, rules]) => { - if (name === 'get-password-policy-forbidRepeatingCharacters') return; - const limit = rules && Object.values(rules)[0]; - - return { - name, - isValid: password.length !== 0 && passwordVerificationsTemplate[name](password, limit), - ...(limit && { limit }), - }; - }) - .filter(Boolean) as PasswordVerifications; - }, - [policies], +export const useVerifyPassword = (password: string): PasswordVerifications => { + const enabled = Boolean(useSetting('Accounts_Password_Policy_Enabled')); + const minLength = Number(useSetting('Accounts_Password_Policy_MinLength')); + const maxLength = Number(useSetting('Accounts_Password_Policy_MaxLength')); + const forbidRepeatingCharacters = Boolean(useSetting('Accounts_Password_Policy_ForbidRepeatingCharacters')); + const forbidRepeatingCharactersCount = Number(useSetting('Accounts_Password_Policy_ForbidRepeatingCharactersCount')); + const mustContainAtLeastOneLowercase = Boolean(useSetting('Accounts_Password_Policy_AtLeastOneLowercase')); + const mustContainAtLeastOneUppercase = Boolean(useSetting('Accounts_Password_Policy_AtLeastOneUppercase')); + const mustContainAtLeastOneNumber = Boolean(useSetting('Accounts_Password_Policy_AtLeastOneNumber')); + const mustContainAtLeastOneSpecialCharacter = Boolean(useSetting('Accounts_Password_Policy_AtLeastOneSpecialCharacter')); + + const validator = useMemo( + () => + new PasswordPolicy({ + enabled, + minLength, + maxLength, + forbidRepeatingCharacters, + forbidRepeatingCharactersCount, + mustContainAtLeastOneLowercase, + mustContainAtLeastOneUppercase, + mustContainAtLeastOneNumber, + mustContainAtLeastOneSpecialCharacter, + throwError: true, + }), + [ + enabled, + minLength, + maxLength, + forbidRepeatingCharacters, + forbidRepeatingCharactersCount, + mustContainAtLeastOneLowercase, + mustContainAtLeastOneUppercase, + mustContainAtLeastOneNumber, + mustContainAtLeastOneSpecialCharacter, + ], ); -}; - -export const useVerifyPassword = (password: string): { data: PasswordVerifications; isLoading: boolean } => { - const { data, isLoading } = usePasswordPolicy(); - const validator = useVerifyPasswordByPolices((data?.enabled && data?.policy) || undefined); - - return useMemo( - () => ({ - data: validator(password), - isLoading, - }), - [password, validator, isLoading], - ); + return useMemo(() => validator.sendValidationMessage(password || ''), [password, validator]); }; diff --git a/packages/ui-contexts/src/index.ts b/packages/ui-contexts/src/index.ts index fca1dc0e4edb..d404dc921579 100644 --- a/packages/ui-contexts/src/index.ts +++ b/packages/ui-contexts/src/index.ts @@ -80,7 +80,6 @@ export { useUserRoom } from './hooks/useUserRoom'; export { useUserSubscription } from './hooks/useUserSubscription'; export { useUserSubscriptionByName } from './hooks/useUserSubscriptionByName'; export { useUserSubscriptions } from './hooks/useUserSubscriptions'; -export { usePasswordPolicy } from './hooks/usePasswordPolicy'; export { useVerifyPassword } from './hooks/useVerifyPassword'; export { useSelectedDevices } from './hooks/useSelectedDevices'; export { useDeviceConstraints } from './hooks/useDeviceConstraints'; diff --git a/packages/ui-video-conf/CHANGELOG.md b/packages/ui-video-conf/CHANGELOG.md index 114a6fe5d3ca..3d39f00d7673 100644 --- a/packages/ui-video-conf/CHANGELOG.md +++ b/packages/ui-video-conf/CHANGELOG.md @@ -1,5 +1,30 @@ # @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 + +- Updated dependencies [074db3b419] +- Updated dependencies [b8f3d5014f] + - @rocket.chat/ui-contexts@2.0.0-rc.0 +## 1.0.6 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.6 + +## 1.0.5 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.5 + ## 1.0.4 ### Patch Changes diff --git a/packages/ui-video-conf/package.json b/packages/ui-video-conf/package.json index 00106886a26e..91ffd97b27d7 100644 --- a/packages/ui-video-conf/package.json +++ b/packages/ui-video-conf/package.json @@ -1,14 +1,14 @@ { "name": "@rocket.chat/ui-video-conf", - "version": "1.0.4", + "version": "2.0.0-rc.1", "private": true, "devDependencies": { "@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", @@ -35,7 +35,7 @@ "@rocket.chat/fuselage-hooks": "*", "@rocket.chat/icons": "*", "@rocket.chat/styled": "*", - "@rocket.chat/ui-contexts": "1.0.4", + "@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 fd1c5f2f689b..e1a0394597ff 100644 --- a/packages/uikit-playground/CHANGELOG.md +++ b/packages/uikit-playground/CHANGELOG.md @@ -1,5 +1,44 @@ # @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 + +- 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-rc.0 + - @rocket.chat/ui-contexts@2.0.0-rc.0 +## 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 + +- @rocket.chat/ui-contexts@1.0.5 +- @rocket.chat/fuselage-ui-kit@1.0.5 + ## 0.1.4 ### Patch Changes diff --git a/packages/uikit-playground/package.json b/packages/uikit-playground/package.json index 78bbf2fb6a3a..d9b9587f5cf3 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.4", + "version": "0.2.0-rc.1", "type": "module", "scripts": { "dev": "vite", @@ -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/packages/web-ui-registration/CHANGELOG.md b/packages/web-ui-registration/CHANGELOG.md index e89a16f355fb..2a76811d031a 100644 --- a/packages/web-ui-registration/CHANGELOG.md +++ b/packages/web-ui-registration/CHANGELOG.md @@ -1,5 +1,31 @@ # @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 + +- 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-rc.0 +## 1.0.6 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.6 + +## 1.0.5 + +### Patch Changes + +- @rocket.chat/ui-contexts@1.0.5 + ## 1.0.4 ### Patch Changes diff --git a/packages/web-ui-registration/package.json b/packages/web-ui-registration/package.json index f6727baaac37..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": "1.0.4", + "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": "1.0.4", + "@rocket.chat/ui-contexts": "2.0.0-rc.1", "@tanstack/react-query": "*", "react": "*", "react-hook-form": "*", 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') { diff --git a/yarn.lock b/yarn.lock index c598977509bf..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 @@ -8217,31 +8217,31 @@ __metadata: typescript: ~5.2.2 peerDependencies: "@rocket.chat/apps-engine": "*" - "@rocket.chat/eslint-config": "*" + "@rocket.chat/eslint-config": 0.6.0-rc.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": 1.0.4 + "@rocket.chat/ui-contexts": 2.0.0-rc.1 "@rocket.chat/ui-kit": "*" - "@rocket.chat/ui-video-conf": 1.0.4 + "@rocket.chat/ui-video-conf": 2.0.0-rc.1 "@tanstack/react-query": "*" react: "*" react-dom: "*" 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 @@ -8308,14 +8308,14 @@ __metadata: ts-jest: ~29.0.5 typescript: ~5.2.2 peerDependencies: - "@rocket.chat/core-typings": 6.3.4 + "@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": "*" - "@rocket.chat/ui-contexts": "*" + "@rocket.chat/ui-client": 2.0.0-rc.1 + "@rocket.chat/ui-contexts": 2.0.0-rc.1 katex: "*" react: "*" languageName: unknown @@ -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,8 @@ __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:^" "@rocket.chat/presence": "workspace:^" @@ -8603,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:^" @@ -9032,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 @@ -9049,10 +9050,24 @@ __metadata: react: 17.0.2 react-dom: 17.0.2 react-i18next: ~11.15.4 - checksum: 659d97a38b4ce94b18a931087d948fcdc3caf98853d1402eef8867d4f26d8f083f50764b46c6fd18c91f193b6de248d80a3654e8e8a6673ebea3dafd2044b22e + checksum: 362938332de5d865e12b891288e631e579e1f6f0d8da99004d27d1fc5722e25821b68cb60de8cb51cf8768daae0f9bf68cbd374580e8e8bfdb292f8ed6ee8cb1 languageName: node linkType: hard +"@rocket.chat/password-policies@workspace:^, @rocket.chat/password-policies@workspace:packages/password-policies": + version: 0.0.0-use.local + resolution: "@rocket.chat/password-policies@workspace:packages/password-policies" + dependencies: + "@types/chai": ^4.3.5 + "@types/jest": ~29.5.3 + chai: ^4.3.7 + eslint: ~8.45.0 + jest: ~29.6.1 + ts-jest: ~29.0.5 + typescript: ~5.2.2 + languageName: unknown + linkType: soft + "@rocket.chat/pdf-worker@workspace:^, @rocket.chat/pdf-worker@workspace:ee/packages/pdf-worker": version: 0.0.0-use.local resolution: "@rocket.chat/pdf-worker@workspace:ee/packages/pdf-worker" @@ -9239,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 @@ -9339,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: @@ -9348,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 @@ -9368,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" @@ -9398,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 @@ -9438,7 +9453,7 @@ __metadata: "@rocket.chat/fuselage": "*" "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" - "@rocket.chat/ui-contexts": 1.0.4 + "@rocket.chat/ui-contexts": 2.0.0-rc.1 react: ~17.0.2 languageName: unknown linkType: soft @@ -9449,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 @@ -9482,7 +9497,8 @@ __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 "@types/react": ~17.0.62 @@ -9507,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 @@ -9519,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 @@ -9562,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 @@ -9590,7 +9606,7 @@ __metadata: "@rocket.chat/fuselage-hooks": "*" "@rocket.chat/icons": "*" "@rocket.chat/styled": "*" - "@rocket.chat/ui-contexts": 1.0.4 + "@rocket.chat/ui-contexts": 2.0.0-rc.1 react: ^17.0.2 react-dom: ^17.0.2 languageName: unknown @@ -9605,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 @@ -9674,7 +9690,7 @@ __metadata: typescript: ~5.2.2 peerDependencies: "@rocket.chat/layout": "*" - "@rocket.chat/ui-contexts": 1.0.4 + "@rocket.chat/ui-contexts": 2.0.0-rc.1 "@tanstack/react-query": "*" react: "*" react-hook-form: "*" @@ -34229,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