From 0b396dcd3edb958c0385c3a0175a1032b3ccc78c Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 29 Oct 2024 13:28:49 -0300 Subject: [PATCH] chore: minor deps (#33795) --- .github/workflows/ci-test-e2e.yml | 2 +- apps/meteor/.eslintignore | 1 + apps/meteor/.stylelintignore | 1 + apps/meteor/app/api/server/api.ts | 11 +- apps/meteor/app/api/server/definition.ts | 40 +- .../meteor/app/api/server/v1/subscriptions.ts | 2 +- apps/meteor/app/api/server/v1/users.ts | 4 +- .../server/converters/transformMappedData.ts | 4 +- .../supportedVersionsToken.ts | 2 +- .../app/custom-oauth/client/CustomOAuth.ts | 5 +- .../federation/server/functions/helpers.ts | 11 +- .../app/file-upload/server/lib/FileUpload.ts | 2 +- .../importer-slack/server/SlackImporter.ts | 17 +- .../classes/converters/UserConverter.ts | 2 +- .../integrations/server/lib/updateHistory.ts | 2 +- .../incoming/updateIncomingIntegration.ts | 2 +- .../outgoing/updateOutgoingIntegration.ts | 4 +- .../lib/server/functions/closeLivechatRoom.ts | 4 +- .../server/functions/loadMessageHistory.ts | 2 +- .../server/lib/interceptDirectReplyEmails.js | 11 +- .../lib/server/methods/getChannelHistory.ts | 4 +- .../server/hooks/processRoomAbandonment.ts | 2 +- .../app/livechat/server/lib/sendTranscript.ts | 2 +- apps/meteor/app/livechat/server/startup.ts | 2 +- apps/meteor/app/mailer/server/api.ts | 2 +- apps/meteor/app/push/server/push.ts | 4 +- .../app/slackbridge/server/SlackAdapter.js | 2 +- .../app/slashcommands-hide/server/hide.ts | 2 +- .../app/statistics/server/lib/statistics.ts | 3 +- .../app/ui-utils/client/lib/messageBox.ts | 17 +- apps/meteor/app/ui/client/lib/ChatMessages.ts | 2 +- .../functions/normalizeMessageFileUpload.ts | 2 +- .../webdav/server/lib/getWebdavCredentials.ts | 2 +- apps/meteor/app/webrtc/client/WebRTCClass.ts | 6 +- .../UserMenu/hooks/useStatusItems.tsx | 2 +- .../AutoCompleteDepartmentMultiple.tsx | 2 +- .../Contextualbar/ContextualbarContent.tsx | 29 +- .../Contextualbar/ContextualbarFooter.tsx | 29 +- .../Contextualbar/ContextualbarSection.tsx | 29 +- .../components/Header/HeaderToolbarAction.tsx | 29 +- .../client/components/Page/PageHeader.tsx | 2 +- .../RoomAutoComplete/RoomAutoComplete.tsx | 2 +- .../RoomAutoCompleteMultiple.tsx | 2 +- .../ConnectionStatusBar.stories.tsx | 5 +- .../components/message/StatusIndicators.tsx | 2 +- .../message/content/Attachments.tsx | 8 +- .../message/list/MessageListContext.tsx | 11 +- .../message/toolbar/MessageActionMenu.tsx | 25 +- apps/meteor/client/hooks/useEndpointAction.ts | 4 +- .../hooks/useFeaturePreviewEnableQuery.ts | 11 +- .../hooks/useLicenseLimitsByBehavior.ts | 8 +- .../lib/parseMessageTextToAstMarkdown.ts | 6 +- apps/meteor/client/lib/userData.ts | 4 +- apps/meteor/client/lib/utils/renderEmoji.ts | 2 +- apps/meteor/client/lib/voip/VoIPUser.ts | 5 +- .../client/meteorOverrides/login/google.ts | 13 +- .../additionalForms/DepartmentForwarding.tsx | 2 +- .../businessHours/BusinessHoursTable.tsx | 4 +- .../providers/AuthorizationProvider.tsx | 11 +- .../EmojiPickerProvider.tsx | 2 +- .../client/providers/OmnichannelProvider.tsx | 2 +- .../client/providers/SettingsProvider.tsx | 2 +- .../client/providers/TranslationProvider.tsx | 4 +- apps/meteor/client/sidebar/RoomMenu.tsx | 4 +- .../client/sidebar/footer/voip/VoipFooter.tsx | 2 +- .../sidebar/header/hooks/useStatusItems.tsx | 2 +- apps/meteor/client/sidebarv2/RoomMenu.tsx | 2 +- .../sidebarv2/footer/voip/VoipFooter.tsx | 2 +- apps/meteor/client/startup/iframeCommands.ts | 11 +- .../stories/contexts/ModalContextMock.tsx | 2 +- .../stories/contexts/ServerContextMock.tsx | 2 +- .../preferences/PreferencesMyDataSection.tsx | 2 +- .../CustomUserStatusTable.tsx | 4 +- .../channels/useChannelsList.ts | 2 +- .../messages/useMessageOrigins.ts | 2 +- .../messages/useMessagesSent.ts | 2 +- .../messages/useTopFivePopularChannels.ts | 2 +- .../users/useActiveUsers.ts | 2 +- .../users/useHourlyChatActivity.ts | 2 +- .../engagementDashboard/users/useNewUsers.ts | 2 +- .../users/useUsersByTimeOfTheDay.ts | 2 +- .../users/useWeeklyChatActivity.ts | 2 +- .../views/admin/import/ImportHistoryPage.tsx | 4 +- .../admin/import/ImportOperationSummary.tsx | 2 +- .../UsersInRoleTable/UsersInRoleTable.tsx | 4 +- .../client/views/admin/rooms/RoomsTable.tsx | 6 +- .../settings/EditableSettingsProvider.tsx | 6 +- .../users/UsersTable/UsersTableFilters.tsx | 2 +- .../users/hooks/useChangeAdminStatusAction.ts | 2 +- .../users/hooks/useChangeUserStatusAction.ts | 2 +- .../admin/users/hooks/useDeleteUserAction.tsx | 2 +- .../users/hooks/useResetE2EEKeyAction.tsx | 2 +- .../admin/users/hooks/useResetTOTPAction.tsx | 2 +- .../users/hooks/useVoipExtensionAction.tsx | 2 +- .../voip/hooks/useVoipExtensionAction.tsx | 2 +- .../workspace/VersionCard/VersionCard.tsx | 8 +- .../components/forms/DateRangePicker.tsx | 2 +- .../tabs/AppReleases/AppReleases.tsx | 8 +- .../components/ScreenshotCarousel.tsx | 4 +- .../client/views/marketplace/helpers.ts | 8 +- .../views/marketplace/hooks/useAppInfo.ts | 2 +- .../agents/AgentsTable/AgentsTable.tsx | 4 +- .../omnichannel/analytics/AgentOverview.tsx | 6 +- .../omnichannel/directory/calls/CallTable.tsx | 4 +- .../chats/contextualBar/ChatInfo.tsx | 4 +- .../chats/contextualBar/ChatInfoDirectory.tsx | 4 +- .../realTimeMonitoring/counter/CounterRow.tsx | 2 +- .../views/room/Announcement/Announcement.tsx | 2 +- .../QuickActions/hooks/useQuickActions.tsx | 2 +- .../QuickActions/hooks/useQuickActions.tsx | 2 +- .../RoomAnnouncement/RoomAnnouncement.tsx | 2 +- .../hooks/useWebdavActions.tsx | 2 +- .../Info/hooks/useRoomActions.ts | 12 +- .../PruneMessages/PruneMessagesWithData.tsx | 2 +- .../room/contextualBar/Threads/Thread.tsx | 4 +- .../room/contextualBar/Threads/ThreadList.tsx | 2 +- .../VideoConfList/VideoConfList.tsx | 2 +- .../hooks/useVideoConfOpenCall.spec.tsx | 2 +- .../client/views/room/hooks/useDateScroll.ts | 79 +- .../actions/useAddUserAction.tsx | 2 +- .../actions/useBlockUserAction.ts | 2 +- .../actions/useChangeLeaderAction.ts | 2 +- .../actions/useChangeModeratorAction.tsx | 2 +- .../actions/useChangeOwnerAction.tsx | 2 +- .../actions/useDirectMessageAction.ts | 2 +- .../actions/useIgnoreUserAction.ts | 2 +- .../actions/useMuteUserAction.tsx | 2 +- .../actions/useRemoveUserAction.tsx | 2 +- .../actions/useReportUser.tsx | 2 +- .../actions/useVideoCallAction.tsx | 2 +- .../actions/useVoipCallAction.tsx | 2 +- .../room/providers/ComposerPopupProvider.tsx | 2 +- .../TeamAutocomplete/TeamAutocomplete.tsx | 2 +- .../server/lib/canned-responses.js | 2 +- .../server/api/lib/tags.ts | 2 +- .../applySimultaneousChatsRestrictions.ts | 4 +- .../storage/ConfigurableAppSourceStorage.ts | 5 +- .../infrastructure/matrix/Bridge.ts | 5 +- .../local-services/instance/getLogger.ts | 2 +- apps/meteor/ee/server/models/raw/Users.ts | 2 +- apps/meteor/ee/server/services/package.json | 6 +- apps/meteor/lib/utils/generatePath.ts | 8 +- apps/meteor/package.json | 43 +- apps/meteor/playwright.config.ts | 2 +- .../server/features/EmailInbox/EmailInbox.ts | 2 +- .../EmailInbox/EmailInbox_Incoming.ts | 2 +- .../EmailInbox/EmailInbox_Outgoing.ts | 2 +- apps/meteor/server/lib/dataExport/sendFile.ts | 2 +- apps/meteor/server/lib/logger/logPayloads.ts | 4 +- .../lib/moderation/deleteReportedMessages.ts | 17 +- apps/meteor/server/methods/browseChannels.ts | 4 +- apps/meteor/server/models/raw/BaseRaw.ts | 9 +- .../server/models/raw/LivechatVisitors.ts | 4 +- apps/meteor/server/models/raw/Messages.ts | 2 +- .../server/models/raw/ModerationReports.ts | 2 +- apps/meteor/server/models/raw/Rooms.ts | 14 +- .../meteor/server/models/raw/Subscriptions.ts | 15 +- apps/meteor/server/models/raw/Users.js | 8 +- .../server/models/raw/VideoConference.ts | 4 +- .../infrastructure/matrix/Bridge.ts | 9 +- .../matrix/converters/room/RoomReceiver.ts | 12 +- .../infrastructure/matrix/handlers/Room.ts | 5 +- apps/meteor/server/services/team/service.ts | 4 +- apps/meteor/tests/data/permissions.helper.ts | 2 +- apps/meteor/tests/e2e/fixtures/userStates.ts | 2 +- .../e2e/page-objects/omnichannel-livechat.ts | 5 +- .../e2e/page-objects/omnichannel-tags.ts | 4 +- apps/meteor/tests/end-to-end/api/chat.ts | 7 +- apps/meteor/tests/end-to-end/api/users.ts | 2 +- .../server/functions/settings.tests.ts | 43 +- ee/apps/account-service/package.json | 6 +- ee/apps/authorization-service/package.json | 2 +- ee/apps/ddp-streamer/package.json | 5 +- ee/apps/ddp-streamer/src/Client.ts | 6 +- ee/apps/ddp-streamer/src/Publication.ts | 6 +- ee/apps/omnichannel-transcript/package.json | 2 +- ee/apps/presence-service/package.json | 2 +- ee/apps/queue-worker/package.json | 2 +- ee/apps/stream-hub-service/package.json | 2 +- ee/apps/stream-hub-service/src/StreamHub.ts | 5 +- ee/packages/license/package.json | 2 +- ee/packages/license/src/license.ts | 6 +- ee/packages/license/src/v2/convertToV3.ts | 12 +- .../network-broker/src/EnterpriseCheck.ts | 37 +- .../network-broker/src/NetworkBroker.ts | 4 +- ee/packages/network-broker/src/index.ts | 2 +- .../omnichannel-services/src/QueueWorker.ts | 5 +- ee/packages/pdf-worker/package.json | 6 +- .../src/strategies/ChatTranscript.ts | 2 +- ee/packages/presence/package.json | 8 +- package.json | 4 +- packages/api-client/src/index.ts | 2 +- packages/apps-engine/package.json | 2 +- .../src/client/AppClientManager.ts | 5 +- packages/apps-engine/src/definition/App.ts | 6 +- .../metadata/RocketChatAssociations.ts | 5 +- .../slashcommands/SlashCommandContext.ts | 8 +- packages/apps-engine/src/server/ProxiedApp.ts | 6 +- .../src/server/accessors/ApiExtend.ts | 5 +- .../src/server/accessors/AppAccessors.ts | 5 +- .../server/accessors/CloudWorkspaceRead.ts | 5 +- .../src/server/accessors/EmailCreator.ts | 5 +- .../src/server/accessors/EnvironmentWrite.ts | 5 +- .../accessors/EnvironmentalVariableRead.ts | 5 +- .../accessors/ExternalComponentsExtend.ts | 5 +- .../src/server/accessors/LivechatCreator.ts | 5 +- .../src/server/accessors/LivechatRead.ts | 5 +- .../src/server/accessors/LivechatUpdater.ts | 5 +- .../src/server/accessors/MessageRead.ts | 5 +- .../src/server/accessors/ModerationModify.ts | 5 +- .../src/server/accessors/Modify.ts | 5 +- .../src/server/accessors/ModifyCreator.ts | 5 +- .../src/server/accessors/ModifyDeleter.ts | 5 +- .../src/server/accessors/ModifyExtender.ts | 5 +- .../src/server/accessors/ModifyUpdater.ts | 5 +- .../src/server/accessors/Notifier.ts | 6 +- .../src/server/accessors/OAuthAppsModify.ts | 5 +- .../src/server/accessors/OAuthAppsReader.ts | 5 +- .../src/server/accessors/Persistence.ts | 5 +- .../src/server/accessors/PersistenceRead.ts | 5 +- .../src/server/accessors/RoleRead.ts | 5 +- .../src/server/accessors/RoomRead.ts | 5 +- .../src/server/accessors/SchedulerExtend.ts | 5 +- .../src/server/accessors/SchedulerModify.ts | 5 +- .../src/server/accessors/ServerSettingRead.ts | 5 +- .../server/accessors/ServerSettingUpdater.ts | 5 +- .../server/accessors/ServerSettingsModify.ts | 5 +- .../src/server/accessors/SettingUpdater.ts | 5 +- .../server/accessors/SlashCommandsExtend.ts | 5 +- .../server/accessors/SlashCommandsModify.ts | 5 +- .../src/server/accessors/ThreadRead.ts | 5 +- .../src/server/accessors/UIController.ts | 5 +- .../src/server/accessors/UIExtend.ts | 5 +- .../src/server/accessors/UploadCreator.ts | 5 +- .../src/server/accessors/UploadRead.ts | 5 +- .../src/server/accessors/UserRead.ts | 5 +- .../src/server/accessors/UserUpdater.ts | 5 +- .../accessors/VideoConfProviderExtend.ts | 5 +- .../server/accessors/VideoConferenceRead.ts | 5 +- .../apps-engine/src/server/managers/AppApi.ts | 6 +- .../src/server/managers/AppSlashCommand.ts | 5 +- .../server/managers/AppVideoConfProvider.ts | 5 +- .../src/server/messages/Message.ts | 5 +- .../src/server/oauth2/OAuth2Client.ts | 5 +- .../server/runtime/AppsEngineNodeRuntime.ts | 5 +- .../runtime/deno/AppsEngineDenoRuntime.ts | 5 +- packages/base64/package.json | 4 +- packages/core-services/package.json | 10 +- packages/core-services/src/MeteorError.ts | 6 +- packages/core-services/src/lib/proxify.ts | 4 +- packages/core-typings/package.json | 2 +- packages/core-typings/src/Serialized.ts | 27 +- packages/core-typings/src/utils.ts | 10 +- packages/ddp-client/src/ClientStream.ts | 5 +- packages/ddp-client/src/MinimalDDPClient.ts | 6 +- packages/ddp-client/src/TimeoutControl.ts | 5 +- .../src/legacy/RocketchatSDKLegacy.ts | 4 +- .../src/livechat/types/LivechatSDK.ts | 19 +- packages/ddp-client/src/types/streams.ts | 20 +- packages/eslint-config/package.json | 8 +- .../.storybook/DocsContainer.tsx | 2 +- packages/fuselage-ui-kit/package.json | 20 +- .../src/blocks/ActionsBlock.tsx | 8 +- .../src/blocks/CalloutBlock.tsx | 2 +- .../src/blocks/ContextBlock.tsx | 2 +- .../fuselage-ui-kit/src/blocks/ImageBlock.tsx | 2 +- .../fuselage-ui-kit/src/blocks/InputBlock.tsx | 6 +- .../src/blocks/PreviewBlock.tsx | 8 +- .../src/blocks/SectionBlock.tsx | 4 +- .../src/blocks/TabNavigationBlock.tsx | 2 +- .../VideoConferenceBlock.tsx | 6 +- .../hooks/useVideoConfData.ts | 2 +- .../hooks/useVideoConfDataStream.ts | 2 +- .../src/contexts/UiKitContext.ts | 4 +- .../ChannelsSelectElement.spec.tsx | 2 +- .../ChannelsSelectElement.tsx | 2 +- .../MultiChannelsSelectElement.spec.tsx | 2 +- .../MultiChannelsSelectElement.tsx | 2 +- .../hooks/useChannelsData.ts | 8 +- .../src/elements/CheckboxElement.tsx | 2 +- .../ContextElement/ContextElementItem.tsx | 2 +- .../src/elements/LinearScaleElement.tsx | 12 +- .../src/elements/MultiStaticSelectElement.tsx | 4 +- .../src/elements/OverflowElement.tsx | 6 +- .../src/elements/RadioButtonElement.tsx | 2 +- .../src/elements/StaticSelectElement.tsx | 4 +- .../src/elements/ToggleSwitchElement.tsx | 2 +- .../MultiUsersSelectElement.spec.tsx | 2 +- .../MultiUsersSelectElement.tsx | 2 +- .../UserSelectElement.spec.tsx | 2 +- .../UsersSelectElement/UsersSelectElement.tsx | 2 +- .../UsersSelectElement/hooks/useUsersData.ts | 4 +- .../src/hooks/useAppTranslation.spec.tsx | 2 +- .../src/hooks/useStringFromTextObject.ts | 2 +- .../src/hooks/useUiKitState.ts | 24 +- .../src/stories/Banner.stories.tsx | 30 +- .../src/stories/Message.stories.tsx | 24 +- .../src/stories/Modal.stories.tsx | 30 +- .../surfaces/ContextualBarSurfaceRenderer.tsx | 2 +- .../FuselageMessageSurfaceRenderer.tsx | 2 +- .../src/surfaces/FuselageSurfaceRenderer.tsx | 60 +- .../src/surfaces/createSurfaceRenderer.tsx | 6 +- .../fuselage-ui-kit/src/surfaces/index.ts | 4 +- .../utils/extractInitialStateFromLayout.ts | 4 +- .../src/utils/getInitialValue.ts | 10 +- .../fuselage-ui-kit/src/utils/hasElement.ts | 2 +- .../fuselage-ui-kit/src/utils/hasElements.ts | 2 +- packages/gazzodown/package.json | 18 +- packages/instance-status/package.json | 2 +- packages/jest-presets/package.json | 2 +- packages/livechat/.storybook/helpers.tsx | 2 +- packages/livechat/package.json | 18 +- .../components/Form/CustomFields/index.tsx | 2 +- packages/livechat/src/helpers/formatAgent.ts | 2 +- .../providers/ConnectionStatusProvider.tsx | 2 +- .../livechat/src/routes/Chat/connector.tsx | 2 +- packages/logger/src/getPino.ts | 2 +- packages/message-parser/package.json | 8 +- packages/message-parser/src/guards.ts | 2 +- packages/message-parser/src/utils.ts | 41 +- packages/message-parser/tests/abuse.test.ts | 26 +- packages/message-parser/tests/katex.test.ts | 2 +- packages/message-parser/tests/link.test.ts | 46 +- packages/message-parser/tests/tasks.test.ts | 6 +- packages/message-parser/tests/url.test.ts | 26 +- packages/mock-providers/package.json | 2 +- .../src/MockedAppRootBuilder.tsx | 2 +- .../model-typings/src/models/IBaseModel.ts | 4 +- packages/peggy-loader/package.json | 2 +- packages/peggy-loader/src/index.ts | 23 +- packages/random/package.json | 4 +- packages/release-action/package.json | 2 +- .../src/helpers/ReplacePlaceholders.ts | 8 +- packages/rest-typings/src/index.ts | 14 +- packages/sha256/package.json | 4 +- packages/tracing/package.json | 2 +- packages/ui-avatar/package.json | 4 +- packages/ui-client/package.json | 18 +- .../EmojiPicker/EmojiPickerContainer.tsx | 35 +- packages/ui-composer/package.json | 14 +- .../MessageFooterCalloutAction.tsx | 11 +- .../src/hooks/useCurrentRoutePath.ts | 2 +- packages/ui-contexts/src/hooks/useEndpoint.ts | 10 +- packages/ui-kit/package.json | 12 +- packages/ui-kit/src/rendering/ActionOf.ts | 64 +- packages/ui-video-conf/package.json | 16 +- packages/ui-voip/package.json | 16 +- packages/web-ui-registration/package.json | 20 +- yarn.lock | 3591 +++++++++-------- 349 files changed, 3150 insertions(+), 2798 deletions(-) diff --git a/.github/workflows/ci-test-e2e.yml b/.github/workflows/ci-test-e2e.yml index 0de23fb966b5..d62148434f95 100644 --- a/.github/workflows/ci-test-e2e.yml +++ b/.github/workflows/ci-test-e2e.yml @@ -210,7 +210,7 @@ jobs: path: | ~/.cache/ms-playwright # This is the version of Playwright that we are using, if you are willing to upgrade, you should update this. - key: playwright-1.40.1 + key: playwright-1.48.2 - name: Install Playwright if: inputs.type == 'ui' && steps.cache-playwright.outputs.cache-hit != 'true' diff --git a/apps/meteor/.eslintignore b/apps/meteor/.eslintignore index 3ff422a3ed3f..9f66dc806f8b 100644 --- a/apps/meteor/.eslintignore +++ b/apps/meteor/.eslintignore @@ -12,3 +12,4 @@ !/.storybook/ !/client/.eslintrc.js !/ee/client/.eslintrc.js +/storybook-static/ diff --git a/apps/meteor/.stylelintignore b/apps/meteor/.stylelintignore index 4bd9c6d458d6..33637d3dd3e7 100644 --- a/apps/meteor/.stylelintignore +++ b/apps/meteor/.stylelintignore @@ -1,3 +1,4 @@ app/theme/client/vendor/fontello/css/fontello.css app/meteor-autocomplete/client/autocomplete.css app/emoji-emojione/client/*.css +storybook-static diff --git a/apps/meteor/app/api/server/api.ts b/apps/meteor/app/api/server/api.ts index 7bb7f5af28ba..57be4f294d9b 100644 --- a/apps/meteor/app/api/server/api.ts +++ b/apps/meteor/app/api/server/api.ts @@ -189,10 +189,13 @@ export class APIClass extends Restivus { } public setLimitedCustomFields(customFields: string[]): void { - const nonPublicFieds = customFields.reduce((acc, customField) => { - acc[`customFields.${customField}`] = 0; - return acc; - }, {} as Record); + const nonPublicFieds = customFields.reduce( + (acc, customField) => { + acc[`customFields.${customField}`] = 0; + return acc; + }, + {} as Record, + ); this.limitedUserFieldsToExclude = { ...this.defaultLimitedUserFieldsToExclude, ...nonPublicFieds, diff --git a/apps/meteor/app/api/server/definition.ts b/apps/meteor/app/api/server/definition.ts index acace73a8226..c15e0bc10d98 100644 --- a/apps/meteor/app/api/server/definition.ts +++ b/apps/meteor/app/api/server/definition.ts @@ -22,7 +22,7 @@ export type FailureResult } ? T : TOptions extends { validateParams: { GET: ValidateFunction } } - ? T - : Partial> & { offset?: number; count?: number } + ? T + : Partial> & { offset?: number; count?: number } : Record; // TODO make it unsafe readonly bodyParams: TMethod extends 'GET' ? Record : TOptions extends { validateParams: ValidateFunction } - ? T - : TOptions extends { validateParams: infer V } - ? V extends { [key in TMethod]: ValidateFunction } ? T - : Partial> - : // TODO remove the extra (optionals) params when all the endpoints that use these are typed correctly - Partial>; + : TOptions extends { validateParams: infer V } + ? V extends { [key in TMethod]: ValidateFunction } + ? T + : Partial> + : // TODO remove the extra (optionals) params when all the endpoints that use these are typed correctly + Partial>; readonly request: Request; readonly queryOperations: TOptions extends { queryOperations: infer T } ? T : never; @@ -163,18 +163,18 @@ export type ActionThis = | SuccessResult> diff --git a/apps/meteor/app/api/server/v1/subscriptions.ts b/apps/meteor/app/api/server/v1/subscriptions.ts index b92d9ba572fd..be0aaea4b4e1 100644 --- a/apps/meteor/app/api/server/v1/subscriptions.ts +++ b/apps/meteor/app/api/server/v1/subscriptions.ts @@ -35,7 +35,7 @@ API.v1.addRoute( ? { update: result, remove: [], - } + } : result, ); }, diff --git a/apps/meteor/app/api/server/v1/users.ts b/apps/meteor/app/api/server/v1/users.ts index b7187ec8cd81..1dcbd3ab3c78 100644 --- a/apps/meteor/app/api/server/v1/users.ts +++ b/apps/meteor/app/api/server/v1/users.ts @@ -155,7 +155,7 @@ API.v1.addRoute( : { twoFactorCode: userData.typedPassword, twoFactorMethod: 'password', - }; + }; await Meteor.callAsync('saveUserProfile', userData, this.bodyParams.customFields, twoFactorOptions); @@ -512,7 +512,7 @@ API.v1.addRoute( { $limit: count, }, - ] + ] : []; const result = await Users.col diff --git a/apps/meteor/app/apps/server/converters/transformMappedData.ts b/apps/meteor/app/apps/server/converters/transformMappedData.ts index df2f16138d73..3fcd4db482a7 100644 --- a/apps/meteor/app/apps/server/converters/transformMappedData.ts +++ b/apps/meteor/app/apps/server/converters/transformMappedData.ts @@ -67,8 +67,8 @@ export const transformMappedData = async < -readonly [p in keyof MapType]: MapType[p] extends keyof DataType ? DataType[MapType[p]] : MapType[p] extends (...args: any[]) => any - ? Awaited> - : never; + ? Awaited> + : never; }, DataType extends Record, MapType extends { [p in string]: string | ((data: DataType) => Promise) | ((data: DataType) => unknown) }, diff --git a/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts index f4334bd04d64..68e38baf5cc2 100644 --- a/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts +++ b/apps/meteor/app/cloud/server/functions/supportedVersionsToken/supportedVersionsToken.ts @@ -34,7 +34,7 @@ export const wrapPromise = ( } > => promise - .then((result) => ({ success: true, result } as const)) + .then((result) => ({ success: true, result }) as const) .catch((error) => ({ success: false, error, diff --git a/apps/meteor/app/custom-oauth/client/CustomOAuth.ts b/apps/meteor/app/custom-oauth/client/CustomOAuth.ts index 1d57d1969d93..7849498fa4b9 100644 --- a/apps/meteor/app/custom-oauth/client/CustomOAuth.ts +++ b/apps/meteor/app/custom-oauth/client/CustomOAuth.ts @@ -27,7 +27,10 @@ export class CustomOAuth implements IOAuthProvider { public responseType: string; - constructor(public readonly name: string, options: OauthConfig) { + constructor( + public readonly name: string, + options: OauthConfig, + ) { this.name = name; if (!Match.test(this.name, String)) { throw new Meteor.Error('CustomOAuth: Name is required and must be String'); diff --git a/apps/meteor/app/federation/server/functions/helpers.ts b/apps/meteor/app/federation/server/functions/helpers.ts index c684b7b8f74a..54df33cdfa2d 100644 --- a/apps/meteor/app/federation/server/functions/helpers.ts +++ b/apps/meteor/app/federation/server/functions/helpers.ts @@ -57,10 +57,13 @@ export const getFederatedRoomData = async ( // Find all subscriptions of this room const s = await Subscriptions.findByRoomIdWhenUsernameExists(room._id).toArray(); - const subscriptions = s.reduce((acc, s) => { - acc[s.u._id] = s; - return acc; - }, {} as { [k: string]: ISubscription }); + const subscriptions = s.reduce( + (acc, s) => { + acc[s.u._id] = s; + return acc; + }, + {} as { [k: string]: ISubscription }, + ); // Get all user ids const userIds = Object.keys(subscriptions); diff --git a/apps/meteor/app/file-upload/server/lib/FileUpload.ts b/apps/meteor/app/file-upload/server/lib/FileUpload.ts index ac97923be41e..c7b82fe3e02c 100644 --- a/apps/meteor/app/file-upload/server/lib/FileUpload.ts +++ b/apps/meteor/app/file-upload/server/lib/FileUpload.ts @@ -384,7 +384,7 @@ export const FileUpload = { ? { width, height, - } + } : undefined, }; diff --git a/apps/meteor/app/importer-slack/server/SlackImporter.ts b/apps/meteor/app/importer-slack/server/SlackImporter.ts index 344db6656531..59c07d26e969 100644 --- a/apps/meteor/app/importer-slack/server/SlackImporter.ts +++ b/apps/meteor/app/importer-slack/server/SlackImporter.ts @@ -545,13 +545,16 @@ export class SlackImporter extends Importer { // Process the reactions if (message.reactions && message.reactions.length > 0) { - newMessage.reactions = message.reactions.reduce((newReactions, reaction) => { - const name = `:${reaction.name}:`; - return { - ...newReactions, - ...(reaction.users?.length ? { name: { name, users: this._replaceSlackUserIds(reaction.users) } } : {}), - }; - }, {} as Required['reactions']); + newMessage.reactions = message.reactions.reduce( + (newReactions, reaction) => { + const name = `:${reaction.name}:`; + return { + ...newReactions, + ...(reaction.users?.length ? { name: { name, users: this._replaceSlackUserIds(reaction.users) } } : {}), + }; + }, + {} as Required['reactions'], + ); } if (message.type === 'message') { diff --git a/apps/meteor/app/importer/server/classes/converters/UserConverter.ts b/apps/meteor/app/importer/server/classes/converters/UserConverter.ts index 2d2bb7bad80a..52716dabef5a 100644 --- a/apps/meteor/app/importer/server/classes/converters/UserConverter.ts +++ b/apps/meteor/app/importer/server/classes/converters/UserConverter.ts @@ -376,7 +376,7 @@ export class UserConverter extends RecordConverter({ script: integration.script, scriptEnabled: integration.scriptEnabled, scriptEngine, - }), + }), ...(typeof integration.overrideDestinationChannelEnabled !== 'undefined' && { overrideDestinationChannelEnabled: integration.overrideDestinationChannelEnabled, }), diff --git a/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts b/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts index 4449902437c9..6ee39d81a588 100644 --- a/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts +++ b/apps/meteor/app/integrations/server/methods/outgoing/updateOutgoingIntegration.ts @@ -91,7 +91,7 @@ Meteor.methods({ scriptEnabled: integration.scriptEnabled, scriptEngine, ...(integration.scriptCompiled ? { scriptCompiled: integration.scriptCompiled } : { scriptError: integration.scriptError }), - }), + }), triggerWords: integration.triggerWords, retryFailedCalls: integration.retryFailedCalls, retryCount: integration.retryCount, @@ -107,7 +107,7 @@ Meteor.methods({ $unset: { ...(integration.scriptCompiled ? { scriptError: 1 as const } : { scriptCompiled: 1 as const }), }, - }), + }), }, ); diff --git a/apps/meteor/app/lib/server/functions/closeLivechatRoom.ts b/apps/meteor/app/lib/server/functions/closeLivechatRoom.ts index 2ba29ecd32d2..1e7672005867 100644 --- a/apps/meteor/app/lib/server/functions/closeLivechatRoom.ts +++ b/apps/meteor/app/lib/server/functions/closeLivechatRoom.ts @@ -67,12 +67,12 @@ export const closeLivechatRoom = async ( requestedBy: user, }, }, - } + } : { emailTranscript: { sendToVisitor: false, }, - }), + }), }), }; diff --git a/apps/meteor/app/lib/server/functions/loadMessageHistory.ts b/apps/meteor/app/lib/server/functions/loadMessageHistory.ts index fee7061cae96..5addbd896889 100644 --- a/apps/meteor/app/lib/server/functions/loadMessageHistory.ts +++ b/apps/meteor/app/lib/server/functions/loadMessageHistory.ts @@ -49,7 +49,7 @@ export async function loadMessageHistory({ hiddenMessageTypes, options, showThreadMessages, - ).toArray() + ).toArray() : await Messages.findVisibleByRoomIdNotContainingTypes(rid, hiddenMessageTypes, options, showThreadMessages).toArray(); const messages = await normalizeMessagesForUser(records, userId); let unreadNotLoaded = 0; diff --git a/apps/meteor/app/lib/server/lib/interceptDirectReplyEmails.js b/apps/meteor/app/lib/server/lib/interceptDirectReplyEmails.js index f9af0911bcc6..075dd055cad0 100644 --- a/apps/meteor/app/lib/server/lib/interceptDirectReplyEmails.js +++ b/apps/meteor/app/lib/server/lib/interceptDirectReplyEmails.js @@ -127,10 +127,13 @@ export class POP3Helper { start() { this.log('POP3 started'); - this.running = setInterval(() => { - // get new emails and process - this.POP3 = new POP3Intercepter(); - }, Math.max(this.frequency * 60 * 1000, 2 * 60 * 1000)); + this.running = setInterval( + () => { + // get new emails and process + this.POP3 = new POP3Intercepter(); + }, + Math.max(this.frequency * 60 * 1000, 2 * 60 * 1000), + ); } log(...args) { diff --git a/apps/meteor/app/lib/server/methods/getChannelHistory.ts b/apps/meteor/app/lib/server/methods/getChannelHistory.ts index 8f1f4c586141..5fcdc09e0eeb 100644 --- a/apps/meteor/app/lib/server/methods/getChannelHistory.ts +++ b/apps/meteor/app/lib/server/methods/getChannelHistory.ts @@ -89,7 +89,7 @@ Meteor.methods({ options, showThreadMessages, inclusive, - ).toArray() + ).toArray() : await Messages.findVisibleByRoomIdBetweenTimestampsNotContainingTypes( rid, oldest, @@ -98,7 +98,7 @@ Meteor.methods({ options, showThreadMessages, inclusive, - ).toArray(); + ).toArray(); const messages = await normalizeMessagesForUser(records, fromUserId); diff --git a/apps/meteor/app/livechat/server/hooks/processRoomAbandonment.ts b/apps/meteor/app/livechat/server/hooks/processRoomAbandonment.ts index 2c718c058b00..752bce901d31 100644 --- a/apps/meteor/app/livechat/server/hooks/processRoomAbandonment.ts +++ b/apps/meteor/app/livechat/server/hooks/processRoomAbandonment.ts @@ -31,7 +31,7 @@ export const getSecondsSinceLastAgentResponse = async (room: IOmnichannelRoom, a const department = room.departmentId ? await LivechatDepartment.findOneById>(room.departmentId, { projection: { businessHourId: 1 }, - }) + }) : null; if (department?.businessHourId) { const businessHour = await LivechatBusinessHours.findOneById(department.businessHourId); diff --git a/apps/meteor/app/livechat/server/lib/sendTranscript.ts b/apps/meteor/app/livechat/server/lib/sendTranscript.ts index bc7c06e0eaae..e701e8f5b863 100644 --- a/apps/meteor/app/livechat/server/lib/sendTranscript.ts +++ b/apps/meteor/app/livechat/server/lib/sendTranscript.ts @@ -108,7 +108,7 @@ export async function sendTranscript({ messageType.data ? { ...messageType.data(message), interpolation: { escapeValue: false } } : { interpolation: { escapeValue: false } }, - )}` + )}` : message.msg; let filesHTML = ''; diff --git a/apps/meteor/app/livechat/server/startup.ts b/apps/meteor/app/livechat/server/startup.ts index 994dcd64f52a..e546e6967569 100644 --- a/apps/meteor/app/livechat/server/startup.ts +++ b/apps/meteor/app/livechat/server/startup.ts @@ -77,7 +77,7 @@ Meteor.startup(async () => { process.env.TEST_MODE === 'true' ? { debounce: 10, - } + } : undefined, ); diff --git a/apps/meteor/app/mailer/server/api.ts b/apps/meteor/app/mailer/server/api.ts index 7e0ad0380b11..a7577af5843f 100644 --- a/apps/meteor/app/mailer/server/api.ts +++ b/apps/meteor/app/mailer/server/api.ts @@ -44,7 +44,7 @@ export const replace = (str: string, data: { [key: string]: unknown } = {}): str ? { fname: strLeft(String(data.name), ' '), lname: strRightBack(String(data.name), ' '), - } + } : {}), ...data, }; diff --git a/apps/meteor/app/push/server/push.ts b/apps/meteor/app/push/server/push.ts index 760fbea7c232..6c724b45282f 100644 --- a/apps/meteor/app/push/server/push.ts +++ b/apps/meteor/app/push/server/push.ts @@ -484,14 +484,14 @@ class PushClass { apn: { ...pick(options.apn, 'category'), }, - } + } : {}), ...(this.hasGcmOptions(options) ? { gcm: { ...pick(options.gcm, 'image', 'style'), }, - } + } : {}), }; diff --git a/apps/meteor/app/slackbridge/server/SlackAdapter.js b/apps/meteor/app/slackbridge/server/SlackAdapter.js index 0263d5369a4c..31cbff69463d 100644 --- a/apps/meteor/app/slackbridge/server/SlackAdapter.js +++ b/apps/meteor/app/slackbridge/server/SlackAdapter.js @@ -987,7 +987,7 @@ export default class SlackAdapter { const rocketChannel = await this.rocket.getChannel(slackMessage); const rocketUser = slackMessage.previous_message.user ? (await this.rocket.findUser(slackMessage.previous_message.user)) || - (await this.rocket.addUser(slackMessage.previous_message.user)) + (await this.rocket.addUser(slackMessage.previous_message.user)) : null; const rocketMsgObj = { diff --git a/apps/meteor/app/slashcommands-hide/server/hide.ts b/apps/meteor/app/slashcommands-hide/server/hide.ts index bc614b95e8ed..636974297914 100644 --- a/apps/meteor/app/slashcommands-hide/server/hide.ts +++ b/apps/meteor/app/slashcommands-hide/server/hide.ts @@ -41,7 +41,7 @@ slashCommands.add({ : await Rooms.findOne({ t: 'd', usernames: { $all: [user.username, strippedRoom] }, - }); + }); if (!roomObject) { void api.broadcast('notify.ephemeralMessage', user._id, message.rid, { msg: i18n.t('Channel_doesnt_exist', { diff --git a/apps/meteor/app/statistics/server/lib/statistics.ts b/apps/meteor/app/statistics/server/lib/statistics.ts index 9ca39d2e9d5f..65b363cad125 100644 --- a/apps/meteor/app/statistics/server/lib/statistics.ts +++ b/apps/meteor/app/statistics/server/lib/statistics.ts @@ -326,8 +326,7 @@ export const statistics = { room: IRoom, ) { return num + (room.prid ? room.msgs : 0); - }, - 0); + }, 0); statistics.totalPrivateGroupMessages = (await privateGroups.reduce(function _countPrivateGroupMessages(num: number, room: IRoom) { return num + room.msgs; diff --git a/apps/meteor/app/ui-utils/client/lib/messageBox.ts b/apps/meteor/app/ui-utils/client/lib/messageBox.ts index 3418adef1c1c..9dd26f64c8e0 100644 --- a/apps/meteor/app/ui-utils/client/lib/messageBox.ts +++ b/apps/meteor/app/ui-utils/client/lib/messageBox.ts @@ -48,13 +48,16 @@ class MessageBoxActions { get(group?: TranslationKey) { if (!group) { - return [...this.actions.entries()].reduce>((ret, [group, actions]) => { - const filteredActions = actions.filter((action) => !action.condition || action.condition()); - if (filteredActions.length) { - ret[group] = filteredActions; - } - return ret; - }, {} as Record); + return [...this.actions.entries()].reduce>( + (ret, [group, actions]) => { + const filteredActions = actions.filter((action) => !action.condition || action.condition()); + if (filteredActions.length) { + ret[group] = filteredActions; + } + return ret; + }, + {} as Record, + ); } return this.actions.get(group)?.filter((action) => !action.condition || action.condition()); diff --git a/apps/meteor/app/ui/client/lib/ChatMessages.ts b/apps/meteor/app/ui/client/lib/ChatMessages.ts index 5d78fd1e1d98..681d93aab82c 100644 --- a/apps/meteor/app/ui/client/lib/ChatMessages.ts +++ b/apps/meteor/app/ui/client/lib/ChatMessages.ts @@ -24,7 +24,7 @@ type DeepWritable = T extends (...args: any) => any ? T : { -readonly [P in keyof T]: DeepWritable; - }; + }; export class ChatMessages implements ChatAPI { public uid: string | null; diff --git a/apps/meteor/app/utils/server/functions/normalizeMessageFileUpload.ts b/apps/meteor/app/utils/server/functions/normalizeMessageFileUpload.ts index 097bbc4e9eb8..173592a98276 100644 --- a/apps/meteor/app/utils/server/functions/normalizeMessageFileUpload.ts +++ b/apps/meteor/app/utils/server/functions/normalizeMessageFileUpload.ts @@ -20,7 +20,7 @@ export const normalizeMessageFileUpload = async (message: Omit { ), }, - ] + ] : []), ...(statuses ?? []), { id: 'custom-status', icon: 'emoji', content: t('Custom_Status'), onClick: handleCustomStatus, disabled: presenceDisabled }, diff --git a/apps/meteor/client/components/AutoCompleteDepartmentMultiple.tsx b/apps/meteor/client/components/AutoCompleteDepartmentMultiple.tsx index c15d480f3900..80aa3f2a4745 100644 --- a/apps/meteor/client/components/AutoCompleteDepartmentMultiple.tsx +++ b/apps/meteor/client/components/AutoCompleteDepartmentMultiple.tsx @@ -63,7 +63,7 @@ const AutoCompleteDepartmentMultiple = ({ return; } return loadMoreDepartments(start, Math.min(50, departmentsTotal)); - } + } } renderItem={({ label, ...props }) => ( >(function ContextualbarContent( - props, - ref, -) { - return ( - - - - - - - - - ); -}); +const ContextualbarContent = forwardRef>( + function ContextualbarContent(props, ref) { + return ( + + + + + + + + + ); + }, +); export default memo(ContextualbarContent); diff --git a/apps/meteor/client/components/Contextualbar/ContextualbarFooter.tsx b/apps/meteor/client/components/Contextualbar/ContextualbarFooter.tsx index 481823a1a13f..c0e0d5304567 100644 --- a/apps/meteor/client/components/Contextualbar/ContextualbarFooter.tsx +++ b/apps/meteor/client/components/Contextualbar/ContextualbarFooter.tsx @@ -3,20 +3,19 @@ import { FeaturePreview, FeaturePreviewOff, FeaturePreviewOn } from '@rocket.cha import type { ComponentProps } from 'react'; import React, { forwardRef, memo } from 'react'; -const ContextualbarFooter = forwardRef>(function ContextualbarFooter( - props, - ref, -) { - return ( - - - - - - - - - ); -}); +const ContextualbarFooter = forwardRef>( + function ContextualbarFooter(props, ref) { + return ( + + + + + + + + + ); + }, +); export default memo(ContextualbarFooter); diff --git a/apps/meteor/client/components/Contextualbar/ContextualbarSection.tsx b/apps/meteor/client/components/Contextualbar/ContextualbarSection.tsx index 53ee192f5416..d6ab9ac12e27 100644 --- a/apps/meteor/client/components/Contextualbar/ContextualbarSection.tsx +++ b/apps/meteor/client/components/Contextualbar/ContextualbarSection.tsx @@ -3,20 +3,19 @@ import { FeaturePreview, FeaturePreviewOff, FeaturePreviewOn } from '@rocket.cha import type { ComponentProps } from 'react'; import React, { forwardRef, memo } from 'react'; -const ContextualbarSection = forwardRef>(function ContextualbarSection( - props, - ref, -) { - return ( - - - - - - - - - ); -}); +const ContextualbarSection = forwardRef>( + function ContextualbarSection(props, ref) { + return ( + + + + + + + + + ); + }, +); export default memo(ContextualbarSection); diff --git a/apps/meteor/client/components/Header/HeaderToolbarAction.tsx b/apps/meteor/client/components/Header/HeaderToolbarAction.tsx index bbf296ff23e1..720102b17574 100644 --- a/apps/meteor/client/components/Header/HeaderToolbarAction.tsx +++ b/apps/meteor/client/components/Header/HeaderToolbarAction.tsx @@ -8,20 +8,19 @@ import { import type { ComponentProps } from 'react'; import React, { forwardRef, memo } from 'react'; -const HeaderToolbarAction = forwardRef>(function HeaderToolbarAction( - props, - ref, -) { - return ( - - - - - - - - - ); -}); +const HeaderToolbarAction = forwardRef>( + function HeaderToolbarAction(props, ref) { + return ( + + + + + + + + + ); + }, +); export default memo(HeaderToolbarAction); diff --git a/apps/meteor/client/components/Page/PageHeader.tsx b/apps/meteor/client/components/Page/PageHeader.tsx index 3db5a884ecc0..c2642177b869 100644 --- a/apps/meteor/client/components/Page/PageHeader.tsx +++ b/apps/meteor/client/components/Page/PageHeader.tsx @@ -27,7 +27,7 @@ const PageHeader = ({ children = undefined, title, onClickBack, borderBlockEndCo is='header' borderBlockEndWidth='default' pb={8} - borderBlockEndColor={borderBlockEndColor ?? border ? 'extra-light' : 'transparent'} + borderBlockEndColor={(borderBlockEndColor ?? border) ? 'extra-light' : 'transparent'} {...props} > ({ value: _id, label: { name: fname || name, avatarETag, type: t, encrypted }, - })) + })) : [], [result.data?.items, result.isSuccess], ); diff --git a/apps/meteor/client/components/RoomAutoCompleteMultiple/RoomAutoCompleteMultiple.tsx b/apps/meteor/client/components/RoomAutoCompleteMultiple/RoomAutoCompleteMultiple.tsx index 49006e025111..8fb1af477df6 100644 --- a/apps/meteor/client/components/RoomAutoCompleteMultiple/RoomAutoCompleteMultiple.tsx +++ b/apps/meteor/client/components/RoomAutoCompleteMultiple/RoomAutoCompleteMultiple.tsx @@ -31,7 +31,7 @@ const RoomAutoCompleteMultiple = ({ value, onChange, ...props }: RoomAutoComplet ? result.data.items.map(({ fname, name, _id, avatarETag, t }) => ({ value: _id, label: { name: fname || name, avatarETag, type: t }, - })) + })) : [], [result.data?.items, result.isSuccess], ); diff --git a/apps/meteor/client/components/connectionStatus/ConnectionStatusBar.stories.tsx b/apps/meteor/client/components/connectionStatus/ConnectionStatusBar.stories.tsx index 4f3da8b3f36f..3829d946784c 100644 --- a/apps/meteor/client/components/connectionStatus/ConnectionStatusBar.stories.tsx +++ b/apps/meteor/client/components/connectionStatus/ConnectionStatusBar.stories.tsx @@ -14,8 +14,9 @@ export default { }, } satisfies Meta; -const stateDecorator = (value: ContextType) => (fn: () => ReactElement) => - {fn()}; +const stateDecorator = (value: ContextType) => (fn: () => ReactElement) => ( + {fn()} +); const Template: StoryFn = () => ; diff --git a/apps/meteor/client/components/message/StatusIndicators.tsx b/apps/meteor/client/components/message/StatusIndicators.tsx index ba618823b792..b0fd17adbd26 100644 --- a/apps/meteor/client/components/message/StatusIndicators.tsx +++ b/apps/meteor/client/components/message/StatusIndicators.tsx @@ -42,7 +42,7 @@ const StatusIndicators = ({ message }: StatusIndicatorsProps): ReactElement => { : t('Message_has_been_edited_by_at', { username: message.editedBy.username || '?', date: formatter(message.editedAt), - }) + }) } /> )} diff --git a/apps/meteor/client/components/message/content/Attachments.tsx b/apps/meteor/client/components/message/content/Attachments.tsx index ea9c03b9e7d3..365d80572c49 100644 --- a/apps/meteor/client/components/message/content/Attachments.tsx +++ b/apps/meteor/client/components/message/content/Attachments.tsx @@ -10,13 +10,7 @@ type AttachmentsProps = { }; const Attachments = ({ attachments, id }: AttachmentsProps): ReactElement => { - return ( - <> - {attachments?.map((attachment, index) => ( - - ))} - - ); + return <>{attachments?.map((attachment, index) => )}; }; export default Attachments; diff --git a/apps/meteor/client/components/message/list/MessageListContext.tsx b/apps/meteor/client/components/message/list/MessageListContext.tsx index d525e2a4a39e..4527d03edd46 100644 --- a/apps/meteor/client/components/message/list/MessageListContext.tsx +++ b/apps/meteor/client/components/message/list/MessageListContext.tsx @@ -11,12 +11,11 @@ export type MessageListContextValue = { showRoles: boolean; showRealName: boolean; showUsername: boolean; - highlights?: - | { - highlight: string; - regex: RegExp; - urlRegex: RegExp; - }[]; + highlights?: { + highlight: string; + regex: RegExp; + urlRegex: RegExp; + }[]; katex?: { dollarSyntaxEnabled: boolean; parenthesisSyntaxEnabled: boolean; diff --git a/apps/meteor/client/components/message/toolbar/MessageActionMenu.tsx b/apps/meteor/client/components/message/toolbar/MessageActionMenu.tsx index 5bf1d8846498..143c0a3fe46a 100644 --- a/apps/meteor/client/components/message/toolbar/MessageActionMenu.tsx +++ b/apps/meteor/client/components/message/toolbar/MessageActionMenu.tsx @@ -38,18 +38,21 @@ const MessageActionMenu = ({ options, onChangeMenuVisibility, context, isMessage ...(option.disabled && option?.disabled?.(context) && { tooltip: t('Action_not_available_encrypted_content', { action: t(option.label) }) }), })) - .reduce((acc, option) => { - const group = option.type ? option.type : ''; - const section = acc.find((section: { id: string }) => section.id === group); - if (section) { - section.items.push(option); - return acc; - } - const newSection = { id: group, title: group === 'apps' ? t('Apps') : '', items: [option] }; - acc.push(newSection); + .reduce( + (acc, option) => { + const group = option.type ? option.type : ''; + const section = acc.find((section: { id: string }) => section.id === group); + if (section) { + section.items.push(option); + return acc; + } + const newSection = { id: group, title: group === 'apps' ? t('Apps') : '', items: [option] }; + acc.push(newSection); - return acc; - }, [] as unknown as MessageActionSection[]) + return acc; + }, + [] as unknown as MessageActionSection[], + ) .map((section) => { if (section.id !== 'apps') { return section; diff --git a/apps/meteor/client/hooks/useEndpointAction.ts b/apps/meteor/client/hooks/useEndpointAction.ts index 2cfb22b18548..4baf82a20ff2 100644 --- a/apps/meteor/client/hooks/useEndpointAction.ts +++ b/apps/meteor/client/hooks/useEndpointAction.ts @@ -6,10 +6,10 @@ import { useMutation } from '@tanstack/react-query'; type UseEndpointActionOptions = (undefined extends UrlParams ? { keys?: UrlParams; - } + } : { keys: UrlParams; - }) & { + }) & { successMessage?: string; }; export function useEndpointAction( diff --git a/apps/meteor/client/hooks/useFeaturePreviewEnableQuery.ts b/apps/meteor/client/hooks/useFeaturePreviewEnableQuery.ts index fd88f0237d29..e6c668713fab 100644 --- a/apps/meteor/client/hooks/useFeaturePreviewEnableQuery.ts +++ b/apps/meteor/client/hooks/useFeaturePreviewEnableQuery.ts @@ -17,10 +17,13 @@ const handleFeaturePreviewEnableQuery = (item: FeaturePreviewProps, _: any, feat const groupFeaturePreview = (features: FeaturePreviewProps[]) => Object.entries( - features.reduce((result, currentValue) => { - (result[currentValue.group] = result[currentValue.group] || []).push(currentValue); - return result; - }, {} as Record), + features.reduce( + (result, currentValue) => { + (result[currentValue.group] = result[currentValue.group] || []).push(currentValue); + return result; + }, + {} as Record, + ), ); export const useFeaturePreviewEnableQuery = (features: FeaturePreviewProps[]) => { diff --git a/apps/meteor/client/hooks/useLicenseLimitsByBehavior.ts b/apps/meteor/client/hooks/useLicenseLimitsByBehavior.ts index 7ccea2dd4bd4..ba7e165496ea 100644 --- a/apps/meteor/client/hooks/useLicenseLimitsByBehavior.ts +++ b/apps/meteor/client/hooks/useLicenseLimitsByBehavior.ts @@ -25,10 +25,10 @@ export const useLicenseLimitsByBehavior = () => { .map((key) => { const rule = license.limits[key] ?.filter((limit) => validateWarnLimit(limit.max, limits[key].value ?? 0, limit.behavior)) - .reduce<{ max: number; behavior: LicenseBehavior } | null>( - (maxLimit, currentLimit) => (!maxLimit || currentLimit.max > maxLimit.max ? currentLimit : maxLimit), - null, - ); + .reduce<{ + max: number; + behavior: LicenseBehavior; + } | null>((maxLimit, currentLimit) => (!maxLimit || currentLimit.max > maxLimit.max ? currentLimit : maxLimit), null); if (!rule) { return undefined; diff --git a/apps/meteor/client/lib/parseMessageTextToAstMarkdown.ts b/apps/meteor/client/lib/parseMessageTextToAstMarkdown.ts index 0a1de5049e2b..969f36a6f2fc 100644 --- a/apps/meteor/client/lib/parseMessageTextToAstMarkdown.ts +++ b/apps/meteor/client/lib/parseMessageTextToAstMarkdown.ts @@ -49,7 +49,7 @@ export const parseMessageTextToAstMarkdown = < md: isE2EEMessage(message) || isOTRMessage(message) || isOTRAckMessage(message) || translated ? textToMessageToken(text, parseOptions) - : msg.md ?? textToMessageToken(text, parseOptions), + : (msg.md ?? textToMessageToken(text, parseOptions)), ...(msg.attachments && { attachments: parseMessageAttachments(msg.attachments, parseOptions, { autoTranslateLanguage, translated }), }), @@ -79,12 +79,12 @@ export const parseMessageAttachment = ( if (isFileAttachment(attachment) && attachment.description) { attachment.descriptionMd = translated ? textToMessageToken(text, parseOptions) - : attachment.descriptionMd ?? textToMessageToken(text, parseOptions); + : (attachment.descriptionMd ?? textToMessageToken(text, parseOptions)); } return { ...attachment, - md: translated ? textToMessageToken(text, parseOptions) : attachment.md ?? textToMessageToken(text, parseOptions), + md: translated ? textToMessageToken(text, parseOptions) : (attachment.md ?? textToMessageToken(text, parseOptions)), }; }; diff --git a/apps/meteor/client/lib/userData.ts b/apps/meteor/client/lib/userData.ts index ee90f493a30c..15fc806be94d 100644 --- a/apps/meteor/client/lib/userData.ts +++ b/apps/meteor/client/lib/userData.ts @@ -111,7 +111,7 @@ export const synchronizeUserData = async (uid: IUser['_id']): Promise s.split(':'))) as Record)[ 'background-image' - ]; + ]; return { 'className': emojiElement.getAttribute('class') || '', diff --git a/apps/meteor/client/lib/voip/VoIPUser.ts b/apps/meteor/client/lib/voip/VoIPUser.ts index d9473c878fb2..5e74ae2cbd05 100644 --- a/apps/meteor/client/lib/voip/VoIPUser.ts +++ b/apps/meteor/client/lib/voip/VoIPUser.ts @@ -91,7 +91,10 @@ export class VoIPUser extends Emitter { return this._userState; } - constructor(private readonly config: VoIPUserConfiguration, mediaRenderer?: IMediaStreamRenderer) { + constructor( + private readonly config: VoIPUserConfiguration, + mediaRenderer?: IMediaStreamRenderer, + ) { super(); this.mediaStreamRendered = mediaRenderer; this.networkEmitter = new Emitter(); diff --git a/apps/meteor/client/meteorOverrides/login/google.ts b/apps/meteor/client/meteorOverrides/login/google.ts index 4e99ac3a281b..2cf56e7853d8 100644 --- a/apps/meteor/client/meteorOverrides/login/google.ts +++ b/apps/meteor/client/meteorOverrides/login/google.ts @@ -12,13 +12,12 @@ declare module 'meteor/meteor' { // eslint-disable-next-line @typescript-eslint/no-namespace namespace Meteor { function loginWithGoogle( - options?: - | Meteor.LoginWithExternalServiceOptions & { - loginUrlParameters?: { - include_granted_scopes?: boolean; - hd?: string; - }; - }, + options?: Meteor.LoginWithExternalServiceOptions & { + loginUrlParameters?: { + include_granted_scopes?: boolean; + hd?: string; + }; + }, callback?: LoginCallback, ): void; } diff --git a/apps/meteor/client/omnichannel/additionalForms/DepartmentForwarding.tsx b/apps/meteor/client/omnichannel/additionalForms/DepartmentForwarding.tsx index e65e4da01b96..b42261e3cc13 100644 --- a/apps/meteor/client/omnichannel/additionalForms/DepartmentForwarding.tsx +++ b/apps/meteor/client/omnichannel/additionalForms/DepartmentForwarding.tsx @@ -63,7 +63,7 @@ export const DepartmentForwarding = ({ departmentId, value = [], handler, label return; } loadMoreDepartments(start, Math.min(50, departmentsTotal)); - } + } } renderItem={({ label, ...props }) => ( { {headers} - {data?.businessHours.map((businessHour) => ( - - ))} + {data?.businessHours.map((businessHour) => )} { () => Roles.find() .fetch() - .reduce((ret, obj) => { - ret[obj._id] = obj; - return ret; - }, {} as Record), + .reduce( + (ret, obj) => { + ret[obj._id] = obj; + return ret; + }, + {} as Record, + ), [], ), ); diff --git a/apps/meteor/client/providers/EmojiPickerProvider/EmojiPickerProvider.tsx b/apps/meteor/client/providers/EmojiPickerProvider/EmojiPickerProvider.tsx index 35cb32077a84..02b406dc2a6c 100644 --- a/apps/meteor/client/providers/EmojiPickerProvider/EmojiPickerProvider.tsx +++ b/apps/meteor/client/providers/EmojiPickerProvider/EmojiPickerProvider.tsx @@ -57,7 +57,7 @@ const EmojiPickerProvider = ({ children }: { children: ReactNode }): ReactElemen list: createEmojiList(category.key, null, recentEmojis, setRecentEmojis), limit: category.key === CUSTOM_CATEGORY ? limit | customItemsLimit : null, }, - } + } : category, ), ); diff --git a/apps/meteor/client/providers/OmnichannelProvider.tsx b/apps/meteor/client/providers/OmnichannelProvider.tsx index 6e3c65610709..0e10bb2fc959 100644 --- a/apps/meteor/client/providers/OmnichannelProvider.tsx +++ b/apps/meteor/client/providers/OmnichannelProvider.tsx @@ -191,7 +191,7 @@ const OmnichannelProvider = ({ children }: OmnichannelProviderProps) => { ? { enabled: true, queue, - } + } : { enabled: false }, showOmnichannelQueueLink: showOmnichannelQueueLink && !!agentAvailable, livechatPriorities, diff --git a/apps/meteor/client/providers/SettingsProvider.tsx b/apps/meteor/client/providers/SettingsProvider.tsx index 84b315bc940f..38a4b2397c7b 100644 --- a/apps/meteor/client/providers/SettingsProvider.tsx +++ b/apps/meteor/client/providers/SettingsProvider.tsx @@ -74,7 +74,7 @@ const SettingsProvider = ({ children, privileged = false }: SettingsProviderProp ? { section: query.section } : { $or: [{ section: { $exists: false } }, { section: undefined }], - })), + })), }, { sort: { diff --git a/apps/meteor/client/providers/TranslationProvider.tsx b/apps/meteor/client/providers/TranslationProvider.tsx index eb546c91c6bd..a4594fef9380 100644 --- a/apps/meteor/client/providers/TranslationProvider.tsx +++ b/apps/meteor/client/providers/TranslationProvider.tsx @@ -126,7 +126,9 @@ const useAutoLanguage = () => { const defaultUserLanguage = browserLanguage || serverLanguage || 'en'; // if the language is supported, if not remove the region - const suggestedLanguage = languages.includes(defaultUserLanguage) ? defaultUserLanguage : defaultUserLanguage.split('-').shift() ?? 'en'; + const suggestedLanguage = languages.includes(defaultUserLanguage) + ? defaultUserLanguage + : (defaultUserLanguage.split('-').shift() ?? 'en'); // usually that value is set based on the user's config language const [language] = useLocalStorage('userLanguage', suggestedLanguage); diff --git a/apps/meteor/client/sidebar/RoomMenu.tsx b/apps/meteor/client/sidebar/RoomMenu.tsx index 05f02220104b..4baeb3fb824d 100644 --- a/apps/meteor/client/sidebar/RoomMenu.tsx +++ b/apps/meteor/client/sidebar/RoomMenu.tsx @@ -215,7 +215,7 @@ const RoomMenu = ({ label: { label: t('Hide'), icon: 'eye-off' }, action: handleHide, }, - }), + }), toggleRead: { label: { label: isUnread ? t('Mark_read') : t('Mark_unread'), icon: 'flag' }, action: handleToggleRead, @@ -229,7 +229,7 @@ const RoomMenu = ({ }, action: handleToggleFavorite, }, - } + } : {}), ...(canLeave && { leaveRoom: { diff --git a/apps/meteor/client/sidebar/footer/voip/VoipFooter.tsx b/apps/meteor/client/sidebar/footer/voip/VoipFooter.tsx index ba7bbd977e03..0185c7724835 100644 --- a/apps/meteor/client/sidebar/footer/voip/VoipFooter.tsx +++ b/apps/meteor/client/sidebar/footer/voip/VoipFooter.tsx @@ -56,7 +56,7 @@ export const VoipFooter = ({ callerState === 'IN_CALL' || callerState === 'ON_HOLD' ? css` cursor: pointer; - ` + ` : ''; const handleHold = (e: MouseEvent): void => { diff --git a/apps/meteor/client/sidebar/header/hooks/useStatusItems.tsx b/apps/meteor/client/sidebar/header/hooks/useStatusItems.tsx index dc3fa2a3b277..db126708f515 100644 --- a/apps/meteor/client/sidebar/header/hooks/useStatusItems.tsx +++ b/apps/meteor/client/sidebar/header/hooks/useStatusItems.tsx @@ -79,7 +79,7 @@ export const useStatusItems = (): GenericMenuItemProps[] => { ), }, - ] + ] : []), ...(statuses ?? []), { id: 'custom-status', icon: 'emoji', content: t('Custom_Status'), onClick: handleCustomStatus, disabled: presenceDisabled }, diff --git a/apps/meteor/client/sidebarv2/RoomMenu.tsx b/apps/meteor/client/sidebarv2/RoomMenu.tsx index aac68b9ef79e..8b031e8cfced 100644 --- a/apps/meteor/client/sidebarv2/RoomMenu.tsx +++ b/apps/meteor/client/sidebarv2/RoomMenu.tsx @@ -225,7 +225,7 @@ const RoomMenu = ({ }, action: handleToggleFavorite, }, - } + } : {}), ...(canLeave && { leaveRoom: { diff --git a/apps/meteor/client/sidebarv2/footer/voip/VoipFooter.tsx b/apps/meteor/client/sidebarv2/footer/voip/VoipFooter.tsx index 9344ba33c9ad..75d64d4777cf 100644 --- a/apps/meteor/client/sidebarv2/footer/voip/VoipFooter.tsx +++ b/apps/meteor/client/sidebarv2/footer/voip/VoipFooter.tsx @@ -56,7 +56,7 @@ const VoipFooter = ({ callerState === 'IN_CALL' || callerState === 'ON_HOLD' ? css` cursor: pointer; - ` + ` : ''; const handleHold = (e: MouseEvent): void => { diff --git a/apps/meteor/client/startup/iframeCommands.ts b/apps/meteor/client/startup/iframeCommands.ts index f0db83ccdcbf..5184de9c6942 100644 --- a/apps/meteor/client/startup/iframeCommands.ts +++ b/apps/meteor/client/startup/iframeCommands.ts @@ -19,10 +19,13 @@ const commands = { } const newUrl = new URL(`${rtrim(baseURI, '/')}/${ltrim(data.path, '/')}`); - const newParams = Array.from(newUrl.searchParams.entries()).reduce((ret, [key, value]) => { - ret[key] = value; - return ret; - }, {} as Record); + const newParams = Array.from(newUrl.searchParams.entries()).reduce( + (ret, [key, value]) => { + ret[key] = value; + return ret; + }, + {} as Record, + ); const newPath = newUrl.pathname.replace( new RegExp(`^${escapeRegExp(__meteor_runtime_config__.ROOT_URL_PATH_PREFIX)}`), diff --git a/apps/meteor/client/stories/contexts/ModalContextMock.tsx b/apps/meteor/client/stories/contexts/ModalContextMock.tsx index ac1d303b2317..5dfa76613e8d 100644 --- a/apps/meteor/client/stories/contexts/ModalContextMock.tsx +++ b/apps/meteor/client/stories/contexts/ModalContextMock.tsx @@ -23,7 +23,7 @@ const ModalContextMock = ({ children }: ModalContextMockProps): ReactElement => }, }, currentModal: context.currentModal, - } + } : undefined, [context], ); diff --git a/apps/meteor/client/stories/contexts/ServerContextMock.tsx b/apps/meteor/client/stories/contexts/ServerContextMock.tsx index 89ded6b19037..8ae8c0047378 100644 --- a/apps/meteor/client/stories/contexts/ServerContextMock.tsx +++ b/apps/meteor/client/stories/contexts/ServerContextMock.tsx @@ -45,7 +45,7 @@ type Operations = { fn: ( params: void extends OperationParams ? void : OperationParams, ) => Promise ? Serialized> : void>; - } + } : never : never : never diff --git a/apps/meteor/client/views/account/preferences/PreferencesMyDataSection.tsx b/apps/meteor/client/views/account/preferences/PreferencesMyDataSection.tsx index 3c8c88af95bd..b8db60f623ce 100644 --- a/apps/meteor/client/views/account/preferences/PreferencesMyDataSection.tsx +++ b/apps/meteor/client/views/account/preferences/PreferencesMyDataSection.tsx @@ -35,7 +35,7 @@ const PreferencesMyDataSection = () => { const text = result.url ? t('UserDataDownload_CompletedRequestExistedWithLink_Text', { download_link: result.url, - }) + }) : t('UserDataDownload_CompletedRequestExisted_Text'); setModal( diff --git a/apps/meteor/client/views/admin/customUserStatus/CustomUserStatusTable/CustomUserStatusTable.tsx b/apps/meteor/client/views/admin/customUserStatus/CustomUserStatusTable/CustomUserStatusTable.tsx index 9a03101bc499..2aaf85289820 100644 --- a/apps/meteor/client/views/admin/customUserStatus/CustomUserStatusTable/CustomUserStatusTable.tsx +++ b/apps/meteor/client/views/admin/customUserStatus/CustomUserStatusTable/CustomUserStatusTable.tsx @@ -92,9 +92,7 @@ const CustomUserStatus = ({ reload, onClick }: CustomUserStatusProps): ReactElem {isLoading && } - {data?.map((status) => ( - - ))} + {data?.map((status) => )} {isFetched && ( diff --git a/apps/meteor/client/views/admin/engagementDashboard/channels/useChannelsList.ts b/apps/meteor/client/views/admin/engagementDashboard/channels/useChannelsList.ts index f45c620c8b49..875f9c2d932d 100644 --- a/apps/meteor/client/views/admin/engagementDashboard/channels/useChannelsList.ts +++ b/apps/meteor/client/views/admin/engagementDashboard/channels/useChannelsList.ts @@ -32,7 +32,7 @@ export const useChannelsList = ({ period, offset, count }: UseChannelsListOption ...response, start, end, - } + } : undefined; }, { diff --git a/apps/meteor/client/views/admin/engagementDashboard/messages/useMessageOrigins.ts b/apps/meteor/client/views/admin/engagementDashboard/messages/useMessageOrigins.ts index f44b87b4f8f8..e4e9526b571f 100644 --- a/apps/meteor/client/views/admin/engagementDashboard/messages/useMessageOrigins.ts +++ b/apps/meteor/client/views/admin/engagementDashboard/messages/useMessageOrigins.ts @@ -25,7 +25,7 @@ export const useMessageOrigins = ({ period }: UseMessageOriginsOptions) => { ...response, start, end, - } + } : undefined; }, { diff --git a/apps/meteor/client/views/admin/engagementDashboard/messages/useMessagesSent.ts b/apps/meteor/client/views/admin/engagementDashboard/messages/useMessagesSent.ts index 6b7f40b8ae74..daeeaa388f58 100644 --- a/apps/meteor/client/views/admin/engagementDashboard/messages/useMessagesSent.ts +++ b/apps/meteor/client/views/admin/engagementDashboard/messages/useMessagesSent.ts @@ -25,7 +25,7 @@ export const useMessagesSent = ({ period }: UseMessagesSentOptions) => { ...response, start, end, - } + } : undefined; }, { diff --git a/apps/meteor/client/views/admin/engagementDashboard/messages/useTopFivePopularChannels.ts b/apps/meteor/client/views/admin/engagementDashboard/messages/useTopFivePopularChannels.ts index cc6707de919d..d7566d3df6fb 100644 --- a/apps/meteor/client/views/admin/engagementDashboard/messages/useTopFivePopularChannels.ts +++ b/apps/meteor/client/views/admin/engagementDashboard/messages/useTopFivePopularChannels.ts @@ -25,7 +25,7 @@ export const useTopFivePopularChannels = ({ period }: UseTopFivePopularChannelsO ...response, start, end, - } + } : undefined; }, { diff --git a/apps/meteor/client/views/admin/engagementDashboard/users/useActiveUsers.ts b/apps/meteor/client/views/admin/engagementDashboard/users/useActiveUsers.ts index 2de826eb69b3..345540a08e1f 100644 --- a/apps/meteor/client/views/admin/engagementDashboard/users/useActiveUsers.ts +++ b/apps/meteor/client/views/admin/engagementDashboard/users/useActiveUsers.ts @@ -24,7 +24,7 @@ export const useActiveUsers = ({ utc }: UseActiveUsersOptions) => { ...response, start, end, - } + } : undefined; }, { diff --git a/apps/meteor/client/views/admin/engagementDashboard/users/useHourlyChatActivity.ts b/apps/meteor/client/views/admin/engagementDashboard/users/useHourlyChatActivity.ts index 56dd4b883c83..f2a7b98ebc41 100644 --- a/apps/meteor/client/views/admin/engagementDashboard/users/useHourlyChatActivity.ts +++ b/apps/meteor/client/views/admin/engagementDashboard/users/useHourlyChatActivity.ts @@ -24,7 +24,7 @@ export const useHourlyChatActivity = ({ displacement, utc }: UseHourlyChatActivi ? { ...response, day, - } + } : undefined; }, { diff --git a/apps/meteor/client/views/admin/engagementDashboard/users/useNewUsers.ts b/apps/meteor/client/views/admin/engagementDashboard/users/useNewUsers.ts index d43dc628c587..1d378dc77b49 100644 --- a/apps/meteor/client/views/admin/engagementDashboard/users/useNewUsers.ts +++ b/apps/meteor/client/views/admin/engagementDashboard/users/useNewUsers.ts @@ -22,7 +22,7 @@ export const useNewUsers = ({ period, utc }: { period: Period['key']; utc: boole ...response, start, end, - } + } : undefined; }, { diff --git a/apps/meteor/client/views/admin/engagementDashboard/users/useUsersByTimeOfTheDay.ts b/apps/meteor/client/views/admin/engagementDashboard/users/useUsersByTimeOfTheDay.ts index 0faa8a434b2f..6a9fa7897814 100644 --- a/apps/meteor/client/views/admin/engagementDashboard/users/useUsersByTimeOfTheDay.ts +++ b/apps/meteor/client/views/admin/engagementDashboard/users/useUsersByTimeOfTheDay.ts @@ -25,7 +25,7 @@ export const useUsersByTimeOfTheDay = ({ period, utc }: UseUsersByTimeOfTheDayOp ...response, start, end, - } + } : undefined; }, { diff --git a/apps/meteor/client/views/admin/engagementDashboard/users/useWeeklyChatActivity.ts b/apps/meteor/client/views/admin/engagementDashboard/users/useWeeklyChatActivity.ts index a04e9d5da633..50b6667d535b 100644 --- a/apps/meteor/client/views/admin/engagementDashboard/users/useWeeklyChatActivity.ts +++ b/apps/meteor/client/views/admin/engagementDashboard/users/useWeeklyChatActivity.ts @@ -24,7 +24,7 @@ export const useWeeklyChatActivity = ({ displacement, utc }: UseWeeklyChatActivi ? { ...response, day, - } + } : undefined; }, { diff --git a/apps/meteor/client/views/admin/import/ImportHistoryPage.tsx b/apps/meteor/client/views/admin/import/ImportHistoryPage.tsx index 42b8cee969f5..7a34705a59a0 100644 --- a/apps/meteor/client/views/admin/import/ImportHistoryPage.tsx +++ b/apps/meteor/client/views/admin/import/ImportHistoryPage.tsx @@ -180,9 +180,7 @@ function ImportHistoryPage() { {latestOperations.data .filter(({ _id }) => !currentOperation.data.valid || currentOperation.data._id !== _id) // Forcing valid=false as the current API only accept preparation/progress over currentOperation - ?.map((operation) => ( - - ))} + ?.map((operation) => )} )} diff --git a/apps/meteor/client/views/admin/import/ImportOperationSummary.tsx b/apps/meteor/client/views/admin/import/ImportOperationSummary.tsx index 534dea3b6355..29295756f8bc 100644 --- a/apps/meteor/client/views/admin/import/ImportOperationSummary.tsx +++ b/apps/meteor/client/views/admin/import/ImportOperationSummary.tsx @@ -90,7 +90,7 @@ function ImportOperationSummary({ role: 'link', action: true, onClick: handleClick, - } + } : {}; return ( diff --git a/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRoleTable/UsersInRoleTable.tsx b/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRoleTable/UsersInRoleTable.tsx index c00f1795a94b..b22792957d37 100644 --- a/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRoleTable/UsersInRoleTable.tsx +++ b/apps/meteor/client/views/admin/permissions/UsersInRole/UsersInRoleTable/UsersInRoleTable.tsx @@ -102,9 +102,7 @@ const UsersInRoleTable = ({ rid, roleId, roleName, description }: UsersInRoleTab {headers} - {users?.map((user) => ( - - ))} + {users?.map((user) => )} void> }): React <> {headers} - - {data.rooms?.map((room) => ( - - ))} - + {data.rooms?.map((room) => )} void, icon: 'trash', label: t('Delete'), action: confirmDeleteUser, - } + } : undefined; }; diff --git a/apps/meteor/client/views/admin/users/hooks/useResetE2EEKeyAction.tsx b/apps/meteor/client/views/admin/users/hooks/useResetE2EEKeyAction.tsx index fecb0eb65f6a..78f777f83027 100644 --- a/apps/meteor/client/views/admin/users/hooks/useResetE2EEKeyAction.tsx +++ b/apps/meteor/client/views/admin/users/hooks/useResetE2EEKeyAction.tsx @@ -36,6 +36,6 @@ export const useResetE2EEKeyAction = (userId: IUser['_id']): Action | undefined icon: 'key', label: t('Reset_E2E_Key'), action: confirmResetE2EEKey, - } + } : undefined; }; diff --git a/apps/meteor/client/views/admin/users/hooks/useResetTOTPAction.tsx b/apps/meteor/client/views/admin/users/hooks/useResetTOTPAction.tsx index 1af5f628f959..a096b2e50d88 100644 --- a/apps/meteor/client/views/admin/users/hooks/useResetTOTPAction.tsx +++ b/apps/meteor/client/views/admin/users/hooks/useResetTOTPAction.tsx @@ -37,6 +37,6 @@ export const useResetTOTPAction = (userId: IUser['_id']): Action | undefined => icon: 'key', label: t('Reset_TOTP'), action: confirmResetTOTP, - } + } : undefined; }; diff --git a/apps/meteor/client/views/admin/users/hooks/useVoipExtensionAction.tsx b/apps/meteor/client/views/admin/users/hooks/useVoipExtensionAction.tsx index 3254209891c6..63bda3b0b64c 100644 --- a/apps/meteor/client/views/admin/users/hooks/useVoipExtensionAction.tsx +++ b/apps/meteor/client/views/admin/users/hooks/useVoipExtensionAction.tsx @@ -33,6 +33,6 @@ export const useVoipExtensionAction = ({ name, username, extension }: VoipExtens icon: extension ? 'phone-disabled' : 'phone', label: extension ? t('Unassign_extension') : t('Assign_extension'), action: handleExtensionAssignment, - } + } : undefined; }; diff --git a/apps/meteor/client/views/admin/users/voip/hooks/useVoipExtensionAction.tsx b/apps/meteor/client/views/admin/users/voip/hooks/useVoipExtensionAction.tsx index e5f25683586a..c8bbe3bfb316 100644 --- a/apps/meteor/client/views/admin/users/voip/hooks/useVoipExtensionAction.tsx +++ b/apps/meteor/client/views/admin/users/voip/hooks/useVoipExtensionAction.tsx @@ -32,6 +32,6 @@ export const useVoipExtensionAction = ({ name, username, extension, enabled }: V icon: extension ? 'phone-disabled' : 'phone', label: extension ? t('Unassign_extension') : t('Assign_extension'), action: handleExtensionAssignment, - } + } : undefined; }; diff --git a/apps/meteor/client/views/admin/workspace/VersionCard/VersionCard.tsx b/apps/meteor/client/views/admin/workspace/VersionCard/VersionCard.tsx index 4291cd02d47a..0716d920f35d 100644 --- a/apps/meteor/client/views/admin/workspace/VersionCard/VersionCard.tsx +++ b/apps/meteor/client/views/admin/workspace/VersionCard/VersionCard.tsx @@ -116,11 +116,11 @@ const VersionCard = ({ serverInfo }: VersionCardProps): ReactElement => { danger: true, icon: 'warning', label: t('Plan_limits_reached'), - } + } : { icon: 'check', label: t('Operating_withing_plan_limits'), - }, + }, (isAirgapped || !versions) && { icon: 'warning', label: ( @@ -157,12 +157,12 @@ const VersionCard = ({ serverInfo }: VersionCardProps): ReactElement => { ? { icon: 'check', label: t('Workspace_registered'), - } + } : { danger: true, icon: 'warning', label: t('Workspace_not_registered'), - }, + }, ].filter(Boolean) as VersionActionItem[] ).sort((a) => (a.danger ? -1 : 1)); }, [isOverLimits, t, isAirgapped, versions, versionStatus?.label, versionStatus?.expiration, formatDate, isRegistered]); diff --git a/apps/meteor/client/views/audit/components/forms/DateRangePicker.tsx b/apps/meteor/client/views/audit/components/forms/DateRangePicker.tsx index 7eecf145865d..ed9302d14185 100644 --- a/apps/meteor/client/views/audit/components/forms/DateRangePicker.tsx +++ b/apps/meteor/client/views/audit/components/forms/DateRangePicker.tsx @@ -167,7 +167,7 @@ const DateRangePicker = ({ value, onChange, ...props }: DateRangePickerProps): R label: t('Previous_month'), action: () => dispatch('last-month'), }, - } as const), + }) as const, [dispatch, t], ); diff --git a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleases.tsx b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleases.tsx index 9212baf93fd5..2514e72fc0cf 100644 --- a/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleases.tsx +++ b/apps/meteor/client/views/marketplace/AppDetailsPage/tabs/AppReleases/AppReleases.tsx @@ -35,13 +35,7 @@ const AppReleases = ({ id }: { id: App['id'] }): ReactElement => { <> {isLoading && } - {isFetched && ( - <> - {data?.map((release) => ( - - ))} - - )} + {isFetched && <>{data?.map((release) => )}} ); diff --git a/apps/meteor/client/views/marketplace/components/ScreenshotCarousel.tsx b/apps/meteor/client/views/marketplace/components/ScreenshotCarousel.tsx index bbf803cad29f..42eaf29236da 100644 --- a/apps/meteor/client/views/marketplace/components/ScreenshotCarousel.tsx +++ b/apps/meteor/client/views/marketplace/components/ScreenshotCarousel.tsx @@ -30,11 +30,11 @@ const ScreenshotCarousel = ({ opacity: '1', transitionDuration: '1s', transform: 'scale(1.08)', - } + } : { opacity: '0', transitionDuration: '1s ease', - }; + }; return ( diff --git a/apps/meteor/client/views/marketplace/helpers.ts b/apps/meteor/client/views/marketplace/helpers.ts index d06a1cde0cfc..5307b007b1c3 100644 --- a/apps/meteor/client/views/marketplace/helpers.ts +++ b/apps/meteor/client/views/marketplace/helpers.ts @@ -186,21 +186,21 @@ export const appStatusSpanProps = ( ? { label: 'Enabled*', tooltipText: t('Grandfathered_app'), - } + } : { label: 'Enabled', - }; + }; } return migrated && !isEnterprise ? { label: 'Disabled*', tooltipText: t('Grandfathered_app'), - } + } : { type: 'warning', label: 'Disabled', - }; + }; } const isFailed = status && appErroredStatuses.includes(status); diff --git a/apps/meteor/client/views/marketplace/hooks/useAppInfo.ts b/apps/meteor/client/views/marketplace/hooks/useAppInfo.ts index f544e2f25b83..130a32c1421f 100644 --- a/apps/meteor/client/views/marketplace/hooks/useAppInfo.ts +++ b/apps/meteor/client/views/marketplace/hooks/useAppInfo.ts @@ -62,7 +62,7 @@ export const useAppInfo = (appId: string, context: string): AppInfo | undefined marketplace: 'true', update: 'true', appVersion: appId, - }) + }) .then(({ app }: any) => { (appResult as App).tosLink = app.tosLink; (appResult as App).privacyLink = app.privacyLink; diff --git a/apps/meteor/client/views/omnichannel/agents/AgentsTable/AgentsTable.tsx b/apps/meteor/client/views/omnichannel/agents/AgentsTable/AgentsTable.tsx index f52081c10b66..81a04487da47 100644 --- a/apps/meteor/client/views/omnichannel/agents/AgentsTable/AgentsTable.tsx +++ b/apps/meteor/client/views/omnichannel/agents/AgentsTable/AgentsTable.tsx @@ -98,9 +98,7 @@ const AgentsTable = () => { {headers} - {data?.users.map((user) => ( - - ))} + {data?.users.map((user) => )} - - {displayData.head?.map(({ name }, i) => ( - {t(name as TranslationKey)} - ))} - + {displayData.head?.map(({ name }, i) => {t(name as TranslationKey)})} {displayData.data?.map(({ name, value }, i) => ( diff --git a/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx b/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx index 2aad7b3d29cb..8c5c433683f4 100644 --- a/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx +++ b/apps/meteor/client/views/omnichannel/directory/calls/CallTable.tsx @@ -124,9 +124,7 @@ const CallTable = () => { {headers} - {data?.rooms.map((room) => ( - - ))} + {data?.rooms.map((room) => )} ( ...acc, {child}, , - ] + ] : [...acc, child], [] as ReactNode[], )} diff --git a/apps/meteor/client/views/room/Announcement/Announcement.tsx b/apps/meteor/client/views/room/Announcement/Announcement.tsx index 58da7d061564..392ea45fff59 100644 --- a/apps/meteor/client/views/room/Announcement/Announcement.tsx +++ b/apps/meteor/client/views/room/Announcement/Announcement.tsx @@ -35,7 +35,7 @@ const Announcement = ({ announcement, announcementDetails }: AnnouncementProps) , - ); + ); }; return announcement ? ( diff --git a/apps/meteor/client/views/room/Header/Omnichannel/QuickActions/hooks/useQuickActions.tsx b/apps/meteor/client/views/room/Header/Omnichannel/QuickActions/hooks/useQuickActions.tsx index edf5ffcbdc8a..ff98530265df 100644 --- a/apps/meteor/client/views/room/Header/Omnichannel/QuickActions/hooks/useQuickActions.tsx +++ b/apps/meteor/client/views/room/Header/Omnichannel/QuickActions/hooks/useQuickActions.tsx @@ -196,7 +196,7 @@ export const useQuickActions = (): { sendToVisitor: preferences?.omnichannelTranscriptEmail, requestData, }, - } + } : { transcriptEmail: { sendToVisitor: false } }), }); LivechatInquiry.remove({ rid }); diff --git a/apps/meteor/client/views/room/HeaderV2/Omnichannel/QuickActions/hooks/useQuickActions.tsx b/apps/meteor/client/views/room/HeaderV2/Omnichannel/QuickActions/hooks/useQuickActions.tsx index 7446d0630b09..07db5fb238b4 100644 --- a/apps/meteor/client/views/room/HeaderV2/Omnichannel/QuickActions/hooks/useQuickActions.tsx +++ b/apps/meteor/client/views/room/HeaderV2/Omnichannel/QuickActions/hooks/useQuickActions.tsx @@ -194,7 +194,7 @@ export const useQuickActions = (): { sendToVisitor: preferences?.omnichannelTranscriptEmail, requestData, }, - } + } : { transcriptEmail: { sendToVisitor: false } }), }); LivechatInquiry.remove({ rid }); diff --git a/apps/meteor/client/views/room/RoomAnnouncement/RoomAnnouncement.tsx b/apps/meteor/client/views/room/RoomAnnouncement/RoomAnnouncement.tsx index 7c8db93f3762..101daf7e843b 100644 --- a/apps/meteor/client/views/room/RoomAnnouncement/RoomAnnouncement.tsx +++ b/apps/meteor/client/views/room/RoomAnnouncement/RoomAnnouncement.tsx @@ -35,7 +35,7 @@ const RoomAnnouncement = ({ announcement, announcementDetails }: RoomAnnouncemen , - ); + ); }; return announcement ? ( diff --git a/apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useWebdavActions.tsx b/apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useWebdavActions.tsx index 806bebaa65e3..55f7f2159f5e 100644 --- a/apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useWebdavActions.tsx +++ b/apps/meteor/client/views/room/composer/messageBox/MessageBoxActionsToolbar/hooks/useWebdavActions.tsx @@ -42,7 +42,7 @@ export const useWebdavActions = (): GenericMenuItemProps[] => { content: account.name, icon: 'cloud-plus' as const, onClick: () => handleOpenWebdav(account), - })) + })) : []), ]; }; diff --git a/apps/meteor/client/views/room/contextualBar/Info/hooks/useRoomActions.ts b/apps/meteor/client/views/room/contextualBar/Info/hooks/useRoomActions.ts index 512fb83fa153..c56fca0dc2a7 100644 --- a/apps/meteor/client/views/room/contextualBar/Info/hooks/useRoomActions.ts +++ b/apps/meteor/client/views/room/contextualBar/Info/hooks/useRoomActions.ts @@ -42,7 +42,7 @@ export const useRoomActions = (room: IRoom, options: UseRoomActionsOptions) => { icon: 'login' as const, onClick: onClickEnterRoom, }, - ] + ] : []), ...(onClickEdit ? [ @@ -52,7 +52,7 @@ export const useRoomActions = (room: IRoom, options: UseRoomActionsOptions) => { icon: 'edit' as const, onClick: onClickEdit, }, - ] + ] : []), ...(handleLeave ? [ @@ -62,7 +62,7 @@ export const useRoomActions = (room: IRoom, options: UseRoomActionsOptions) => { icon: 'sign-out' as const, onClick: handleLeave, }, - ] + ] : []), ...(handleMoveToTeam ? [ @@ -72,7 +72,7 @@ export const useRoomActions = (room: IRoom, options: UseRoomActionsOptions) => { icon: 'team-arrow-right' as const, onClick: handleMoveToTeam, }, - ] + ] : []), ...(handleConvertToTeam ? [ @@ -82,7 +82,7 @@ export const useRoomActions = (room: IRoom, options: UseRoomActionsOptions) => { icon: 'team' as const, onClick: handleConvertToTeam, }, - ] + ] : []), ...(canDeleteRoom ? [ @@ -93,7 +93,7 @@ export const useRoomActions = (room: IRoom, options: UseRoomActionsOptions) => { onClick: handleDelete, variant: 'danger', }, - ] + ] : []), ], }; diff --git a/apps/meteor/client/views/room/contextualBar/PruneMessages/PruneMessagesWithData.tsx b/apps/meteor/client/views/room/contextualBar/PruneMessages/PruneMessagesWithData.tsx index 4d897496f740..7ed26bfab0e7 100644 --- a/apps/meteor/client/views/room/contextualBar/PruneMessages/PruneMessagesWithData.tsx +++ b/apps/meteor/client/views/room/contextualBar/PruneMessages/PruneMessagesWithData.tsx @@ -126,7 +126,7 @@ const PruneMessagesWithData = (): ReactElement => { ? ` ${t('if_they_are_from', { postProcess: 'sprintf', sprintf: [users.map((element) => element).join(', ')], - })}` + })}` : ''; const filesOrMessages = attached ? t('files') : t('messages'); diff --git a/apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx b/apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx index 38f8d0748785..a66d7e6fca4f 100644 --- a/apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx +++ b/apps/meteor/client/views/room/contextualBar/Threads/Thread.tsx @@ -44,7 +44,7 @@ const Thread = ({ tmid }: ThreadProps) => { const [expanded, setExpanded] = useLocalStorage('expand-threads', false); const uid = useUserId(); - const following = uid ? mainMessageQueryResult.data?.replies?.includes(uid) ?? false : false; + const following = uid ? (mainMessageQueryResult.data?.replies?.includes(uid) ?? false) : false; const toggleFollowingMutation = useToggleFollowingThreadMutation({ onError: (error) => { dispatchToastMessage({ type: 'error', message: error }); @@ -90,7 +90,7 @@ const Thread = ({ tmid }: ThreadProps) => { @media (min-width: 780px) and (max-width: 1135px) { max-width: calc(100% - var(--sidebar-width)) !important; } - ` + ` : undefined } position={expanded ? 'fixed' : 'absolute'} diff --git a/apps/meteor/client/views/room/contextualBar/Threads/ThreadList.tsx b/apps/meteor/client/views/room/contextualBar/Threads/ThreadList.tsx index e9ec3d61d1e7..18807059eb80 100644 --- a/apps/meteor/client/views/room/contextualBar/Threads/ThreadList.tsx +++ b/apps/meteor/client/views/room/contextualBar/Threads/ThreadList.tsx @@ -163,7 +163,7 @@ const ThreadList = () => { ? (): void => undefined : (start): void => { loadMoreItems(start, Math.min(50, itemCount - start)); - } + } } overscan={25} data={items} diff --git a/apps/meteor/client/views/room/contextualBar/VideoConference/VideoConfList/VideoConfList.tsx b/apps/meteor/client/views/room/contextualBar/VideoConference/VideoConfList/VideoConfList.tsx index c8c7b6a59e3b..fbd9734b1b7b 100644 --- a/apps/meteor/client/views/room/contextualBar/VideoConference/VideoConfList/VideoConfList.tsx +++ b/apps/meteor/client/views/room/contextualBar/VideoConference/VideoConfList/VideoConfList.tsx @@ -80,7 +80,7 @@ const VideoConfList = ({ onClose, total, videoConfs, loading, error, reload, loa ? (): void => undefined : (start) => { loadMoreItems(start, Math.min(50, total - start)); - } + } } overscan={25} data={videoConfs} diff --git a/apps/meteor/client/views/room/contextualBar/VideoConference/hooks/useVideoConfOpenCall.spec.tsx b/apps/meteor/client/views/room/contextualBar/VideoConference/hooks/useVideoConfOpenCall.spec.tsx index d0e69399e8a2..4a847d207cda 100644 --- a/apps/meteor/client/views/room/contextualBar/VideoConference/hooks/useVideoConfOpenCall.spec.tsx +++ b/apps/meteor/client/views/room/contextualBar/VideoConference/hooks/useVideoConfOpenCall.spec.tsx @@ -51,7 +51,7 @@ describe('without window.RocketChatDesktop set', () => { }); it('should open window', async () => { - window.open = jest.fn(() => ({} as Window)); + window.open = jest.fn(() => ({}) as Window); const { result } = renderHook(() => useVideoConfOpenCall(), { legacyRoot: true, diff --git a/apps/meteor/client/views/room/hooks/useDateScroll.ts b/apps/meteor/client/views/room/hooks/useDateScroll.ts index 56c86a62839c..c01580e43c59 100644 --- a/apps/meteor/client/views/room/hooks/useDateScroll.ts +++ b/apps/meteor/client/views/room/hooks/useDateScroll.ts @@ -53,45 +53,48 @@ export const useDateScroll = (margin = 8): useDateScrollReturn => { clearTimeout(timeout); // Gets the first non visible message date and sets the bubble date to it - const [date, message, style] = [...elements].reduce((ret, message) => { - // Sanitize elements - if (!message.dataset.id) { - return ret; - } + const [date, message, style] = [...elements].reduce( + (ret, message) => { + // Sanitize elements + if (!message.dataset.id) { + return ret; + } - const { top, height } = message.getBoundingClientRect(); - const { id } = message.dataset; - - // if the bubble if between the divider and the top, position it at the top of the divider - if (top > bubbleOffset && top < bubbleOffset + height) { - return [ - ret[0] || new Date(id).toISOString(), - ret[1] || message, - { - position: 'absolute', - top: `${top - height - bubbleOffset + margin}px`, - left: ' 50%', - translate: '-50%', - zIndex: 11, - }, - ]; - } + const { top, height } = message.getBoundingClientRect(); + const { id } = message.dataset; + + // if the bubble if between the divider and the top, position it at the top of the divider + if (top > bubbleOffset && top < bubbleOffset + height) { + return [ + ret[0] || new Date(id).toISOString(), + ret[1] || message, + { + position: 'absolute', + top: `${top - height - bubbleOffset + margin}px`, + left: ' 50%', + translate: '-50%', + zIndex: 11, + }, + ]; + } - if (top < bubbleOffset + height) { - return [ - new Date(id).toISOString(), - message, - { - position: 'absolute', - top: `${margin}px`, - left: ' 50%', - translate: '-50%', - zIndex: 11, - }, - ]; - } - return ret; - }, [] as [string, HTMLElement, { [key: number]: string | number }?] | []); + if (top < bubbleOffset + height) { + return [ + new Date(id).toISOString(), + message, + { + position: 'absolute', + top: `${margin}px`, + left: ' 50%', + translate: '-50%', + zIndex: 11, + }, + ]; + } + return ret; + }, + [] as [string, HTMLElement, { [key: number]: string | number }?] | [], + ); // We always keep the previous date if we don't have a new one, so when the bubble disappears it doesn't flicker setBubbleDate((current) => ({ @@ -143,7 +146,7 @@ export const useDateScroll = (margin = 8): useDateScrollReturn => { & [data-time='${bubbleDate.date.replaceAll(/[-T:.]/g, '').substring(0, 8)}'] { opacity: 0; } - ` + ` : undefined; return { diff --git a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useAddUserAction.tsx b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useAddUserAction.tsx index 42388b100d41..2047127eb66e 100644 --- a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useAddUserAction.tsx +++ b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useAddUserAction.tsx @@ -86,7 +86,7 @@ export const useAddUserAction = ( icon: 'user-plus' as const, onClick: addUserOptionAction, type: 'management' as const, - } + } : undefined, [roomCanInvite, userCanAdd, room.archived, t, addUserOptionAction], ); diff --git a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useBlockUserAction.ts b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useBlockUserAction.ts index 216ff4e10216..a1b5091327ad 100644 --- a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useBlockUserAction.ts +++ b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useBlockUserAction.ts @@ -42,7 +42,7 @@ export const useBlockUserAction = (user: Pick, rid: I content: t(isUserBlocked ? 'Unblock' : 'Block'), icon: 'ban' as const, onClick: toggleBlockUserAction, - } + } : undefined, [isUserBlocked, ownUserId, roomCanBlock, t, toggleBlockUserAction, uid], ); diff --git a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useChangeLeaderAction.ts b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useChangeLeaderAction.ts index 2177f8a66f7a..f97ae7dab10b 100644 --- a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useChangeLeaderAction.ts +++ b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useChangeLeaderAction.ts @@ -37,7 +37,7 @@ export const useChangeLeaderAction = (user: Pick, rid icon: 'shield-alt' as const, onClick: changeLeaderAction, type: 'privileges' as UserInfoActionType, - } + } : undefined, [isLeader, roomCanSetLeader, t, userCanSetLeader, changeLeaderAction], ); diff --git a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useChangeModeratorAction.tsx b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useChangeModeratorAction.tsx index f3043f0ddcec..095695b160c1 100644 --- a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useChangeModeratorAction.tsx +++ b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useChangeModeratorAction.tsx @@ -125,7 +125,7 @@ export const useChangeModeratorAction = (user: Pick, icon: 'shield-blank' as const, onClick: changeModeratorAction, type: 'privileges' as UserInfoActionType, - } + } : undefined, [changeModeratorAction, isModerator, roomCanSetModerator, t, userCanSetModerator, room], ); diff --git a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useChangeOwnerAction.tsx b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useChangeOwnerAction.tsx index ac336e8bbd44..5894138d87f4 100644 --- a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useChangeOwnerAction.tsx +++ b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useChangeOwnerAction.tsx @@ -108,7 +108,7 @@ export const useChangeOwnerAction = (user: Pick, rid: icon: 'shield-check' as const, onClick: changeOwnerAction, type: 'privileges' as UserInfoActionType, - } + } : undefined, [changeOwnerAction, roomCanSetOwner, userCanSetOwner, isOwner, t, room], ); diff --git a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useDirectMessageAction.ts b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useDirectMessageAction.ts index 5ca51e2abe43..b4efb0fe543b 100644 --- a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useDirectMessageAction.ts +++ b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useDirectMessageAction.ts @@ -46,7 +46,7 @@ export const useDirectMessageAction = (user: Pick, ri icon: 'balloon' as const, onClick: openDirectMessage, type: 'communication' as UserInfoActionType, - } + } : undefined, [openDirectMessage, shouldOpenDirectMessage, t], ); diff --git a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useIgnoreUserAction.ts b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useIgnoreUserAction.ts index 5b0a55648cbd..cf2192a1fa56 100644 --- a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useIgnoreUserAction.ts +++ b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useIgnoreUserAction.ts @@ -51,7 +51,7 @@ export const useIgnoreUserAction = (user: Pick, rid: icon: 'ban' as const, onClick: ignoreUserAction, type: 'management' as UserInfoActionType, - } + } : undefined, [ignoreUserAction, isIgnored, ownUserId, roomCanIgnore, t, uid], ); diff --git a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useMuteUserAction.tsx b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useMuteUserAction.tsx index c06cba609d15..0105768bd681 100644 --- a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useMuteUserAction.tsx +++ b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useMuteUserAction.tsx @@ -105,7 +105,7 @@ export const useMuteUserAction = (user: Pick, rid: IR icon: isMuted ? ('mic' as const) : ('mic-off' as const), onClick: action, type: 'management' as UserInfoActionType, - } + } : undefined; }, [ closeModal, diff --git a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx index 81633139d5e9..81ebbb0d1378 100644 --- a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx +++ b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useRemoveUserAction.tsx @@ -97,7 +97,7 @@ export const useRemoveUserAction = ( onClick: removeUserOptionAction, type: 'moderation' as const, variant: 'danger' as const, - } + } : undefined, [room, roomCanRemove, userCanRemove, removeUserOptionAction, t], ); diff --git a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useReportUser.tsx b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useReportUser.tsx index 0c2314431db3..91acf1a874ef 100644 --- a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useReportUser.tsx +++ b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useReportUser.tsx @@ -48,7 +48,7 @@ export const useReportUser = (user: Pick): U onClick: action, type: 'moderation' as const, variant: 'danger' as const, - } + } : undefined; }, [ownUserId, uid, t, setModal, username, reportUserMutation.mutate, displayName]); diff --git a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useVideoCallAction.tsx b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useVideoCallAction.tsx index 8b3f0e5307b5..18af1650e2c4 100644 --- a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useVideoCallAction.tsx +++ b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useVideoCallAction.tsx @@ -48,7 +48,7 @@ export const useVideoCallAction = (user: Pick): UserI title: t('Video_call'), icon: 'video', onClick: action, - } + } : undefined; }, [ room, diff --git a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useVoipCallAction.tsx b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useVoipCallAction.tsx index da02cf26e560..9684c2065d29 100644 --- a/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useVoipCallAction.tsx +++ b/apps/meteor/client/views/room/hooks/useUserInfoActions/actions/useVoipCallAction.tsx @@ -35,7 +35,7 @@ export const useVoipCallAction = (user: Pick ({ value: teamId as string, label: { name, avatarETag, type: t, _id }, - })) + })) : [], [data, isSuccess], ); diff --git a/apps/meteor/ee/app/api-enterprise/server/lib/canned-responses.js b/apps/meteor/ee/app/api-enterprise/server/lib/canned-responses.js index f4970914e31a..7bd1ad08c6b4 100644 --- a/apps/meteor/ee/app/api-enterprise/server/lib/canned-responses.js +++ b/apps/meteor/ee/app/api-enterprise/server/lib/canned-responses.js @@ -116,7 +116,7 @@ export async function findAllCannedResponsesFilter({ userId, shortcut, text, dep $in: tags, }, }, - ] + ] : []), ...extraFilter, ], diff --git a/apps/meteor/ee/app/livechat-enterprise/server/api/lib/tags.ts b/apps/meteor/ee/app/livechat-enterprise/server/api/lib/tags.ts index 368130a58100..8ce12521a483 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/api/lib/tags.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/api/lib/tags.ts @@ -104,7 +104,7 @@ export async function findTags({ ...(filteredDepartmentIds.length ? [{ departments: { $in: filteredDepartmentIds } }] : []), ], }, - ] + ] : []), ], }; diff --git a/apps/meteor/ee/app/livechat-enterprise/server/hooks/applySimultaneousChatsRestrictions.ts b/apps/meteor/ee/app/livechat-enterprise/server/hooks/applySimultaneousChatsRestrictions.ts index 6489249d4e24..beca9eb385fb 100644 --- a/apps/meteor/ee/app/livechat-enterprise/server/hooks/applySimultaneousChatsRestrictions.ts +++ b/apps/meteor/ee/app/livechat-enterprise/server/hooks/applySimultaneousChatsRestrictions.ts @@ -43,9 +43,9 @@ callbacks.add( }, { 'queueInfo.chats': { $gte: maxChatsPerSetting } }, ], - } + } : // dummy filter meaning: don't match anything - { _id: '' }; + { _id: '' }; return { $match: { $or: [agentFilter, globalFilter] } }; }, diff --git a/apps/meteor/ee/server/apps/storage/ConfigurableAppSourceStorage.ts b/apps/meteor/ee/server/apps/storage/ConfigurableAppSourceStorage.ts index 42a0b5d3e40c..ee70cd38b409 100644 --- a/apps/meteor/ee/server/apps/storage/ConfigurableAppSourceStorage.ts +++ b/apps/meteor/ee/server/apps/storage/ConfigurableAppSourceStorage.ts @@ -11,7 +11,10 @@ export class ConfigurableAppSourceStorage extends AppSourceStorage { private storage: AppSourceStorage; - constructor(readonly storageType: string, filesystemStoragePath: string) { + constructor( + readonly storageType: string, + filesystemStoragePath: string, + ) { super(); this.filesystem = new AppFileSystemSourceStorage(); diff --git a/apps/meteor/ee/server/local-services/federation/infrastructure/matrix/Bridge.ts b/apps/meteor/ee/server/local-services/federation/infrastructure/matrix/Bridge.ts index ed2ff2e95744..11bfa8e29228 100644 --- a/apps/meteor/ee/server/local-services/federation/infrastructure/matrix/Bridge.ts +++ b/apps/meteor/ee/server/local-services/federation/infrastructure/matrix/Bridge.ts @@ -11,7 +11,10 @@ import type { IFederationBridgeEE, IFederationPublicRoomsResult, IFederationSear const DEFAULT_TIMEOUT_IN_MS = 10000; export class MatrixBridgeEE extends MatrixBridge implements IFederationBridgeEE { - constructor(protected internalSettings: RocketChatSettingsAdapter, protected eventHandler: (event: AbstractMatrixEvent) => void) { + constructor( + protected internalSettings: RocketChatSettingsAdapter, + protected eventHandler: (event: AbstractMatrixEvent) => void, + ) { super(internalSettings, eventHandler); } diff --git a/apps/meteor/ee/server/local-services/instance/getLogger.ts b/apps/meteor/ee/server/local-services/instance/getLogger.ts index bbab1ad28a6f..ef9cbad0aba6 100644 --- a/apps/meteor/ee/server/local-services/instance/getLogger.ts +++ b/apps/meteor/ee/server/local-services/instance/getLogger.ts @@ -25,7 +25,7 @@ export function getLogger({ MOLECULER_LOG_LEVEL: level, NODE_ENV: mode }: Record colorize: true, }, }, - } + } : {}), }, }, diff --git a/apps/meteor/ee/server/models/raw/Users.ts b/apps/meteor/ee/server/models/raw/Users.ts index f7ff7af76c12..20e6e0eb7962 100644 --- a/apps/meteor/ee/server/models/raw/Users.ts +++ b/apps/meteor/ee/server/models/raw/Users.ts @@ -47,7 +47,7 @@ export class UsersEE extends UsersRaw { { $match: { department: { $size: 1 } }, }, - ] + ] : []; return this.col diff --git a/apps/meteor/ee/server/services/package.json b/apps/meteor/ee/server/services/package.json index 686f3b410795..46de5816e5bf 100644 --- a/apps/meteor/ee/server/services/package.json +++ b/apps/meteor/ee/server/services/package.json @@ -28,7 +28,7 @@ "@rocket.chat/string-helpers": "~0.31.25", "@rocket.chat/ui-kit": "workspace:~", "ajv": "^8.17.1", - "bcrypt": "^5.0.1", + "bcrypt": "^5.1.1", "body-parser": "^1.20.3", "colorette": "^2.0.20", "cookie": "^0.5.0", @@ -40,11 +40,11 @@ "mem": "^8.1.1", "moleculer": "^0.14.34", "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", - "nats": "^2.6.1", + "nats": "^2.28.2", "pino": "^8.21.0", "sodium-native": "^3.3.0", "sodium-plus": "^0.9.0", - "uuid": "^8.3.2", + "uuid": "^10.0.0", "ws": "^8.18.0" }, "devDependencies": { diff --git a/apps/meteor/lib/utils/generatePath.ts b/apps/meteor/lib/utils/generatePath.ts index 40c4bab1043c..6a4da96c6ac6 100644 --- a/apps/meteor/lib/utils/generatePath.ts +++ b/apps/meteor/lib/utils/generatePath.ts @@ -3,10 +3,10 @@ import { compile } from 'path-to-regexp'; type PathParams = TPath extends `${string}:${infer TParam}/${infer TRest}` ? (TParam extends `${infer U}?` ? U : TParam) | PathParams : TPath extends `${string}:${infer TParam}` - ? TParam extends `${infer U}?` - ? U - : TParam - : never; + ? TParam extends `${infer U}?` + ? U + : TParam + : never; export function generatePath(path: TPath, params?: Partial, string>>): string { return compile(path, { encode: encodeURIComponent })(params); diff --git a/apps/meteor/package.json b/apps/meteor/package.json index 7a7fb45404f9..3c749eb6cae9 100644 --- a/apps/meteor/package.json +++ b/apps/meteor/package.json @@ -64,25 +64,24 @@ }, "devDependencies": { "@axe-core/playwright": "^4.7.3", - "@babel/core": "~7.25.8", - "@babel/eslint-parser": "~7.25.8", - "@babel/preset-env": "~7.25.8", - "@babel/preset-react": "~7.25.7", - "@babel/register": "~7.25.7", + "@babel/core": "~7.26.0", + "@babel/eslint-parser": "~7.25.9", + "@babel/preset-env": "~7.26.0", + "@babel/preset-react": "~7.25.9", + "@babel/register": "~7.25.9", "@faker-js/faker": "~8.0.2", - "@playwright/test": "^1.40.1", + "@playwright/test": "^1.48.2", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/jest-presets": "workspace:~", "@rocket.chat/livechat": "workspace:^", "@rocket.chat/mock-providers": "workspace:^", - "@storybook/addon-a11y": "^8.3.5", - "@storybook/addon-essentials": "^8.3.5", - "@storybook/addon-interactions": "^8.3.5", + "@storybook/addon-a11y": "^8.3.6", + "@storybook/addon-essentials": "^8.3.6", + "@storybook/addon-interactions": "^8.3.6", "@storybook/addon-styling-webpack": "^1.0.0", "@storybook/addon-webpack5-compiler-babel": "^3.0.3", - "@storybook/react": "^8.3.5", - "@storybook/react-webpack5": "^8.3.5", - "@tanstack/react-query-devtools": "^4.19.1", + "@storybook/react": "^8.3.6", + "@storybook/react-webpack5": "^8.3.6", "@testing-library/react": "~16.0.1", "@testing-library/user-event": "~14.5.2", "@types/adm-zip": "^0.5.5", @@ -178,7 +177,7 @@ "eslint-plugin-import": "~2.26.0", "eslint-plugin-no-floating-promise": "~1.0.2", "eslint-plugin-playwright": "~0.15.3", - "eslint-plugin-prettier": "~4.2.1", + "eslint-plugin-prettier": "~5.2.1", "eslint-plugin-react": "~7.32.2", "eslint-plugin-react-hooks": "~4.6.2", "eslint-plugin-testing-library": "~6.2.2", @@ -199,7 +198,7 @@ "postcss-media-minmax": "^5.0.0", "postcss-nested": "^5.0.6", "postcss-url": "^10.1.3", - "prettier": "~2.8.8", + "prettier": "~3.3.3", "proxyquire": "^2.1.3", "raw-loader": "~4.0.2", "react-docgen-typescript-plugin": "^1.0.8", @@ -215,7 +214,7 @@ "typescript": "~5.6.3" }, "dependencies": { - "@babel/runtime": "~7.25.7", + "@babel/runtime": "~7.26.0", "@bugsnag/js": "~7.20.2", "@bugsnag/plugin-react": "~7.19.0", "@google-cloud/storage": "^6.11.0", @@ -291,8 +290,8 @@ "@rocket.chat/ui-video-conf": "workspace:^", "@rocket.chat/ui-voip": "workspace:^", "@rocket.chat/web-ui-registration": "workspace:^", - "@slack/bolt": "^3.14.0", - "@slack/rtm-api": "^6.0.0", + "@slack/bolt": "^3.22.0", + "@slack/rtm-api": "^6.2.1", "@tanstack/react-query": "^4.36.1", "@vector-im/matrix-bot-sdk": "0.7.1-element.6", "@xmldom/xmldom": "^0.8.10", @@ -303,9 +302,9 @@ "archiver": "^3.1.1", "asterisk-manager": "^0.2.0", "atlassian-crowd-patched": "^0.5.1", - "aws-sdk": "^2.1363.0", + "aws-sdk": "^2.1691.0", "bad-words": "^3.0.4", - "bcrypt": "^5.0.1", + "bcrypt": "^5.1.1", "body-parser": "1.20.3", "bson": "^4.6.4", "busboy": "^1.6.0", @@ -385,7 +384,7 @@ "moment-timezone": "^0.5.46", "mongo-message-queue": "^1.0.0", "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", - "nats": "^2.6.1", + "nats": "^2.28.2", "node-dogstatsd": "^0.0.7", "node-fetch": "2.7.0", "node-gcm": "1.0.5", @@ -416,7 +415,7 @@ "react-virtuoso": "^4.12.0", "sanitize-html": "^2.13.1", "semver": "^7.6.3", - "sharp": "^0.32.6", + "sharp": "^0.33.5", "sip.js": "^0.20.1", "sodium-native": "^3.3.0", "sodium-plus": "^0.9.0", @@ -436,7 +435,7 @@ "universal-perf-hooks": "^1.0.1", "url-polyfill": "^1.1.12", "use-sync-external-store": "^1.2.2", - "uuid": "^8.3.2", + "uuid": "^10.0.0", "webdav": "^4.11.4", "xml-crypto": "~3.1.0", "xml-encryption": "~3.0.2", diff --git a/apps/meteor/playwright.config.ts b/apps/meteor/playwright.config.ts index 822f78e28741..7f1c9dddf507 100644 --- a/apps/meteor/playwright.config.ts +++ b/apps/meteor/playwright.config.ts @@ -60,7 +60,7 @@ export default { environmentId: '1', }, ], - ].filter(Boolean), + ].filter(Boolean) as unknown as PlaywrightTestConfig['reporter'], testDir: 'tests/e2e', testIgnore: 'tests/e2e/federation/**', workers: 1, diff --git a/apps/meteor/server/features/EmailInbox/EmailInbox.ts b/apps/meteor/server/features/EmailInbox/EmailInbox.ts index f9c4422f88e0..5d5db36c3c3d 100644 --- a/apps/meteor/server/features/EmailInbox/EmailInbox.ts +++ b/apps/meteor/server/features/EmailInbox/EmailInbox.ts @@ -43,7 +43,7 @@ export async function configureEmailInboxes(): Promise { tlsOptions: { rejectUnauthorized: false, }, - } + } : {}), }, { diff --git a/apps/meteor/server/features/EmailInbox/EmailInbox_Incoming.ts b/apps/meteor/server/features/EmailInbox/EmailInbox_Incoming.ts index 4de7ec7222f4..27b5c7abd36d 100644 --- a/apps/meteor/server/features/EmailInbox/EmailInbox_Incoming.ts +++ b/apps/meteor/server/features/EmailInbox/EmailInbox_Incoming.ts @@ -140,7 +140,7 @@ export async function onEmailReceived(email: ParsedMail, inbox: string, departme wrapTails: ')', }, skipHtmlDecoding: false, - }).result + }).result : email.text || ''; const rid = room?._id ?? Random.id(); diff --git a/apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts b/apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts index 44a9e2cd6a15..8f4d5e63d6a4 100644 --- a/apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts +++ b/apps/meteor/server/features/EmailInbox/EmailInbox_Outgoing.ts @@ -71,7 +71,7 @@ async function sendEmail(inbox: Inbox, mail: Mail.Options, options?: any): Promi ? { name: inbox.config.senderInfo, address: inbox.config.email, - } + } : inbox.config.email, ...mail, }) diff --git a/apps/meteor/server/lib/dataExport/sendFile.ts b/apps/meteor/server/lib/dataExport/sendFile.ts index 54c691127d9a..552e9f43ecc2 100644 --- a/apps/meteor/server/lib/dataExport/sendFile.ts +++ b/apps/meteor/server/lib/dataExport/sendFile.ts @@ -48,7 +48,7 @@ export const sendFile = async (data: ExportFile, user: IUser): Promise => ...(data.dateFrom && { $gte: data.dateFrom }), ...(data.dateTo && { $lte: data.dateTo }), }, - }; + }; const exportMessages = async (): Promise => { const { fileList } = await exportRoomMessagesToFile(exportPath, assetsPath, exportType, roomsToExport, user, filter, {}, false); diff --git a/apps/meteor/server/lib/logger/logPayloads.ts b/apps/meteor/server/lib/logger/logPayloads.ts index 0e9a23a0a077..67d67b6a68bb 100644 --- a/apps/meteor/server/lib/logger/logPayloads.ts +++ b/apps/meteor/server/lib/logger/logPayloads.ts @@ -19,11 +19,11 @@ export const getMethodArgs = return { arguments: params.map((arg) => (typeof arg !== 'object' ? arg : omit(arg, 'password', 'msg', 'pass', 'username', 'message'))), }; - }; + }; export const getRestPayload = LOG_REST_PAYLOAD === 'false' && LOG_REST_METHOD_PAYLOADS === 'false' ? (): null => null : (payload: unknown): { payload: unknown } => ({ payload, - }); + }); diff --git a/apps/meteor/server/lib/moderation/deleteReportedMessages.ts b/apps/meteor/server/lib/moderation/deleteReportedMessages.ts index 218714d5a8b0..204ae90d8c77 100644 --- a/apps/meteor/server/lib/moderation/deleteReportedMessages.ts +++ b/apps/meteor/server/lib/moderation/deleteReportedMessages.ts @@ -49,13 +49,16 @@ export async function deleteReportedMessages(messages: IMessage[], user: IUser): await Messages.setAsDeletedByIdsAndUser(messageIds, user as any); } - const transformed = messages.reduce((acc, { rid, _id }) => { - if (!acc[rid]) { - acc[rid] = []; - } - acc[rid].push(_id); - return acc; - }, {} as Record); + const transformed = messages.reduce( + (acc, { rid, _id }) => { + if (!acc[rid]) { + acc[rid] = []; + } + acc[rid].push(_id); + return acc; + }, + {} as Record, + ); Object.entries(transformed).forEach(([rid, messageIds]) => { void api.broadcast('notify.deleteMessageBulk', rid, { diff --git a/apps/meteor/server/methods/browseChannels.ts b/apps/meteor/server/methods/browseChannels.ts index 0b02f009672e..5956fa4eaa8c 100644 --- a/apps/meteor/server/methods/browseChannels.ts +++ b/apps/meteor/server/methods/browseChannels.ts @@ -163,9 +163,7 @@ const getTeams = async ( }, ); const results = await Promise.all( - ( - await cursor.toArray() - ).map(async (room) => ({ + (await cursor.toArray()).map(async (room) => ({ ...room, roomsCount: await getChannelsCountForTeam(room.teamId), })), diff --git a/apps/meteor/server/models/raw/BaseRaw.ts b/apps/meteor/server/models/raw/BaseRaw.ts index 2376d84f8980..e1caf93cf3a2 100644 --- a/apps/meteor/server/models/raw/BaseRaw.ts +++ b/apps/meteor/server/models/raw/BaseRaw.ts @@ -37,7 +37,7 @@ const warnFields = process.env.NODE_ENV !== 'production' || process.env.SHOW_WARNINGS === 'true' ? (...rest: any): void => { console.warn(...rest, new Error().stack); - } + } : new Function(); type ModelOptions = { @@ -70,7 +70,12 @@ export abstract class BaseRaw< * @param trash Trash collection instance * @param options Model options */ - constructor(private db: Db, protected name: string, protected trash?: Collection, private options?: ModelOptions) { + constructor( + private db: Db, + protected name: string, + protected trash?: Collection, + private options?: ModelOptions, + ) { this.collectionName = options?.collectionNameResolver ? options.collectionNameResolver(name) : getCollectionName(name); this.col = this.db.collection(this.collectionName, options?.collection || {}); diff --git a/apps/meteor/server/models/raw/LivechatVisitors.ts b/apps/meteor/server/models/raw/LivechatVisitors.ts index 58a56909cb06..5e1880caced4 100644 --- a/apps/meteor/server/models/raw/LivechatVisitors.ts +++ b/apps/meteor/server/models/raw/LivechatVisitors.ts @@ -197,7 +197,7 @@ export class LivechatVisitorsRaw extends BaseRaw implements IL { 'phone.phoneNumber': emailOrPhone, }, - ] + ] : []), ...(nameOrUsername ? [ @@ -207,7 +207,7 @@ export class LivechatVisitorsRaw extends BaseRaw implements IL { username: nameOrUsername, }, - ] + ] : []), ...allowedCustomFields.map((c: string) => ({ [`livechatData.${c}`]: nameOrUsername })), ], diff --git a/apps/meteor/server/models/raw/Messages.ts b/apps/meteor/server/models/raw/Messages.ts index 84013af5b895..52e087c8b2c9 100644 --- a/apps/meteor/server/models/raw/Messages.ts +++ b/apps/meteor/server/models/raw/Messages.ts @@ -37,7 +37,7 @@ type DeepWritable = T extends (...args: any) => any ? T : { -readonly [P in keyof T]: DeepWritable; - }; + }; export class MessagesRaw extends BaseRaw implements IMessagesModel { constructor(db: Db, trash?: Collection>) { diff --git a/apps/meteor/server/models/raw/ModerationReports.ts b/apps/meteor/server/models/raw/ModerationReports.ts index 065f6ec18070..e5fa28340857 100644 --- a/apps/meteor/server/models/raw/ModerationReports.ts +++ b/apps/meteor/server/models/raw/ModerationReports.ts @@ -243,7 +243,7 @@ export class ModerationReportsRaw extends BaseRaw implements $regex: selector, $options: 'i', }, - } + } : {}; const params = { diff --git a/apps/meteor/server/models/raw/Rooms.ts b/apps/meteor/server/models/raw/Rooms.ts index a33e161e0ad5..d49c6bcadc7b 100644 --- a/apps/meteor/server/models/raw/Rooms.ts +++ b/apps/meteor/server/models/raw/Rooms.ts @@ -204,7 +204,7 @@ export class RoomsRaw extends BaseRaw implements IRoomsModel { ...(discussion ? [{ prid: { $exists: true } }] : []), ...(teams ? [{ teamMain: { $exists: true } }] : []), ], - } + } : {}, ], ...(!discussion ? { prid: { $exists: false } } : {}), @@ -771,7 +771,7 @@ export class RoomsRaw extends BaseRaw implements IRoomsModel { $in: roomIds, }, }, - ] + ] : []), ], }, @@ -787,7 +787,7 @@ export class RoomsRaw extends BaseRaw implements IRoomsModel { }, ], }, - ] + ] : []), ], }; @@ -1153,12 +1153,12 @@ export class RoomsRaw extends BaseRaw implements IRoomsModel { $set: { sysMes: systemMessages, }, - } + } : { $unset: { sysMes: '', }, - }; + }; return this.updateOne(query, update); } @@ -1331,7 +1331,7 @@ export class RoomsRaw extends BaseRaw implements IRoomsModel { includeFederatedRooms ? { $or: [{ $and: [{ $or: [{ federated: { $exists: false } }, { federated: false }], name }] }, { federated: true, fname: name }], - } + } : { $or: [{ federated: { $exists: false } }, { federated: false }], name }, ], }; @@ -1388,7 +1388,7 @@ export class RoomsRaw extends BaseRaw implements IRoomsModel { { $and: [{ $or: [{ federated: { $exists: false } }, { federated: false }] }, nameCondition] }, { federated: true, fname: name }, ], - } + } : { $and: [{ $or: [{ federated: { $exists: false } }, { federated: false }] }, nameCondition] }, ], }; diff --git a/apps/meteor/server/models/raw/Subscriptions.ts b/apps/meteor/server/models/raw/Subscriptions.ts index 7d3eda60edd3..d1e2ba6e945c 100644 --- a/apps/meteor/server/models/raw/Subscriptions.ts +++ b/apps/meteor/server/models/raw/Subscriptions.ts @@ -414,10 +414,13 @@ export class SubscriptionsRaw extends BaseRaw implements ISubscri options: AggregateOptions = {}, ): Promise { const termRegex = new RegExp((startsWith ? '^' : '') + escapeRegExp(searchTerm) + (endsWith ? '$' : ''), 'i'); - const orStatement = searchFields.reduce((acc, el) => { - acc.push({ [el.trim()]: termRegex }); - return acc; - }, [] as { [x: string]: RegExp }[]); + const orStatement = searchFields.reduce( + (acc, el) => { + acc.push({ [el.trim()]: termRegex }); + return acc; + }, + [] as { [x: string]: RegExp }[], + ); return this.col .aggregate( @@ -935,12 +938,12 @@ export class SubscriptionsRaw extends BaseRaw implements ISubscri $set: { hideMentionStatus, }, - } + } : { $unset: { hideMentionStatus: 1, }, - }; + }; return this.updateOne(query, update); } diff --git a/apps/meteor/server/models/raw/Users.js b/apps/meteor/server/models/raw/Users.js index 1c0c2abecf64..a5a2c7288577 100644 --- a/apps/meteor/server/models/raw/Users.js +++ b/apps/meteor/server/models/raw/Users.js @@ -2752,12 +2752,12 @@ export class UsersRaw extends BaseRaw { $set: { bio, }, - } + } : { $unset: { bio: 1, }, - }), + }), }; return this.updateOne({ _id }, update); } @@ -2769,12 +2769,12 @@ export class UsersRaw extends BaseRaw { $set: { nickname, }, - } + } : { $unset: { nickname: 1, }, - }), + }), }; return this.updateOne({ _id }, update); } diff --git a/apps/meteor/server/models/raw/VideoConference.ts b/apps/meteor/server/models/raw/VideoConference.ts index 4c324d938e2a..5d18d9892038 100644 --- a/apps/meteor/server/models/raw/VideoConference.ts +++ b/apps/meteor/server/models/raw/VideoConference.ts @@ -190,12 +190,12 @@ export class VideoConferenceRaw extends BaseRaw implements IVid $set: { providerData, }, - } + } : { $unset: { providerData: 1 as const, }, - }), + }), }); } diff --git a/apps/meteor/server/services/federation/infrastructure/matrix/Bridge.ts b/apps/meteor/server/services/federation/infrastructure/matrix/Bridge.ts index bd30f23ed095..d89da959e5a3 100644 --- a/apps/meteor/server/services/federation/infrastructure/matrix/Bridge.ts +++ b/apps/meteor/server/services/federation/infrastructure/matrix/Bridge.ts @@ -33,7 +33,10 @@ export class MatrixBridge implements IFederationBridge { protected isUpdatingBridgeStatus = false; - constructor(protected internalSettings: RocketChatSettingsAdapter, protected eventHandler: (event: AbstractMatrixEvent) => void) {} // eslint-disable-line no-empty-function + constructor( + protected internalSettings: RocketChatSettingsAdapter, + protected eventHandler: (event: AbstractMatrixEvent) => void, + ) {} // eslint-disable-line no-empty-function public async start(): Promise { if (this.isUpdatingBridgeStatus) { @@ -102,7 +105,7 @@ export class MatrixBridge implements IFederationBridge { ...(externalInformation.avatar_url ? { avatarUrl: externalInformation.avatar_url, - } + } : {}), }; } catch (err) { @@ -777,7 +780,7 @@ export class MatrixBridge implements IFederationBridge { const event = request.getData() as unknown as AbstractMatrixEvent; this.eventHandler(event); }, - } + } : {}), }, }); diff --git a/apps/meteor/server/services/federation/infrastructure/matrix/converters/room/RoomReceiver.ts b/apps/meteor/server/services/federation/infrastructure/matrix/converters/room/RoomReceiver.ts index 38423ec3ed4e..1a5e444c6e90 100644 --- a/apps/meteor/server/services/federation/infrastructure/matrix/converters/room/RoomReceiver.ts +++ b/apps/meteor/server/services/federation/infrastructure/matrix/converters/room/RoomReceiver.ts @@ -181,11 +181,11 @@ const createExternalRolesChangesActions = ( ? [ { action: 'add', role: ROCKET_CHAT_FEDERATION_ROLES.OWNER }, { action: 'remove', role: ROCKET_CHAT_FEDERATION_ROLES.MODERATOR }, - ] + ] : [ { action: 'add', role: ROCKET_CHAT_FEDERATION_ROLES.MODERATOR }, { action: 'remove', role: ROCKET_CHAT_FEDERATION_ROLES.OWNER }, - ]; + ]; return externalRolesChangesByUser; }, {} as IExternalRolesChangesToApplyInputDto); @@ -291,10 +291,10 @@ export class MatrixRoomReceiverConverter { replyToEventId: !externalEvent.content?.['m.relates_to']?.is_falling_back ? externalEvent.content?.['m.relates_to']?.['m.in_reply_to']?.event_id : undefined, - } + } : { replyToEventId: externalEvent.content?.['m.relates_to']?.['m.in_reply_to']?.event_id, - }), + }), }); } @@ -343,10 +343,10 @@ export class MatrixRoomReceiverConverter { replyToEventId: !externalEvent.content?.['m.relates_to']?.is_falling_back ? externalEvent.content?.['m.relates_to']?.['m.in_reply_to']?.event_id : undefined, - } + } : { replyToEventId: externalEvent.content?.['m.relates_to']?.['m.in_reply_to']?.event_id, - }), + }), }); } diff --git a/apps/meteor/server/services/federation/infrastructure/matrix/handlers/Room.ts b/apps/meteor/server/services/federation/infrastructure/matrix/handlers/Room.ts index 94a4efa4caeb..2f2c06c096ba 100644 --- a/apps/meteor/server/services/federation/infrastructure/matrix/handlers/Room.ts +++ b/apps/meteor/server/services/federation/infrastructure/matrix/handlers/Room.ts @@ -28,7 +28,10 @@ export class MatrixRoomCreatedHandler extends MatrixBaseEventHandler { export class MatrixRoomMembershipChangedHandler extends MatrixBaseEventHandler { public eventType: string = MatrixEventType.ROOM_MEMBERSHIP_CHANGED; - constructor(private roomService: FederationRoomServiceReceiver, private rocketSettingsAdapter: RocketChatSettingsAdapter) { + constructor( + private roomService: FederationRoomServiceReceiver, + private rocketSettingsAdapter: RocketChatSettingsAdapter, + ) { super(); } diff --git a/apps/meteor/server/services/team/service.ts b/apps/meteor/server/services/team/service.ts index 85da5cb68a17..b04d148bda0d 100644 --- a/apps/meteor/server/services/team/service.ts +++ b/apps/meteor/server/services/team/service.ts @@ -66,7 +66,7 @@ export class TeamService extends ServiceClassInternal implements ITeamService { ? [] : await Users.findActiveByIdsOrUsernames(members, { projection: { username: 1 }, - }).toArray(); + }).toArray(); const memberUsernames = membersResult.map(({ username }) => username); const memberIds = membersResult.map(({ _id }) => _id); @@ -810,7 +810,7 @@ export class TeamService extends ServiceClassInternal implements ITeamService { uid !== member.userId && byUser ? { byUser, - } + } : undefined, ); } diff --git a/apps/meteor/tests/data/permissions.helper.ts b/apps/meteor/tests/data/permissions.helper.ts index 535c1d404b6e..7893c0f11620 100644 --- a/apps/meteor/tests/data/permissions.helper.ts +++ b/apps/meteor/tests/data/permissions.helper.ts @@ -68,7 +68,7 @@ export const updateEESetting = (setting: string, value: ISetting['value']): Prom .expect('Content-Type', 'application/json') .expect(200) .end((err?: Error) => setTimeout(() => (!err && resolve()) || reject(err), 100)); - }) + }) : Promise.resolve(); export const removePermissions = async (perms: string[]) => { diff --git a/apps/meteor/tests/e2e/fixtures/userStates.ts b/apps/meteor/tests/e2e/fixtures/userStates.ts index 252023eae73c..5b42551c65f8 100644 --- a/apps/meteor/tests/e2e/fixtures/userStates.ts +++ b/apps/meteor/tests/e2e/fixtures/userStates.ts @@ -107,7 +107,7 @@ function generateContext(username: string): IUserState { name: 'private_key', value: e2eeData[username]?.client.private_key, }, - ] + ] : []), ], }, diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts index e52ae45782c8..cd6b5668d394 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-livechat.ts @@ -7,7 +7,10 @@ import { expect } from '../utils/test'; export class OmnichannelLiveChat { readonly page: Page; - constructor(page: Page, private readonly api: { get(url: string): Promise }) { + constructor( + page: Page, + private readonly api: { get(url: string): Promise }, + ) { this.page = page; } diff --git a/apps/meteor/tests/e2e/page-objects/omnichannel-tags.ts b/apps/meteor/tests/e2e/page-objects/omnichannel-tags.ts index f283473505cf..48e724d217bf 100644 --- a/apps/meteor/tests/e2e/page-objects/omnichannel-tags.ts +++ b/apps/meteor/tests/e2e/page-objects/omnichannel-tags.ts @@ -44,11 +44,11 @@ export class OmnichannelTags extends OmnichannelAdministration { } btnDeleteByName(name: string): Locator { - return this.page.locator(`role=link[name="${name} Remove"] >> role=button`); + return this.page.getByRole('link', { name }).getByRole('button'); } findRowByName(name: string): Locator { - return this.page.locator(`tr:has-text("${name}")`); + return this.page.getByRole('link', { name }); } get inputDepartments(): Locator { diff --git a/apps/meteor/tests/end-to-end/api/chat.ts b/apps/meteor/tests/end-to-end/api/chat.ts index 9e55fb168e4c..cea8018b90ec 100644 --- a/apps/meteor/tests/end-to-end/api/chat.ts +++ b/apps/meteor/tests/end-to-end/api/chat.ts @@ -1197,9 +1197,10 @@ describe('[Chat]', () => { .expect(statusCode) .expect(testCb); - await (customFields - ? request.post(api(`rooms.upload/${testChannel._id}`)).field('customFields', JSON.stringify(customFields)) - : request.post(api(`rooms.upload/${testChannel._id}`)) + await ( + customFields + ? request.post(api(`rooms.upload/${testChannel._id}`)).field('customFields', JSON.stringify(customFields)) + : request.post(api(`rooms.upload/${testChannel._id}`)) ) .set(credentials) .attach('file', imgURL) diff --git a/apps/meteor/tests/end-to-end/api/users.ts b/apps/meteor/tests/end-to-end/api/users.ts index 87a27ecedfb4..87e4bd673323 100644 --- a/apps/meteor/tests/end-to-end/api/users.ts +++ b/apps/meteor/tests/end-to-end/api/users.ts @@ -91,7 +91,7 @@ const setRoomConfig = ({ roomId, favorite, isDefault }: { roomId: IRoom['_id']; ? { defaultValue: true, favorite: false, - } + } : undefined, }); }; diff --git a/apps/meteor/tests/unit/app/settings/server/functions/settings.tests.ts b/apps/meteor/tests/unit/app/settings/server/functions/settings.tests.ts index 5f5001c0251d..9775e36da035 100644 --- a/apps/meteor/tests/unit/app/settings/server/functions/settings.tests.ts +++ b/apps/meteor/tests/unit/app/settings/server/functions/settings.tests.ts @@ -586,13 +586,16 @@ describe('Settings', () => { settings.watch('setting_callback', spiedCallback1, { debounce: 10 }); settings.watchByRegex(/setting_callback/, spiedCallback2, { debounce: 10 }); - setTimeout(() => { - expect(spiedCallback1).to.have.been.called.exactly(1); - expect(spiedCallback2).to.have.been.called.exactly(1); - expect(spiedCallback1).to.have.been.called.always.with('value1'); - expect(spiedCallback2).to.have.been.called.always.with('setting_callback', 'value1'); - resolve(); - }, settings.getConfig({ debounce: 10 }).debounce); + setTimeout( + () => { + expect(spiedCallback1).to.have.been.called.exactly(1); + expect(spiedCallback2).to.have.been.called.exactly(1); + expect(spiedCallback1).to.have.been.called.always.with('value1'); + expect(spiedCallback2).to.have.been.called.always.with('setting_callback', 'value1'); + resolve(); + }, + settings.getConfig({ debounce: 10 }).debounce, + ); }); }); @@ -615,16 +618,22 @@ describe('Settings', () => { }); }); }); - setTimeout(() => { - Settings.updateValueById('setting_callback', 'value3'); - setTimeout(() => { - expect(spiedCallback1).to.have.been.called.exactly(2); - expect(spiedCallback2).to.have.been.called.exactly(2); - expect(spiedCallback1).to.have.been.called.with('value2'); - expect(spiedCallback1).to.have.been.called.with('value3'); - resolve(); - }, settings.getConfig({ debounce: 10 }).debounce); - }, settings.getConfig({ debounce: 10 }).debounce); + setTimeout( + () => { + Settings.updateValueById('setting_callback', 'value3'); + setTimeout( + () => { + expect(spiedCallback1).to.have.been.called.exactly(2); + expect(spiedCallback2).to.have.been.called.exactly(2); + expect(spiedCallback1).to.have.been.called.with('value2'); + expect(spiedCallback1).to.have.been.called.with('value3'); + resolve(); + }, + settings.getConfig({ debounce: 10 }).debounce, + ); + }, + settings.getConfig({ debounce: 10 }).debounce, + ); }); }); diff --git a/ee/apps/account-service/package.json b/ee/apps/account-service/package.json index ec8bab0ec527..9888a97f701e 100644 --- a/ee/apps/account-service/package.json +++ b/ee/apps/account-service/package.json @@ -26,7 +26,7 @@ "@rocket.chat/tools": "workspace:^", "@rocket.chat/tracing": "workspace:^", "@types/node": "~20.16.12", - "bcrypt": "^5.0.1", + "bcrypt": "^5.1.1", "ejson": "^2.2.3", "event-loop-stats": "^1.4.1", "eventemitter3": "^4.0.7", @@ -34,10 +34,10 @@ "mem": "^8.1.1", "moleculer": "^0.14.34", "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", - "nats": "^2.4.0", + "nats": "^2.28.2", "pino": "^8.21.0", "polka": "^0.5.2", - "uuid": "^9.0.1" + "uuid": "^10.0.0" }, "devDependencies": { "@rocket.chat/eslint-config": "workspace:^", diff --git a/ee/apps/authorization-service/package.json b/ee/apps/authorization-service/package.json index c256eef466e1..364f2d745117 100644 --- a/ee/apps/authorization-service/package.json +++ b/ee/apps/authorization-service/package.json @@ -32,7 +32,7 @@ "mem": "^8.1.1", "moleculer": "^0.14.34", "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", - "nats": "^2.4.0", + "nats": "^2.28.2", "pino": "^8.21.0", "polka": "^0.5.2" }, diff --git a/ee/apps/ddp-streamer/package.json b/ee/apps/ddp-streamer/package.json index d4f15fedcc02..5076ffcc765b 100644 --- a/ee/apps/ddp-streamer/package.json +++ b/ee/apps/ddp-streamer/package.json @@ -35,12 +35,12 @@ "mem": "^8.1.1", "moleculer": "^0.14.34", "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", - "nats": "^2.4.0", + "nats": "^2.28.2", "pino": "^8.21.0", "polka": "^0.5.2", "sharp": "^0.32.6", "underscore": "^1.13.7", - "uuid": "^7.0.3", + "uuid": "^10.0.0", "ws": "^8.18.0" }, "devDependencies": { @@ -52,7 +52,6 @@ "@types/meteor": "^2.9.8", "@types/node": "~20.16.12", "@types/polka": "^0.5.7", - "@types/sharp": "^0.30.5", "@types/uuid": "^8.3.4", "@types/ws": "^8.5.12", "eslint": "~8.45.0", diff --git a/ee/apps/ddp-streamer/src/Client.ts b/ee/apps/ddp-streamer/src/Client.ts index 83bc851bd485..fb75af64b3da 100644 --- a/ee/apps/ddp-streamer/src/Client.ts +++ b/ee/apps/ddp-streamer/src/Client.ts @@ -73,7 +73,11 @@ export class Client extends EventEmitter { public userToken?: string; - constructor(public ws: WebSocket, public meteorClient = false, req: IncomingMessage) { + constructor( + public ws: WebSocket, + public meteorClient = false, + req: IncomingMessage, + ) { super(); this.connection = { diff --git a/ee/apps/ddp-streamer/src/Publication.ts b/ee/apps/ddp-streamer/src/Publication.ts index 71874b942ee4..d9d890027ad6 100644 --- a/ee/apps/ddp-streamer/src/Publication.ts +++ b/ee/apps/ddp-streamer/src/Publication.ts @@ -11,7 +11,11 @@ export class Publication extends EventEmitter implements IPublication { connection: IPublication['connection']; - constructor(public client: Client, private packet: IPacket, private server: Server) { + constructor( + public client: Client, + private packet: IPacket, + private server: Server, + ) { super(); this.packet = packet; client.subscriptions.set(packet.id, this); diff --git a/ee/apps/omnichannel-transcript/package.json b/ee/apps/omnichannel-transcript/package.json index 1379e50887de..edc23819e05f 100644 --- a/ee/apps/omnichannel-transcript/package.json +++ b/ee/apps/omnichannel-transcript/package.json @@ -38,7 +38,7 @@ "moment-timezone": "^0.5.46", "mongo-message-queue": "^1.0.0", "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", - "nats": "^2.4.0", + "nats": "^2.28.2", "pino": "^8.21.0", "polka": "^0.5.2" }, diff --git a/ee/apps/presence-service/package.json b/ee/apps/presence-service/package.json index 15ef170ee00c..9f8f5eda8007 100644 --- a/ee/apps/presence-service/package.json +++ b/ee/apps/presence-service/package.json @@ -32,7 +32,7 @@ "mem": "^8.1.1", "moleculer": "^0.14.34", "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", - "nats": "^2.4.0", + "nats": "^2.28.2", "pino": "^8.21.0", "polka": "^0.5.2" }, diff --git a/ee/apps/queue-worker/package.json b/ee/apps/queue-worker/package.json index c8eb123eb4ce..60d5fb81a56a 100644 --- a/ee/apps/queue-worker/package.json +++ b/ee/apps/queue-worker/package.json @@ -35,7 +35,7 @@ "moment-timezone": "^0.5.46", "mongo-message-queue": "^1.0.0", "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", - "nats": "^2.4.0", + "nats": "^2.28.2", "pino": "^8.21.0", "polka": "^0.5.2" }, diff --git a/ee/apps/stream-hub-service/package.json b/ee/apps/stream-hub-service/package.json index a09656c1391e..c2d83504f3b3 100644 --- a/ee/apps/stream-hub-service/package.json +++ b/ee/apps/stream-hub-service/package.json @@ -32,7 +32,7 @@ "mem": "^8.1.1", "moleculer": "^0.14.34", "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", - "nats": "^2.4.0", + "nats": "^2.28.2", "pino": "^8.21.0", "polka": "^0.5.2" }, diff --git a/ee/apps/stream-hub-service/src/StreamHub.ts b/ee/apps/stream-hub-service/src/StreamHub.ts index a1316200ca5a..4d0fffb57049 100755 --- a/ee/apps/stream-hub-service/src/StreamHub.ts +++ b/ee/apps/stream-hub-service/src/StreamHub.ts @@ -10,7 +10,10 @@ export class StreamHub extends ServiceClass implements IServiceClass { private logger: Logger; - constructor(private watcher: DatabaseWatcher, loggerClass: typeof Logger) { + constructor( + private watcher: DatabaseWatcher, + loggerClass: typeof Logger, + ) { super(); // eslint-disable-next-line new-cap diff --git a/ee/packages/license/package.json b/ee/packages/license/package.json index a84d2ffe7621..ad67001012c3 100644 --- a/ee/packages/license/package.json +++ b/ee/packages/license/package.json @@ -32,6 +32,6 @@ "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/jwt": "workspace:^", "@rocket.chat/logger": "workspace:^", - "bcrypt": "^5.0.1" + "bcrypt": "^5.1.1" } } diff --git a/ee/packages/license/src/license.ts b/ee/packages/license/src/license.ts index beb13a63e83d..99433ca1a8e1 100644 --- a/ee/packages/license/src/license.ts +++ b/ee/packages/license/src/license.ts @@ -357,10 +357,10 @@ export class LicenseManager extends Emitter { limits: [limit], }), ['prevent_action'], - ) + ) : isBehaviorsInResult(await validateDefaultLimits.call(this, { behaviors: ['prevent_action'], limits: [limit] }), [ 'prevent_action', - ]); + ]); this.shouldPreventActionResults.set(limit as LicenseLimitKind, fresh); @@ -434,7 +434,7 @@ export class LicenseManager extends Emitter { reason: 'limit', limit: action, } as BehaviorWithContext, - ]; + ]; if (this.consolidateBehaviorState(action, 'prevent_action', shouldPreventAction)) { this.triggerBehaviorEventsToggled(eventsToEmit); diff --git a/ee/packages/license/src/v2/convertToV3.ts b/ee/packages/license/src/v2/convertToV3.ts index 539bf10062e3..cf135452ed8c 100644 --- a/ee/packages/license/src/v2/convertToV3.ts +++ b/ee/packages/license/src/v2/convertToV3.ts @@ -29,7 +29,7 @@ export const convertToV3 = (v2: ILicenseV2): ILicenseV3 => { name: tag, color: getTagColor(tag), })), - ], + ], }, validation: { serverUrls: [ @@ -65,7 +65,7 @@ export const convertToV3 = (v2: ILicenseV2): ILicenseV3 => { behavior: 'prevent_action', }, ], - } + } : {}), ...(v2.maxGuestUsers ? { @@ -75,7 +75,7 @@ export const convertToV3 = (v2: ILicenseV2): ILicenseV3 => { behavior: 'prevent_action', }, ], - } + } : {}), ...(v2.maxRoomsPerGuest ? { @@ -85,7 +85,7 @@ export const convertToV3 = (v2: ILicenseV2): ILicenseV3 => { behavior: 'prevent_action', }, ], - } + } : {}), ...(v2.apps?.maxPrivateApps ? { @@ -95,7 +95,7 @@ export const convertToV3 = (v2: ILicenseV2): ILicenseV3 => { behavior: 'prevent_action', }, ], - } + } : {}), ...(v2.apps?.maxMarketplaceApps ? { @@ -105,7 +105,7 @@ export const convertToV3 = (v2: ILicenseV2): ILicenseV3 => { behavior: 'prevent_action', }, ], - } + } : {}), }, cloudMeta: v2.meta, diff --git a/ee/packages/network-broker/src/EnterpriseCheck.ts b/ee/packages/network-broker/src/EnterpriseCheck.ts index ca8cd1e25b10..5f849a4d193b 100644 --- a/ee/packages/network-broker/src/EnterpriseCheck.ts +++ b/ee/packages/network-broker/src/EnterpriseCheck.ts @@ -39,25 +39,28 @@ export const EnterpriseCheck: ServiceSchema = { }, }, async started(): Promise { - setInterval(async () => { - try { - const hasLicense = await this.broker.call('license.hasValidLicense', ['scalability']); - if (hasLicense) { - checkFails = 0; - return; + setInterval( + async () => { + try { + const hasLicense = await this.broker.call('license.hasValidLicense', ['scalability']); + if (hasLicense) { + checkFails = 0; + return; + } + } catch (e: unknown) { + // check failed, so continue } - } catch (e: unknown) { - // check failed, so continue - } - if (++checkFails < maxFails) { - return; - } + if (++checkFails < maxFails) { + return; + } - const shouldShutdown = await this.shouldShutdown(); - if (shouldShutdown) { - this.broker.fatal('Enterprise license not found. Shutting down...'); - } - }, (parseInt(LICENSE_CHECK_INTERVAL) || 20) * 1000); + const shouldShutdown = await this.shouldShutdown(); + if (shouldShutdown) { + this.broker.fatal('Enterprise license not found. Shutting down...'); + } + }, + (parseInt(LICENSE_CHECK_INTERVAL) || 20) * 1000, + ); }, }; diff --git a/ee/packages/network-broker/src/NetworkBroker.ts b/ee/packages/network-broker/src/NetworkBroker.ts index 2da77dfa7dca..e6e1cdf3a2e2 100644 --- a/ee/packages/network-broker/src/NetworkBroker.ts +++ b/ee/packages/network-broker/src/NetworkBroker.ts @@ -95,10 +95,10 @@ export class NetworkBroker implements IBroker { ? (ctx: Context): void => { // internal events params are not an array instance.emit(eventName, ctx.params as Parameters); - } + } : (ctx: Context): void => { instance.emit(eventName, ...(ctx.params as Parameters)); - }; + }; return map; }, {}), }; diff --git a/ee/packages/network-broker/src/index.ts b/ee/packages/network-broker/src/index.ts index 8dcd99dac07d..4424c084bdaa 100644 --- a/ee/packages/network-broker/src/index.ts +++ b/ee/packages/network-broker/src/index.ts @@ -102,7 +102,7 @@ const network = new ServiceBroker({ colorize: true, }, }, - } + } : {}), }, }, diff --git a/ee/packages/omnichannel-services/src/QueueWorker.ts b/ee/packages/omnichannel-services/src/QueueWorker.ts index 2b59ba9421c3..5908512404a2 100644 --- a/ee/packages/omnichannel-services/src/QueueWorker.ts +++ b/ee/packages/omnichannel-services/src/QueueWorker.ts @@ -19,7 +19,10 @@ export class QueueWorker extends ServiceClass implements IQueueWorkerService { private queueStarted = false; - constructor(private readonly db: Db, loggerClass: typeof Logger) { + constructor( + private readonly db: Db, + loggerClass: typeof Logger, + ) { super(); // eslint-disable-next-line new-cap diff --git a/ee/packages/pdf-worker/package.json b/ee/packages/pdf-worker/package.json index f73b2d5cde98..dcc21610f051 100644 --- a/ee/packages/pdf-worker/package.json +++ b/ee/packages/pdf-worker/package.json @@ -29,10 +29,10 @@ }, "devDependencies": { "@rocket.chat/jest-presets": "workspace:~", - "@storybook/addon-essentials": "^8.3.5", + "@storybook/addon-essentials": "^8.3.6", "@storybook/addon-webpack5-compiler-babel": "^3.0.3", - "@storybook/react": "^8.3.5", - "@storybook/react-webpack5": "^8.3.5", + "@storybook/react": "^8.3.6", + "@storybook/react-webpack5": "^8.3.6", "@testing-library/react": "~16.0.1", "@types/emojione": "^2.2.9", "@types/jest": "~29.5.14", diff --git a/ee/packages/pdf-worker/src/strategies/ChatTranscript.ts b/ee/packages/pdf-worker/src/strategies/ChatTranscript.ts index e7cb12d0f418..3a6567509615 100644 --- a/ee/packages/pdf-worker/src/strategies/ChatTranscript.ts +++ b/ee/packages/pdf-worker/src/strategies/ChatTranscript.ts @@ -22,7 +22,7 @@ export class ChatTranscript implements IStrategy { ...quote, ts: moment(quote.ts).tz(timezone).format(timeAndDateFormat), }; - }) + }) : undefined; if (isDivider) { diff --git a/ee/packages/presence/package.json b/ee/packages/presence/package.json index 38e024c70fc5..f193cfc0eb99 100644 --- a/ee/packages/presence/package.json +++ b/ee/packages/presence/package.json @@ -3,14 +3,14 @@ "version": "0.2.9-rc.5", "private": true, "devDependencies": { - "@babel/core": "~7.25.8", - "@babel/preset-env": "~7.25.8", - "@babel/preset-typescript": "~7.25.7", + "@babel/core": "~7.26.0", + "@babel/preset-env": "~7.26.0", + "@babel/preset-typescript": "~7.26.0", "@rocket.chat/apps-engine": "workspace:^", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/rest-typings": "workspace:^", "@types/node": "~20.16.12", - "babel-jest": "^29.0.3", + "babel-jest": "^29.7.0", "eslint": "~8.45.0", "jest": "~29.7.0", "typescript": "~5.6.3" diff --git a/package.json b/package.json index d4ff12230575..9afc59659259 100644 --- a/package.json +++ b/package.json @@ -17,11 +17,11 @@ "fossify": "TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' ts-node scripts/fossify.ts" }, "devDependencies": { - "@changesets/cli": "^2.26.2", + "@changesets/cli": "^2.27.9", "@types/chart.js": "^2.9.41", "@types/js-yaml": "^4.0.9", "ts-node": "^10.9.2", - "turbo": "^2.1.3" + "turbo": "^2.2.3" }, "workspaces": [ "apps/*", diff --git a/packages/api-client/src/index.ts b/packages/api-client/src/index.ts index a11e032e91b2..8771176ecff1 100644 --- a/packages/api-client/src/index.ts +++ b/packages/api-client/src/index.ts @@ -201,7 +201,7 @@ export class RestClient implements RestClientInterface { ? { 'X-User-Id': credentials['X-User-Id'], 'X-Auth-Token': credentials['X-Auth-Token'], - } + } : {}; } diff --git a/packages/apps-engine/package.json b/packages/apps-engine/package.json index e5561a086d66..2306f7317788 100644 --- a/packages/apps-engine/package.json +++ b/packages/apps-engine/package.json @@ -102,7 +102,7 @@ "lodash.clonedeep": "^4.5.0", "semver": "^7.6.3", "stack-trace": "0.0.10", - "uuid": "~8.3.2" + "uuid": "~10.0.0" }, "nyc": { "include": [ diff --git a/packages/apps-engine/src/client/AppClientManager.ts b/packages/apps-engine/src/client/AppClientManager.ts index 5d409f148f5f..7cb2ed3d5207 100644 --- a/packages/apps-engine/src/client/AppClientManager.ts +++ b/packages/apps-engine/src/client/AppClientManager.ts @@ -5,7 +5,10 @@ import { AppsEngineUIHost } from './AppsEngineUIHost'; export class AppClientManager { private apps: Array; - constructor(private readonly appsEngineUIHost: AppsEngineUIHost, private readonly communicator?: AppServerCommunicator) { + constructor( + private readonly appsEngineUIHost: AppsEngineUIHost, + private readonly communicator?: AppServerCommunicator, + ) { if (!(appsEngineUIHost instanceof AppsEngineUIHost)) { throw new Error('The appClientUIHost must extend appClientUIHost'); } diff --git a/packages/apps-engine/src/definition/App.ts b/packages/apps-engine/src/definition/App.ts index 0044f35134b6..dd93ba984b74 100644 --- a/packages/apps-engine/src/definition/App.ts +++ b/packages/apps-engine/src/definition/App.ts @@ -28,7 +28,11 @@ export abstract class App implements IApp { * Also, please use the `initialize()` method to do items instead of the constructor as the constructor * *might* be called more than once but the `initialize()` will only be called once. */ - public constructor(private readonly info: IAppInfo, private readonly logger: ILogger, private readonly accessors?: IAppAccessors) { + public constructor( + private readonly info: IAppInfo, + private readonly logger: ILogger, + private readonly accessors?: IAppAccessors, + ) { this.logger.debug( `Constructed the App ${this.info.name} (${this.info.id})`, `v${this.info.version} which depends on the API v${this.info.requiredApiVersion}!`, diff --git a/packages/apps-engine/src/definition/metadata/RocketChatAssociations.ts b/packages/apps-engine/src/definition/metadata/RocketChatAssociations.ts index 7568488546b6..5191882cf3ae 100644 --- a/packages/apps-engine/src/definition/metadata/RocketChatAssociations.ts +++ b/packages/apps-engine/src/definition/metadata/RocketChatAssociations.ts @@ -10,7 +10,10 @@ export enum RocketChatAssociationModel { } export class RocketChatAssociationRecord { - constructor(private model: RocketChatAssociationModel, private id: string) {} + constructor( + private model: RocketChatAssociationModel, + private id: string, + ) {} public getModel() { return this.model; diff --git a/packages/apps-engine/src/definition/slashcommands/SlashCommandContext.ts b/packages/apps-engine/src/definition/slashcommands/SlashCommandContext.ts index c5d96e613f4d..106b87cc7405 100644 --- a/packages/apps-engine/src/definition/slashcommands/SlashCommandContext.ts +++ b/packages/apps-engine/src/definition/slashcommands/SlashCommandContext.ts @@ -6,7 +6,13 @@ import type { IUser } from '../users'; * executes a slash command. */ export class SlashCommandContext { - constructor(private sender: IUser, private room: IRoom, private params: Array, private threadId?: string, private triggerId?: string) {} + constructor( + private sender: IUser, + private room: IRoom, + private params: Array, + private threadId?: string, + private triggerId?: string, + ) {} /** The user who sent the command. */ public getSender(): IUser { diff --git a/packages/apps-engine/src/server/ProxiedApp.ts b/packages/apps-engine/src/server/ProxiedApp.ts index e2605c8375de..a63ba3396369 100644 --- a/packages/apps-engine/src/server/ProxiedApp.ts +++ b/packages/apps-engine/src/server/ProxiedApp.ts @@ -15,7 +15,11 @@ export class ProxiedApp { private latestLicenseValidationResult: AppLicenseValidationResult; - constructor(private readonly manager: AppManager, private storageItem: IAppStorageItem, private readonly appRuntime: DenoRuntimeSubprocessController) { + constructor( + private readonly manager: AppManager, + private storageItem: IAppStorageItem, + private readonly appRuntime: DenoRuntimeSubprocessController, + ) { this.previousStatus = storageItem.status; } diff --git a/packages/apps-engine/src/server/accessors/ApiExtend.ts b/packages/apps-engine/src/server/accessors/ApiExtend.ts index 4c8951338a90..001fc36d8028 100644 --- a/packages/apps-engine/src/server/accessors/ApiExtend.ts +++ b/packages/apps-engine/src/server/accessors/ApiExtend.ts @@ -3,7 +3,10 @@ import type { IApi } from '../../definition/api'; import type { AppApiManager } from '../managers/AppApiManager'; export class ApiExtend implements IApiExtend { - constructor(private readonly manager: AppApiManager, private readonly appId: string) {} + constructor( + private readonly manager: AppApiManager, + private readonly appId: string, + ) {} public provideApi(api: IApi): Promise { return Promise.resolve(this.manager.addApi(this.appId, api)); diff --git a/packages/apps-engine/src/server/accessors/AppAccessors.ts b/packages/apps-engine/src/server/accessors/AppAccessors.ts index 911087df4332..31f5dad3ef02 100644 --- a/packages/apps-engine/src/server/accessors/AppAccessors.ts +++ b/packages/apps-engine/src/server/accessors/AppAccessors.ts @@ -9,7 +9,10 @@ export class AppAccessors implements IAppAccessors { private apiManager: AppApiManager; - constructor(manager: AppManager, private readonly appId: string) { + constructor( + manager: AppManager, + private readonly appId: string, + ) { this.accessorManager = manager.getAccessorManager(); this.apiManager = manager.getApiManager(); } diff --git a/packages/apps-engine/src/server/accessors/CloudWorkspaceRead.ts b/packages/apps-engine/src/server/accessors/CloudWorkspaceRead.ts index fc0e7ba1b8ad..881113f2c09e 100644 --- a/packages/apps-engine/src/server/accessors/CloudWorkspaceRead.ts +++ b/packages/apps-engine/src/server/accessors/CloudWorkspaceRead.ts @@ -3,7 +3,10 @@ import type { IWorkspaceToken } from '../../definition/cloud/IWorkspaceToken'; import type { CloudWorkspaceBridge } from '../bridges/CloudWorkspaceBridge'; export class CloudWorkspaceRead implements ICloudWorkspaceRead { - constructor(private readonly cloudBridge: CloudWorkspaceBridge, private readonly appId: string) {} + constructor( + private readonly cloudBridge: CloudWorkspaceBridge, + private readonly appId: string, + ) {} public async getWorkspaceToken(scope: string): Promise { return this.cloudBridge.doGetWorkspaceToken(scope, this.appId); diff --git a/packages/apps-engine/src/server/accessors/EmailCreator.ts b/packages/apps-engine/src/server/accessors/EmailCreator.ts index 6d481db605e1..c7926a08df70 100644 --- a/packages/apps-engine/src/server/accessors/EmailCreator.ts +++ b/packages/apps-engine/src/server/accessors/EmailCreator.ts @@ -3,7 +3,10 @@ import type { IEmail } from '../../definition/email'; import type { AppBridges } from '../bridges'; export class EmailCreator implements IEmailCreator { - constructor(private readonly bridges: AppBridges, private readonly appId: string) {} + constructor( + private readonly bridges: AppBridges, + private readonly appId: string, + ) {} public async send(email: IEmail): Promise { return this.bridges.getEmailBridge().doSendEmail(email, this.appId); diff --git a/packages/apps-engine/src/server/accessors/EnvironmentWrite.ts b/packages/apps-engine/src/server/accessors/EnvironmentWrite.ts index 6b6a833b36a6..05cdf1b8f4b7 100644 --- a/packages/apps-engine/src/server/accessors/EnvironmentWrite.ts +++ b/packages/apps-engine/src/server/accessors/EnvironmentWrite.ts @@ -1,7 +1,10 @@ import type { IEnvironmentWrite, IServerSettingUpdater, ISettingUpdater } from '../../definition/accessors'; export class EnvironmentWrite implements IEnvironmentWrite { - constructor(private readonly settings: ISettingUpdater, private readonly serverSettings: IServerSettingUpdater) {} + constructor( + private readonly settings: ISettingUpdater, + private readonly serverSettings: IServerSettingUpdater, + ) {} public getSettings(): ISettingUpdater { return this.settings; diff --git a/packages/apps-engine/src/server/accessors/EnvironmentalVariableRead.ts b/packages/apps-engine/src/server/accessors/EnvironmentalVariableRead.ts index 2b8b917b7290..40800c942f10 100644 --- a/packages/apps-engine/src/server/accessors/EnvironmentalVariableRead.ts +++ b/packages/apps-engine/src/server/accessors/EnvironmentalVariableRead.ts @@ -2,7 +2,10 @@ import type { IEnvironmentalVariableRead } from '../../definition/accessors'; import type { EnvironmentalVariableBridge } from '../bridges'; export class EnvironmentalVariableRead implements IEnvironmentalVariableRead { - constructor(private readonly bridge: EnvironmentalVariableBridge, private readonly appId: string) {} + constructor( + private readonly bridge: EnvironmentalVariableBridge, + private readonly appId: string, + ) {} public getValueByName(envVarName: string): Promise { return this.bridge.doGetValueByName(envVarName, this.appId); diff --git a/packages/apps-engine/src/server/accessors/ExternalComponentsExtend.ts b/packages/apps-engine/src/server/accessors/ExternalComponentsExtend.ts index 29fba0b9353f..ddb3fb1b922a 100644 --- a/packages/apps-engine/src/server/accessors/ExternalComponentsExtend.ts +++ b/packages/apps-engine/src/server/accessors/ExternalComponentsExtend.ts @@ -3,7 +3,10 @@ import type { IExternalComponent } from '../../definition/externalComponent/IExt import type { AppExternalComponentManager } from '../managers/AppExternalComponentManager'; export class ExternalComponentsExtend implements IExternalComponentsExtend { - constructor(private readonly manager: AppExternalComponentManager, private readonly appId: string) {} + constructor( + private readonly manager: AppExternalComponentManager, + private readonly appId: string, + ) {} public async register(externalComponent: IExternalComponent): Promise { return Promise.resolve(this.manager.addExternalComponent(this.appId, externalComponent)); diff --git a/packages/apps-engine/src/server/accessors/LivechatCreator.ts b/packages/apps-engine/src/server/accessors/LivechatCreator.ts index 8cd527159662..0462230b97b0 100644 --- a/packages/apps-engine/src/server/accessors/LivechatCreator.ts +++ b/packages/apps-engine/src/server/accessors/LivechatCreator.ts @@ -6,7 +6,10 @@ import type { IUser } from '../../definition/users'; import type { AppBridges } from '../bridges'; export class LivechatCreator implements ILivechatCreator { - constructor(private readonly bridges: AppBridges, private readonly appId: string) {} + constructor( + private readonly bridges: AppBridges, + private readonly appId: string, + ) {} public createRoom(visitor: IVisitor, agent: IUser, extraParams?: IExtraRoomParams): Promise { return this.bridges.getLivechatBridge().doCreateRoom(visitor, agent, this.appId, extraParams); diff --git a/packages/apps-engine/src/server/accessors/LivechatRead.ts b/packages/apps-engine/src/server/accessors/LivechatRead.ts index 3d9421ff9e4c..04374b1c271a 100644 --- a/packages/apps-engine/src/server/accessors/LivechatRead.ts +++ b/packages/apps-engine/src/server/accessors/LivechatRead.ts @@ -6,7 +6,10 @@ import type { IMessage } from '../../definition/messages'; import type { LivechatBridge } from '../bridges/LivechatBridge'; export class LivechatRead implements ILivechatRead { - constructor(private readonly livechatBridge: LivechatBridge, private readonly appId: string) {} + constructor( + private readonly livechatBridge: LivechatBridge, + private readonly appId: string, + ) {} /** * @deprecated please use the `isOnlineAsync` method instead. diff --git a/packages/apps-engine/src/server/accessors/LivechatUpdater.ts b/packages/apps-engine/src/server/accessors/LivechatUpdater.ts index 684bdb2903e1..2d6786ba5158 100644 --- a/packages/apps-engine/src/server/accessors/LivechatUpdater.ts +++ b/packages/apps-engine/src/server/accessors/LivechatUpdater.ts @@ -4,7 +4,10 @@ import type { IUser } from '../../definition/users'; import type { AppBridges } from '../bridges'; export class LivechatUpdater implements ILivechatUpdater { - constructor(private readonly bridges: AppBridges, private readonly appId: string) {} + constructor( + private readonly bridges: AppBridges, + private readonly appId: string, + ) {} public transferVisitor(visitor: IVisitor, transferData: ILivechatTransferData): Promise { return this.bridges.getLivechatBridge().doTransferVisitor(visitor, transferData, this.appId); diff --git a/packages/apps-engine/src/server/accessors/MessageRead.ts b/packages/apps-engine/src/server/accessors/MessageRead.ts index 90db6a2ba509..03c4a952ce7f 100644 --- a/packages/apps-engine/src/server/accessors/MessageRead.ts +++ b/packages/apps-engine/src/server/accessors/MessageRead.ts @@ -5,7 +5,10 @@ import type { IUser } from '../../definition/users'; import type { MessageBridge } from '../bridges/MessageBridge'; export class MessageRead implements IMessageRead { - constructor(private messageBridge: MessageBridge, private appId: string) {} + constructor( + private messageBridge: MessageBridge, + private appId: string, + ) {} public getById(id: string): Promise { return this.messageBridge.doGetById(id, this.appId); diff --git a/packages/apps-engine/src/server/accessors/ModerationModify.ts b/packages/apps-engine/src/server/accessors/ModerationModify.ts index 0fb97fdedb61..7e29895dbf90 100644 --- a/packages/apps-engine/src/server/accessors/ModerationModify.ts +++ b/packages/apps-engine/src/server/accessors/ModerationModify.ts @@ -4,7 +4,10 @@ import type { IUser } from '../../definition/users'; import type { ModerationBridge } from '../bridges'; export class ModerationModify implements IModerationModify { - constructor(private moderationBridge: ModerationBridge, appId: string) {} + constructor( + private moderationBridge: ModerationBridge, + appId: string, + ) {} public report(messageId: string, description: string, userId: string, appId: string): Promise { return this.moderationBridge.doReport(messageId, description, userId, appId); diff --git a/packages/apps-engine/src/server/accessors/Modify.ts b/packages/apps-engine/src/server/accessors/Modify.ts index 7abd4bc1cd33..025057ede70b 100644 --- a/packages/apps-engine/src/server/accessors/Modify.ts +++ b/packages/apps-engine/src/server/accessors/Modify.ts @@ -39,7 +39,10 @@ export class Modify implements IModify { private moderation: ModerationModify; - constructor(private readonly bridges: AppBridges, private readonly appId: string) { + constructor( + private readonly bridges: AppBridges, + private readonly appId: string, + ) { this.creator = new ModifyCreator(this.bridges, this.appId); this.deleter = new ModifyDeleter(this.bridges, this.appId); this.updater = new ModifyUpdater(this.bridges, this.appId); diff --git a/packages/apps-engine/src/server/accessors/ModifyCreator.ts b/packages/apps-engine/src/server/accessors/ModifyCreator.ts index ec829ae98788..29cd3d223f8f 100644 --- a/packages/apps-engine/src/server/accessors/ModifyCreator.ts +++ b/packages/apps-engine/src/server/accessors/ModifyCreator.ts @@ -38,7 +38,10 @@ export class ModifyCreator implements IModifyCreator { private emailCreator: EmailCreator; - constructor(private readonly bridges: AppBridges, private readonly appId: string) { + constructor( + private readonly bridges: AppBridges, + private readonly appId: string, + ) { this.livechatCreator = new LivechatCreator(bridges, appId); this.uploadCreator = new UploadCreator(bridges, appId); this.emailCreator = new EmailCreator(bridges, appId); diff --git a/packages/apps-engine/src/server/accessors/ModifyDeleter.ts b/packages/apps-engine/src/server/accessors/ModifyDeleter.ts index 34a17654b2e0..fae6dd206866 100644 --- a/packages/apps-engine/src/server/accessors/ModifyDeleter.ts +++ b/packages/apps-engine/src/server/accessors/ModifyDeleter.ts @@ -4,7 +4,10 @@ import type { IUser, UserType } from '../../definition/users'; import type { AppBridges } from '../bridges'; export class ModifyDeleter implements IModifyDeleter { - constructor(private readonly bridges: AppBridges, private readonly appId: string) {} + constructor( + private readonly bridges: AppBridges, + private readonly appId: string, + ) {} public async deleteRoom(roomId: string): Promise { return this.bridges.getRoomBridge().doDelete(roomId, this.appId); diff --git a/packages/apps-engine/src/server/accessors/ModifyExtender.ts b/packages/apps-engine/src/server/accessors/ModifyExtender.ts index ecf65f2e5571..9876f983ad57 100644 --- a/packages/apps-engine/src/server/accessors/ModifyExtender.ts +++ b/packages/apps-engine/src/server/accessors/ModifyExtender.ts @@ -7,7 +7,10 @@ import { RoomExtender } from './RoomExtender'; import { VideoConferenceExtender } from './VideoConferenceExtend'; export class ModifyExtender implements IModifyExtender { - constructor(private readonly bridges: AppBridges, private readonly appId: string) {} + constructor( + private readonly bridges: AppBridges, + private readonly appId: string, + ) {} public async extendMessage(messageId: string, updater: IUser): Promise { const msg = await this.bridges.getMessageBridge().doGetById(messageId, this.appId); diff --git a/packages/apps-engine/src/server/accessors/ModifyUpdater.ts b/packages/apps-engine/src/server/accessors/ModifyUpdater.ts index 0ae175b01734..74454febd0a4 100644 --- a/packages/apps-engine/src/server/accessors/ModifyUpdater.ts +++ b/packages/apps-engine/src/server/accessors/ModifyUpdater.ts @@ -17,7 +17,10 @@ export class ModifyUpdater implements IModifyUpdater { private messageUpdater: IMessageUpdater; - constructor(private readonly bridges: AppBridges, private readonly appId: string) { + constructor( + private readonly bridges: AppBridges, + private readonly appId: string, + ) { this.livechatUpdater = new LivechatUpdater(this.bridges, this.appId); this.userUpdater = new UserUpdater(this.bridges, this.appId); } diff --git a/packages/apps-engine/src/server/accessors/Notifier.ts b/packages/apps-engine/src/server/accessors/Notifier.ts index 8e81cc2e9f2e..f8aa947404f7 100644 --- a/packages/apps-engine/src/server/accessors/Notifier.ts +++ b/packages/apps-engine/src/server/accessors/Notifier.ts @@ -8,7 +8,11 @@ import type { MessageBridge, UserBridge } from '../bridges'; import { MessageBuilder } from './MessageBuilder'; export class Notifier implements INotifier { - constructor(private readonly userBridge: UserBridge, private readonly msgBridge: MessageBridge, private readonly appId: string) {} + constructor( + private readonly userBridge: UserBridge, + private readonly msgBridge: MessageBridge, + private readonly appId: string, + ) {} public async notifyUser(user: IUser, message: IMessage): Promise { if (!message.sender || !message.sender.id) { diff --git a/packages/apps-engine/src/server/accessors/OAuthAppsModify.ts b/packages/apps-engine/src/server/accessors/OAuthAppsModify.ts index 71ad047ef66f..ca289b5cc9f5 100644 --- a/packages/apps-engine/src/server/accessors/OAuthAppsModify.ts +++ b/packages/apps-engine/src/server/accessors/OAuthAppsModify.ts @@ -3,7 +3,10 @@ import type { IOAuthAppsModify } from '../../definition/accessors/IOAuthAppsModi import type { OAuthAppsBridge } from '../bridges/OAuthAppsBridge'; export class OAuthAppsModify implements IOAuthAppsModify { - constructor(private readonly oauthAppsBridge: OAuthAppsBridge, private readonly appId: string) {} + constructor( + private readonly oauthAppsBridge: OAuthAppsBridge, + private readonly appId: string, + ) {} public async createOAuthApp(oAuthApp: IOAuthAppParams): Promise { return this.oauthAppsBridge.doCreate(oAuthApp, this.appId); diff --git a/packages/apps-engine/src/server/accessors/OAuthAppsReader.ts b/packages/apps-engine/src/server/accessors/OAuthAppsReader.ts index 2075875d2f06..8afc00ff580a 100644 --- a/packages/apps-engine/src/server/accessors/OAuthAppsReader.ts +++ b/packages/apps-engine/src/server/accessors/OAuthAppsReader.ts @@ -3,7 +3,10 @@ import type { IOAuthAppsReader } from '../../definition/accessors/IOAuthAppsRead import type { OAuthAppsBridge } from '../bridges/OAuthAppsBridge'; export class OAuthAppsReader implements IOAuthAppsReader { - constructor(private readonly oauthAppsBridge: OAuthAppsBridge, private readonly appId: string) {} + constructor( + private readonly oauthAppsBridge: OAuthAppsBridge, + private readonly appId: string, + ) {} public async getOAuthAppById(id: string): Promise { return this.oauthAppsBridge.doGetByid(id, this.appId); diff --git a/packages/apps-engine/src/server/accessors/Persistence.ts b/packages/apps-engine/src/server/accessors/Persistence.ts index 8dc98fa225dd..1e349c70e3fc 100644 --- a/packages/apps-engine/src/server/accessors/Persistence.ts +++ b/packages/apps-engine/src/server/accessors/Persistence.ts @@ -3,7 +3,10 @@ import type { RocketChatAssociationRecord } from '../../definition/metadata'; import type { PersistenceBridge } from '../bridges/PersistenceBridge'; export class Persistence implements IPersistence { - constructor(private persistBridge: PersistenceBridge, private appId: string) {} + constructor( + private persistBridge: PersistenceBridge, + private appId: string, + ) {} public create(data: object): Promise { return this.persistBridge.doCreate(data, this.appId); diff --git a/packages/apps-engine/src/server/accessors/PersistenceRead.ts b/packages/apps-engine/src/server/accessors/PersistenceRead.ts index bd0549d177ad..326a7970b9d5 100644 --- a/packages/apps-engine/src/server/accessors/PersistenceRead.ts +++ b/packages/apps-engine/src/server/accessors/PersistenceRead.ts @@ -3,7 +3,10 @@ import type { RocketChatAssociationRecord } from '../../definition/metadata'; import type { PersistenceBridge } from '../bridges'; export class PersistenceRead implements IPersistenceRead { - constructor(private persistBridge: PersistenceBridge, private appId: string) {} + constructor( + private persistBridge: PersistenceBridge, + private appId: string, + ) {} public read(id: string): Promise { return this.persistBridge.doReadById(id, this.appId); diff --git a/packages/apps-engine/src/server/accessors/RoleRead.ts b/packages/apps-engine/src/server/accessors/RoleRead.ts index 62272edb75e2..0c36d99cc73c 100644 --- a/packages/apps-engine/src/server/accessors/RoleRead.ts +++ b/packages/apps-engine/src/server/accessors/RoleRead.ts @@ -3,7 +3,10 @@ import type { IRole } from '../../definition/roles'; import type { RoleBridge } from '../bridges'; export class RoleRead implements IRoleRead { - constructor(private roleBridge: RoleBridge, private appId: string) {} + constructor( + private roleBridge: RoleBridge, + private appId: string, + ) {} public getOneByIdOrName(idOrName: IRole['id'] | IRole['name']): Promise { return this.roleBridge.doGetOneByIdOrName(idOrName, this.appId); diff --git a/packages/apps-engine/src/server/accessors/RoomRead.ts b/packages/apps-engine/src/server/accessors/RoomRead.ts index 5b7d58ef67e1..7577daa9e851 100644 --- a/packages/apps-engine/src/server/accessors/RoomRead.ts +++ b/packages/apps-engine/src/server/accessors/RoomRead.ts @@ -6,7 +6,10 @@ import type { RoomBridge } from '../bridges'; import { type GetMessagesOptions, GetMessagesSortableFields } from '../bridges/RoomBridge'; export class RoomRead implements IRoomRead { - constructor(private roomBridge: RoomBridge, private appId: string) {} + constructor( + private roomBridge: RoomBridge, + private appId: string, + ) {} public getById(id: string): Promise { return this.roomBridge.doGetById(id, this.appId); diff --git a/packages/apps-engine/src/server/accessors/SchedulerExtend.ts b/packages/apps-engine/src/server/accessors/SchedulerExtend.ts index c6ea866b70b6..8d33f9eeaca2 100644 --- a/packages/apps-engine/src/server/accessors/SchedulerExtend.ts +++ b/packages/apps-engine/src/server/accessors/SchedulerExtend.ts @@ -3,7 +3,10 @@ import type { IProcessor } from '../../definition/scheduler'; import type { AppSchedulerManager } from '../managers/AppSchedulerManager'; export class SchedulerExtend implements ISchedulerExtend { - constructor(private readonly manager: AppSchedulerManager, private readonly appId: string) {} + constructor( + private readonly manager: AppSchedulerManager, + private readonly appId: string, + ) {} public async registerProcessors(processors: Array = []): Promise> { return this.manager.registerProcessors(processors, this.appId); diff --git a/packages/apps-engine/src/server/accessors/SchedulerModify.ts b/packages/apps-engine/src/server/accessors/SchedulerModify.ts index bfbb92e7ffae..9ce4b2c587b2 100644 --- a/packages/apps-engine/src/server/accessors/SchedulerModify.ts +++ b/packages/apps-engine/src/server/accessors/SchedulerModify.ts @@ -7,7 +7,10 @@ function createProcessorId(jobId: string, appId: string): string { } export class SchedulerModify implements ISchedulerModify { - constructor(private readonly bridge: SchedulerBridge, private readonly appId: string) {} + constructor( + private readonly bridge: SchedulerBridge, + private readonly appId: string, + ) {} public async scheduleOnce(job: IOnetimeSchedule): Promise { return this.bridge.doScheduleOnce({ ...job, id: createProcessorId(job.id, this.appId) }, this.appId); diff --git a/packages/apps-engine/src/server/accessors/ServerSettingRead.ts b/packages/apps-engine/src/server/accessors/ServerSettingRead.ts index 5660ac1b1560..3675411af7e3 100644 --- a/packages/apps-engine/src/server/accessors/ServerSettingRead.ts +++ b/packages/apps-engine/src/server/accessors/ServerSettingRead.ts @@ -3,7 +3,10 @@ import type { ISetting } from '../../definition/settings'; import type { ServerSettingBridge } from '../bridges/ServerSettingBridge'; export class ServerSettingRead implements IServerSettingRead { - constructor(private readonly settingBridge: ServerSettingBridge, private readonly appId: string) {} + constructor( + private readonly settingBridge: ServerSettingBridge, + private readonly appId: string, + ) {} public getOneById(id: string): Promise { return this.settingBridge.doGetOneById(id, this.appId); diff --git a/packages/apps-engine/src/server/accessors/ServerSettingUpdater.ts b/packages/apps-engine/src/server/accessors/ServerSettingUpdater.ts index d4022ac643b4..5b8f41d471b3 100644 --- a/packages/apps-engine/src/server/accessors/ServerSettingUpdater.ts +++ b/packages/apps-engine/src/server/accessors/ServerSettingUpdater.ts @@ -3,7 +3,10 @@ import type { ISetting } from '../../definition/settings'; import type { AppBridges } from '../bridges'; export class ServerSettingUpdater implements IServerSettingUpdater { - constructor(private readonly bridges: AppBridges, private readonly appId: string) {} + constructor( + private readonly bridges: AppBridges, + private readonly appId: string, + ) {} public async updateOne(setting: ISetting): Promise { await this.bridges.getServerSettingBridge().doUpdateOne(setting, this.appId); diff --git a/packages/apps-engine/src/server/accessors/ServerSettingsModify.ts b/packages/apps-engine/src/server/accessors/ServerSettingsModify.ts index 3ca999e59f84..e79b946eda0b 100644 --- a/packages/apps-engine/src/server/accessors/ServerSettingsModify.ts +++ b/packages/apps-engine/src/server/accessors/ServerSettingsModify.ts @@ -3,7 +3,10 @@ import type { ISetting } from '../../definition/settings'; import type { ServerSettingBridge } from '../bridges/ServerSettingBridge'; export class ServerSettingsModify implements IServerSettingsModify { - constructor(private readonly bridge: ServerSettingBridge, private readonly appId: string) {} + constructor( + private readonly bridge: ServerSettingBridge, + private readonly appId: string, + ) {} public async hideGroup(name: string): Promise { await this.bridge.doHideGroup(name, this.appId); diff --git a/packages/apps-engine/src/server/accessors/SettingUpdater.ts b/packages/apps-engine/src/server/accessors/SettingUpdater.ts index a4310d9ef6ee..879c1282ee58 100644 --- a/packages/apps-engine/src/server/accessors/SettingUpdater.ts +++ b/packages/apps-engine/src/server/accessors/SettingUpdater.ts @@ -4,7 +4,10 @@ import type { ProxiedApp } from '../ProxiedApp'; import type { AppSettingsManager } from '../managers'; export class SettingUpdater implements ISettingUpdater { - constructor(private readonly app: ProxiedApp, private readonly manager: AppSettingsManager) {} + constructor( + private readonly app: ProxiedApp, + private readonly manager: AppSettingsManager, + ) {} public async updateValue(id: ISetting['id'], value: ISetting['value']) { if (!this.app.getStorageItem().settings[id]) { diff --git a/packages/apps-engine/src/server/accessors/SlashCommandsExtend.ts b/packages/apps-engine/src/server/accessors/SlashCommandsExtend.ts index 4653571443b5..227acb45c74e 100644 --- a/packages/apps-engine/src/server/accessors/SlashCommandsExtend.ts +++ b/packages/apps-engine/src/server/accessors/SlashCommandsExtend.ts @@ -3,7 +3,10 @@ import type { ISlashCommand } from '../../definition/slashcommands'; import type { AppSlashCommandManager } from '../managers/AppSlashCommandManager'; export class SlashCommandsExtend implements ISlashCommandsExtend { - constructor(private readonly manager: AppSlashCommandManager, private readonly appId: string) {} + constructor( + private readonly manager: AppSlashCommandManager, + private readonly appId: string, + ) {} public provideSlashCommand(slashCommand: ISlashCommand): Promise { return Promise.resolve(this.manager.addCommand(this.appId, slashCommand)); diff --git a/packages/apps-engine/src/server/accessors/SlashCommandsModify.ts b/packages/apps-engine/src/server/accessors/SlashCommandsModify.ts index 690157db6de7..3c042b4cf344 100644 --- a/packages/apps-engine/src/server/accessors/SlashCommandsModify.ts +++ b/packages/apps-engine/src/server/accessors/SlashCommandsModify.ts @@ -3,7 +3,10 @@ import type { ISlashCommand } from '../../definition/slashcommands'; import type { AppSlashCommandManager } from '../managers'; export class SlashCommandsModify implements ISlashCommandsModify { - constructor(private readonly manager: AppSlashCommandManager, private readonly appId: string) {} + constructor( + private readonly manager: AppSlashCommandManager, + private readonly appId: string, + ) {} public modifySlashCommand(slashCommand: ISlashCommand): Promise { return Promise.resolve(this.manager.modifyCommand(this.appId, slashCommand)); diff --git a/packages/apps-engine/src/server/accessors/ThreadRead.ts b/packages/apps-engine/src/server/accessors/ThreadRead.ts index 45cdf9225d01..7a9f9572d024 100644 --- a/packages/apps-engine/src/server/accessors/ThreadRead.ts +++ b/packages/apps-engine/src/server/accessors/ThreadRead.ts @@ -3,7 +3,10 @@ import type { IMessage } from '../../definition/messages'; import type { ThreadBridge } from '../bridges/ThreadBridge'; export class ThreadRead implements IThreadRead { - constructor(private threadBridge: ThreadBridge, private appId: string) {} + constructor( + private threadBridge: ThreadBridge, + private appId: string, + ) {} public getThreadById(id: string): Promise> { return this.threadBridge.doGetById(id, this.appId); diff --git a/packages/apps-engine/src/server/accessors/UIController.ts b/packages/apps-engine/src/server/accessors/UIController.ts index 3fb33f8da318..9a76a6914351 100644 --- a/packages/apps-engine/src/server/accessors/UIController.ts +++ b/packages/apps-engine/src/server/accessors/UIController.ts @@ -10,7 +10,10 @@ import { UIHelper } from '../misc/UIHelper'; export class UIController implements IUIController { private readonly uiInteractionBridge: UiInteractionBridge; - constructor(private readonly appId: string, bridges: AppBridges) { + constructor( + private readonly appId: string, + bridges: AppBridges, + ) { this.uiInteractionBridge = bridges.getUiInteractionBridge(); } diff --git a/packages/apps-engine/src/server/accessors/UIExtend.ts b/packages/apps-engine/src/server/accessors/UIExtend.ts index b19db42e7e98..1a5888cf99dd 100644 --- a/packages/apps-engine/src/server/accessors/UIExtend.ts +++ b/packages/apps-engine/src/server/accessors/UIExtend.ts @@ -3,7 +3,10 @@ import type { IUIActionButtonDescriptor } from '../../definition/ui'; import type { UIActionButtonManager } from '../managers/UIActionButtonManager'; export class UIExtend implements IUIExtend { - constructor(private readonly manager: UIActionButtonManager, private readonly appId: string) {} + constructor( + private readonly manager: UIActionButtonManager, + private readonly appId: string, + ) {} public registerButton(button: IUIActionButtonDescriptor): void { this.manager.registerActionButton(this.appId, button); diff --git a/packages/apps-engine/src/server/accessors/UploadCreator.ts b/packages/apps-engine/src/server/accessors/UploadCreator.ts index 7316c43fcf3b..ee92337724f1 100644 --- a/packages/apps-engine/src/server/accessors/UploadCreator.ts +++ b/packages/apps-engine/src/server/accessors/UploadCreator.ts @@ -5,7 +5,10 @@ import type { IUploadDetails } from '../../definition/uploads/IUploadDetails'; import type { AppBridges } from '../bridges'; export class UploadCreator implements IUploadCreator { - constructor(private readonly bridges: AppBridges, private readonly appId: string) {} + constructor( + private readonly bridges: AppBridges, + private readonly appId: string, + ) {} public async uploadBuffer(buffer: Buffer, descriptor: IUploadDescriptor): Promise { if (!descriptor.hasOwnProperty('user') && !descriptor.visitorToken) { diff --git a/packages/apps-engine/src/server/accessors/UploadRead.ts b/packages/apps-engine/src/server/accessors/UploadRead.ts index e2d32de3f9b7..a51c96416298 100644 --- a/packages/apps-engine/src/server/accessors/UploadRead.ts +++ b/packages/apps-engine/src/server/accessors/UploadRead.ts @@ -3,7 +3,10 @@ import type { IUpload } from '../../definition/uploads'; import type { UploadBridge } from '../bridges/UploadBridge'; export class UploadRead implements IUploadRead { - constructor(private readonly uploadBridge: UploadBridge, private readonly appId: string) {} + constructor( + private readonly uploadBridge: UploadBridge, + private readonly appId: string, + ) {} public getById(id: string): Promise { return this.uploadBridge.doGetById(id, this.appId); diff --git a/packages/apps-engine/src/server/accessors/UserRead.ts b/packages/apps-engine/src/server/accessors/UserRead.ts index 4eeb38cc77e3..a8e49b016062 100644 --- a/packages/apps-engine/src/server/accessors/UserRead.ts +++ b/packages/apps-engine/src/server/accessors/UserRead.ts @@ -3,7 +3,10 @@ import type { IUser } from '../../definition/users'; import type { UserBridge } from '../bridges/UserBridge'; export class UserRead implements IUserRead { - constructor(private userBridge: UserBridge, private appId: string) {} + constructor( + private userBridge: UserBridge, + private appId: string, + ) {} public getById(id: string): Promise { return this.userBridge.doGetById(id, this.appId); diff --git a/packages/apps-engine/src/server/accessors/UserUpdater.ts b/packages/apps-engine/src/server/accessors/UserUpdater.ts index ed10617c6a37..239c9e6e4898 100644 --- a/packages/apps-engine/src/server/accessors/UserUpdater.ts +++ b/packages/apps-engine/src/server/accessors/UserUpdater.ts @@ -4,7 +4,10 @@ import type { IUser } from '../../definition/users/IUser'; import type { AppBridges } from '../bridges'; export class UserUpdater implements IUserUpdater { - constructor(private readonly bridges: AppBridges, private readonly appId: string) {} + constructor( + private readonly bridges: AppBridges, + private readonly appId: string, + ) {} public async updateStatusText(user: IUser, statusText: IUser['statusText']) { return this.bridges.getUserBridge().doUpdate(user, { statusText }, this.appId); diff --git a/packages/apps-engine/src/server/accessors/VideoConfProviderExtend.ts b/packages/apps-engine/src/server/accessors/VideoConfProviderExtend.ts index e0e895cb57b0..7427414ed921 100644 --- a/packages/apps-engine/src/server/accessors/VideoConfProviderExtend.ts +++ b/packages/apps-engine/src/server/accessors/VideoConfProviderExtend.ts @@ -3,7 +3,10 @@ import type { IVideoConfProvider } from '../../definition/videoConfProviders'; import type { AppVideoConfProviderManager } from '../managers/AppVideoConfProviderManager'; export class VideoConfProviderExtend implements IVideoConfProvidersExtend { - constructor(private readonly manager: AppVideoConfProviderManager, private readonly appId: string) {} + constructor( + private readonly manager: AppVideoConfProviderManager, + private readonly appId: string, + ) {} public provideVideoConfProvider(provider: IVideoConfProvider): Promise { return Promise.resolve(this.manager.addProvider(this.appId, provider)); diff --git a/packages/apps-engine/src/server/accessors/VideoConferenceRead.ts b/packages/apps-engine/src/server/accessors/VideoConferenceRead.ts index 011e2d2ae844..03eefbc5384e 100644 --- a/packages/apps-engine/src/server/accessors/VideoConferenceRead.ts +++ b/packages/apps-engine/src/server/accessors/VideoConferenceRead.ts @@ -3,7 +3,10 @@ import type { VideoConference } from '../../definition/videoConferences'; import type { VideoConferenceBridge } from '../bridges'; export class VideoConferenceRead implements IVideoConferenceRead { - constructor(private videoConfBridge: VideoConferenceBridge, private appId: string) {} + constructor( + private videoConfBridge: VideoConferenceBridge, + private appId: string, + ) {} public getById(id: string): Promise { return this.videoConfBridge.doGetById(id, this.appId); diff --git a/packages/apps-engine/src/server/managers/AppApi.ts b/packages/apps-engine/src/server/managers/AppApi.ts index 20e6cde3b994..fc42ab97e507 100644 --- a/packages/apps-engine/src/server/managers/AppApi.ts +++ b/packages/apps-engine/src/server/managers/AppApi.ts @@ -17,7 +17,11 @@ export class AppApi { public readonly implementedMethods: Array; - constructor(public app: ProxiedApp, public api: IApi, public endpoint: IApiEndpoint) { + constructor( + public app: ProxiedApp, + public api: IApi, + public endpoint: IApiEndpoint, + ) { this.appId = app.getID(); switch (this.api.visibility) { diff --git a/packages/apps-engine/src/server/managers/AppSlashCommand.ts b/packages/apps-engine/src/server/managers/AppSlashCommand.ts index ef60e1d16877..7da46a6c0a2b 100644 --- a/packages/apps-engine/src/server/managers/AppSlashCommand.ts +++ b/packages/apps-engine/src/server/managers/AppSlashCommand.ts @@ -22,7 +22,10 @@ export class AppSlashCommand { */ public isDisabled: boolean; - constructor(public app: ProxiedApp, public slashCommand: ISlashCommand) { + constructor( + public app: ProxiedApp, + public slashCommand: ISlashCommand, + ) { this.isRegistered = false; this.isEnabled = false; this.isDisabled = false; diff --git a/packages/apps-engine/src/server/managers/AppVideoConfProvider.ts b/packages/apps-engine/src/server/managers/AppVideoConfProvider.ts index 7e74677e1c13..064f4548955c 100644 --- a/packages/apps-engine/src/server/managers/AppVideoConfProvider.ts +++ b/packages/apps-engine/src/server/managers/AppVideoConfProvider.ts @@ -14,7 +14,10 @@ export class AppVideoConfProvider { */ public isRegistered: boolean; - constructor(public app: ProxiedApp, public provider: IVideoConfProvider) { + constructor( + public app: ProxiedApp, + public provider: IVideoConfProvider, + ) { this.isRegistered = false; } diff --git a/packages/apps-engine/src/server/messages/Message.ts b/packages/apps-engine/src/server/messages/Message.ts index b4c02025974f..255bf4af2f05 100644 --- a/packages/apps-engine/src/server/messages/Message.ts +++ b/packages/apps-engine/src/server/messages/Message.ts @@ -60,7 +60,10 @@ export class Message implements IMessage { this._ROOM = new Room(room, this.manager); } - public constructor(message: IMessage, private manager: AppManager) { + public constructor( + message: IMessage, + private manager: AppManager, + ) { Object.assign(this, message); } diff --git a/packages/apps-engine/src/server/oauth2/OAuth2Client.ts b/packages/apps-engine/src/server/oauth2/OAuth2Client.ts index 046ce696aedc..987fe5de58e8 100644 --- a/packages/apps-engine/src/server/oauth2/OAuth2Client.ts +++ b/packages/apps-engine/src/server/oauth2/OAuth2Client.ts @@ -30,7 +30,10 @@ export class OAuth2Client implements IOAuth2Client { `, }; - constructor(private readonly app: App, private readonly config: IOAuth2ClientOptions) {} + constructor( + private readonly app: App, + private readonly config: IOAuth2ClientOptions, + ) {} public async setup(configuration: IConfigurationExtend): Promise { configuration.api.provideApi({ diff --git a/packages/apps-engine/src/server/runtime/AppsEngineNodeRuntime.ts b/packages/apps-engine/src/server/runtime/AppsEngineNodeRuntime.ts index dd69f23159f9..14d8e9d202aa 100644 --- a/packages/apps-engine/src/server/runtime/AppsEngineNodeRuntime.ts +++ b/packages/apps-engine/src/server/runtime/AppsEngineNodeRuntime.ts @@ -38,7 +38,10 @@ export class AppsEngineNodeRuntime extends AppsEngineRuntime { ); } - constructor(private readonly app: App, private readonly customRequire: (mod: string) => any) { + constructor( + private readonly app: App, + private readonly customRequire: (mod: string) => any, + ) { super(app, customRequire); } diff --git a/packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts b/packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts index 5eb3b7cd0918..580775454a46 100644 --- a/packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts +++ b/packages/apps-engine/src/server/runtime/deno/AppsEngineDenoRuntime.ts @@ -94,7 +94,10 @@ export class DenoRuntimeSubprocessController extends EventEmitter { private readonly livenessManager: LivenessManager; // We need to keep the appSource around in case the Deno process needs to be restarted - constructor(manager: AppManager, private readonly appPackage: IParseAppPackageResult) { + constructor( + manager: AppManager, + private readonly appPackage: IParseAppPackageResult, + ) { super(); this.debug = baseDebug.extend(appPackage.info.id); diff --git a/packages/base64/package.json b/packages/base64/package.json index 2e6c2ab9d002..2d9c9b101efb 100644 --- a/packages/base64/package.json +++ b/packages/base64/package.json @@ -13,8 +13,8 @@ "test": "jest" }, "devDependencies": { - "@babel/core": "~7.25.8", - "@babel/preset-env": "~7.25.8", + "@babel/core": "~7.26.0", + "@babel/preset-env": "~7.26.0", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/jest-presets": "workspace:~", "@typescript-eslint/eslint-plugin": "~5.60.1", diff --git a/packages/core-services/package.json b/packages/core-services/package.json index 17c91c235b0c..28248a5d6a0e 100644 --- a/packages/core-services/package.json +++ b/packages/core-services/package.json @@ -3,18 +3,18 @@ "version": "0.7.1-rc.5", "private": true, "devDependencies": { - "@babel/core": "~7.25.8", - "@babel/preset-env": "~7.25.8", - "@babel/preset-typescript": "~7.25.7", + "@babel/core": "~7.26.0", + "@babel/preset-env": "~7.26.0", + "@babel/preset-typescript": "~7.26.0", "@rocket.chat/apps-engine": "workspace:^", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/jest-presets": "workspace:~", "@types/jest": "~29.5.14", - "babel-jest": "^29.5.0", + "babel-jest": "^29.7.0", "eslint": "~8.45.0", "jest": "~29.7.0", "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", - "prettier": "~2.8.8", + "prettier": "~3.3.3", "typescript": "~5.6.3" }, "scripts": { diff --git a/packages/core-services/src/MeteorError.ts b/packages/core-services/src/MeteorError.ts index f86c55eb2c2a..4eebbbc5af74 100644 --- a/packages/core-services/src/MeteorError.ts +++ b/packages/core-services/src/MeteorError.ts @@ -3,7 +3,11 @@ export class MeteorError extends Error { public readonly errorType = 'Meteor.Error'; - public constructor(public readonly error: string | number, public readonly reason?: string, public readonly details?: any) { + public constructor( + public readonly error: string | number, + public readonly reason?: string, + public readonly details?: any, + ) { super(`${reason ? `${reason} ` : ''}[${String(error)}]`); } diff --git a/packages/core-services/src/lib/proxify.ts b/packages/core-services/src/lib/proxify.ts index fdfcb33d7975..ac7d551ac7cd 100644 --- a/packages/core-services/src/lib/proxify.ts +++ b/packages/core-services/src/lib/proxify.ts @@ -4,8 +4,8 @@ type Promisify = { [K in keyof T as T[K] extends (...params: any[]) => unknown ? K : never]: T[K] extends (...params: any[]) => Promise ? T[K] : T[K] extends (...params: infer P) => infer R - ? (...params: P) => Promise - : never; + ? (...params: P) => Promise + : never; }; function handler(namespace: string): ProxyHandler { diff --git a/packages/core-typings/package.json b/packages/core-typings/package.json index 09214775e28c..ed7877690804 100644 --- a/packages/core-typings/package.json +++ b/packages/core-typings/package.json @@ -8,7 +8,7 @@ "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", - "prettier": "~2.8.8", + "prettier": "~3.3.3", "typescript": "~5.6.3" }, "scripts": { diff --git a/packages/core-typings/src/Serialized.ts b/packages/core-typings/src/Serialized.ts index 94f79cb64d06..9c5408d88b95 100644 --- a/packages/core-typings/src/Serialized.ts +++ b/packages/core-typings/src/Serialized.ts @@ -11,16 +11,17 @@ type CustomSerializable = { /** * The type of a value that was serialized via `JSON.stringify` and then deserialized via `JSON.parse`. */ -export type Serialized = T extends CustomSerializable - ? Serialized - : T extends [any, ...any] // is T a tuple? - ? { [K in keyof T]: T extends UnserializablePrimitive ? null : Serialized } - : T extends any[] - ? Serialized[] - : T extends object - ? { [K in keyof T]: Serialized } - : T extends SerializablePrimitive - ? T - : T extends UnserializablePrimitive - ? undefined - : null; +export type Serialized = + T extends CustomSerializable + ? Serialized + : T extends [any, ...any] // is T a tuple? + ? { [K in keyof T]: T extends UnserializablePrimitive ? null : Serialized } + : T extends any[] + ? Serialized[] + : T extends object + ? { [K in keyof T]: Serialized } + : T extends SerializablePrimitive + ? T + : T extends UnserializablePrimitive + ? undefined + : null; diff --git a/packages/core-typings/src/utils.ts b/packages/core-typings/src/utils.ts index e739257c070b..676f44d56d77 100644 --- a/packages/core-typings/src/utils.ts +++ b/packages/core-typings/src/utils.ts @@ -15,10 +15,10 @@ export type KeyOfEach = T extends any ? keyof T : never; export type Jsonify = T extends Date ? string : T extends object - ? { - [k in keyof T]: Jsonify; - } - : T; + ? { + [k in keyof T]: Jsonify; + } + : T; // Use AtLeast when you don't care if you receive a partial or full object, as long as the specified attributes are loaded // Attributes defined as optional will continue to be optional. @@ -31,6 +31,6 @@ export type DeepWritable = T extends (...args: any) => any ? T : { -readonly [P in keyof T]: DeepWritable; - }; + }; export type DistributiveOmit = T extends any ? Omit : never; diff --git a/packages/ddp-client/src/ClientStream.ts b/packages/ddp-client/src/ClientStream.ts index 166e59a61f6f..f5d596a03f7d 100644 --- a/packages/ddp-client/src/ClientStream.ts +++ b/packages/ddp-client/src/ClientStream.ts @@ -11,7 +11,10 @@ import type { PublicationPayloads } from './types/publicationPayloads'; export class ClientStreamImpl extends Emitter implements ClientStream { subscriptions = new Map(); - constructor(private ddp: DDPClient, readonly dispatcher: DDPDispatcher = new DDPDispatcher()) { + constructor( + private ddp: DDPClient, + readonly dispatcher: DDPDispatcher = new DDPDispatcher(), + ) { ddp.onConnection(({ msg }) => { if (msg === 'connected') { this.emit('connected'); diff --git a/packages/ddp-client/src/MinimalDDPClient.ts b/packages/ddp-client/src/MinimalDDPClient.ts index 1f62d4fb8822..b4f9f534d577 100644 --- a/packages/ddp-client/src/MinimalDDPClient.ts +++ b/packages/ddp-client/src/MinimalDDPClient.ts @@ -65,7 +65,11 @@ interface MinimalDDPClientEvents { * ``` */ export class MinimalDDPClient extends Emitter implements DDPClient { - constructor(send?: (params: string) => void, readonly encode = JSON.stringify, readonly decode = JSON.parse) { + constructor( + send?: (params: string) => void, + readonly encode = JSON.stringify, + readonly decode = JSON.parse, + ) { super(); if (send) { this.onDispatchMessage(send); diff --git a/packages/ddp-client/src/TimeoutControl.ts b/packages/ddp-client/src/TimeoutControl.ts index f6cbb05c4283..922bc3e8ac90 100644 --- a/packages/ddp-client/src/TimeoutControl.ts +++ b/packages/ddp-client/src/TimeoutControl.ts @@ -25,7 +25,10 @@ export class TimeoutControl private heartbeatId: ReturnType | undefined; - constructor(readonly timeout: number = 60_000, readonly heartbeat: number = timeout / 2) { + constructor( + readonly timeout: number = 60_000, + readonly heartbeat: number = timeout / 2, + ) { super(); /* istanbul ignore next */ if (this.heartbeat >= this.timeout) { diff --git a/packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts b/packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts index 04ae2e5edeb0..cac646fa2bbf 100644 --- a/packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts +++ b/packages/ddp-client/src/legacy/RocketchatSDKLegacy.ts @@ -163,11 +163,11 @@ export class RocketchatSdkLegacyImpl extends DDPSDK implements RocketchatSDKLega ? { msg: message, rid, - } + } : { ...message, rid, - }, + }, }); } diff --git a/packages/ddp-client/src/livechat/types/LivechatSDK.ts b/packages/ddp-client/src/livechat/types/LivechatSDK.ts index e45cd6603e9f..b57a13cffc89 100644 --- a/packages/ddp-client/src/livechat/types/LivechatSDK.ts +++ b/packages/ddp-client/src/livechat/types/LivechatSDK.ts @@ -3,15 +3,16 @@ import type { OperationParams, OperationResult } from '@rocket.chat/rest-typings import type { StreamerCallbackArgs } from '../../types/streams'; -export type LivechatRoomEvents = StreamerCallbackArgs<'livechat-room', `${string}`> extends [infer A] - ? A extends { type: T; data: unknown } - ? A['data'] - : A extends { type: T; status: unknown } - ? A['status'] - : A extends { type: T; visitor: unknown } - ? A['visitor'] - : never - : never; +export type LivechatRoomEvents = + StreamerCallbackArgs<'livechat-room', `${string}`> extends [infer A] + ? A extends { type: T; data: unknown } + ? A['data'] + : A extends { type: T; status: unknown } + ? A['status'] + : A extends { type: T; visitor: unknown } + ? A['visitor'] + : never + : never; export interface LivechatStream { notifyVisitorActivity(rid: string, username: string, activities: string[]): Promise; diff --git a/packages/ddp-client/src/types/streams.ts b/packages/ddp-client/src/types/streams.ts index 122d37c9f539..eae9d6c7d4fe 100644 --- a/packages/ddp-client/src/types/streams.ts +++ b/packages/ddp-client/src/types/streams.ts @@ -562,18 +562,14 @@ export type StreamKeys = StreamerEvents[S][number]['key'] export type StreamerConfigs = StreamerEvents[N][number]; -export type StreamerConfig> = StreamerConfigs extends infer U - ? U extends any - ? { key: K; args: any } extends U - ? U - : never - : never - : never; +export type StreamerConfig> = + StreamerConfigs extends infer U ? (U extends any ? ({ key: K; args: any } extends U ? U : never) : never) : never; -export type StreamerCallbackArgs> = StreamerConfig extends { - args: any; -} - ? StreamerConfig['args'] - : never; +export type StreamerCallbackArgs> = + StreamerConfig extends { + args: any; + } + ? StreamerConfig['args'] + : never; export type StreamerCallback> = (...args: StreamerCallbackArgs) => void; diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 240289379aac..2c52ac3f3a9a 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -3,8 +3,8 @@ "version": "0.7.0", "description": "Rocket.Chat's JS/TS ESLint config", "dependencies": { - "@babel/core": "^7.25.8", - "@babel/eslint-parser": "~7.25.8", + "@babel/core": "^7.26.0", + "@babel/eslint-parser": "~7.25.9", "@types/eslint": "~8.44.9", "@types/prettier": "^2.6.3", "@typescript-eslint/eslint-plugin": "~5.60.1", @@ -15,8 +15,8 @@ "eslint-plugin-import": "~2.26.0", "eslint-plugin-jest": "~27.2.3", "eslint-plugin-jsx-a11y": "^6.8.0", - "eslint-plugin-prettier": "~4.2.1", - "prettier": "~2.8.8" + "eslint-plugin-prettier": "~5.2.1", + "prettier": "~3.3.3" }, "scripts": { "lint": "eslint --ext .js .", diff --git a/packages/fuselage-ui-kit/.storybook/DocsContainer.tsx b/packages/fuselage-ui-kit/.storybook/DocsContainer.tsx index e15e7f27354a..fa750d0d0d04 100644 --- a/packages/fuselage-ui-kit/.storybook/DocsContainer.tsx +++ b/packages/fuselage-ui-kit/.storybook/DocsContainer.tsx @@ -8,7 +8,7 @@ import { DARK_MODE_EVENT_NAME } from 'storybook-dark-mode'; const channel = addons.getChannel(); const DocsContainer = ( - props: ComponentPropsWithoutRef + props: ComponentPropsWithoutRef, ) => { const [isDark, setDark] = useState(false); diff --git a/packages/fuselage-ui-kit/package.json b/packages/fuselage-ui-kit/package.json index 33e560c22123..a430b5b9a095 100644 --- a/packages/fuselage-ui-kit/package.json +++ b/packages/fuselage-ui-kit/package.json @@ -45,10 +45,10 @@ "@rocket.chat/ui-kit": "workspace:~" }, "devDependencies": { - "@babel/core": "~7.25.8", - "@babel/preset-env": "~7.25.8", - "@babel/preset-react": "~7.25.7", - "@babel/preset-typescript": "~7.25.7", + "@babel/core": "~7.26.0", + "@babel/preset-env": "~7.26.0", + "@babel/preset-react": "~7.25.9", + "@babel/preset-typescript": "~7.26.0", "@rocket.chat/apps-engine": "workspace:^", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/eslint-config": "workspace:^", @@ -64,13 +64,13 @@ "@rocket.chat/ui-contexts": "workspace:^", "@rocket.chat/ui-kit": "workspace:~", "@rocket.chat/ui-video-conf": "workspace:^", - "@storybook/addon-essentials": "^8.3.5", + "@storybook/addon-essentials": "^8.3.6", "@storybook/addon-styling-webpack": "^1.0.0", "@storybook/addon-webpack5-compiler-babel": "^3.0.3", - "@storybook/blocks": "^8.3.5", - "@storybook/react": "^8.3.5", - "@storybook/react-webpack5": "^8.3.5", - "@storybook/theming": "^8.3.5", + "@storybook/blocks": "^8.3.6", + "@storybook/react": "^8.3.6", + "@storybook/react-webpack5": "^8.3.6", + "@storybook/theming": "^8.3.6", "@tanstack/react-query": "^4.36.1", "@testing-library/react": "~16.0.1", "@testing-library/user-event": "~14.5.2", @@ -83,7 +83,7 @@ "jest": "~29.7.0", "normalize.css": "^8.0.1", "npm-run-all": "^4.1.5", - "prettier": "~2.8.8", + "prettier": "~3.3.3", "react": "~17.0.2", "react-dom": "^17.0.2", "react-i18next": "~13.2.2", diff --git a/packages/fuselage-ui-kit/src/blocks/ActionsBlock.tsx b/packages/fuselage-ui-kit/src/blocks/ActionsBlock.tsx index db1a39472a22..548636d1973c 100644 --- a/packages/fuselage-ui-kit/src/blocks/ActionsBlock.tsx +++ b/packages/fuselage-ui-kit/src/blocks/ActionsBlock.tsx @@ -17,7 +17,7 @@ const ActionsBlock = ({ const surfaceType = useSurfaceType(); const [showMoreVisible, setShowMoreVisible] = useState( - () => block.elements.length > 5 && surfaceType !== 'banner' + () => block.elements.length > 5 && surfaceType !== 'banner', ); const handleShowMoreClick = useCallback(() => { @@ -31,9 +31,9 @@ const ActionsBlock = ({ ...element, appId: element.appId ?? block.appId, blockId: element.blockId ?? block.blockId, - }) + }), ), - [block.appId, block.blockId, block.elements, showMoreVisible] + [block.appId, block.blockId, block.elements, showMoreVisible], ); return ( @@ -47,7 +47,7 @@ const ActionsBlock = ({ {surfaceRenderer.renderTextObject( { type: 'plain_text', text: 'Show more...' }, 0, - UiKit.BlockContext.NONE + UiKit.BlockContext.NONE, )} diff --git a/packages/fuselage-ui-kit/src/blocks/CalloutBlock.tsx b/packages/fuselage-ui-kit/src/blocks/CalloutBlock.tsx index a8b634a1739c..1a57fdbda8ce 100644 --- a/packages/fuselage-ui-kit/src/blocks/CalloutBlock.tsx +++ b/packages/fuselage-ui-kit/src/blocks/CalloutBlock.tsx @@ -18,7 +18,7 @@ const CalloutBlock = ({ (block.accessory && surfaceRenderer.renderSectionAccessoryBlockElement( block.accessory, - 0 + 0, )) || undefined } diff --git a/packages/fuselage-ui-kit/src/blocks/ContextBlock.tsx b/packages/fuselage-ui-kit/src/blocks/ContextBlock.tsx index 200bf8b2fc5a..c8dceed816ef 100644 --- a/packages/fuselage-ui-kit/src/blocks/ContextBlock.tsx +++ b/packages/fuselage-ui-kit/src/blocks/ContextBlock.tsx @@ -20,7 +20,7 @@ const ContextBlock = ({ appId: block.appId, blockId: block.blockId, })), - [block.appId, block.blockId, block.elements] + [block.appId, block.blockId, block.elements], ); return ( diff --git a/packages/fuselage-ui-kit/src/blocks/ImageBlock.tsx b/packages/fuselage-ui-kit/src/blocks/ImageBlock.tsx index 00d0a477f883..96baeccbbeec 100644 --- a/packages/fuselage-ui-kit/src/blocks/ImageBlock.tsx +++ b/packages/fuselage-ui-kit/src/blocks/ImageBlock.tsx @@ -84,7 +84,7 @@ const ImageBlock = ({ {surfaceRenderer.renderTextObject( block.title, 0, - UiKit.BlockContext.NONE + UiKit.BlockContext.NONE, )} )} diff --git a/packages/fuselage-ui-kit/src/blocks/InputBlock.tsx b/packages/fuselage-ui-kit/src/blocks/InputBlock.tsx index 9844372a3060..8a4cee136a07 100644 --- a/packages/fuselage-ui-kit/src/blocks/InputBlock.tsx +++ b/packages/fuselage-ui-kit/src/blocks/InputBlock.tsx @@ -26,7 +26,7 @@ const InputBlock = ({ appId: block.element.appId ?? block.appId, blockId: block.element.blockId ?? block.blockId, }), - [block.element, block.appId, block.blockId] + [block.element, block.appId, block.blockId], ); const [{ error }] = useUiKitState(inputElement, context); @@ -38,7 +38,7 @@ const InputBlock = ({ {surfaceRenderer.renderTextObject( block.label, 0, - UiKit.BlockContext.NONE + UiKit.BlockContext.NONE, )} )} @@ -51,7 +51,7 @@ const InputBlock = ({ {surfaceRenderer.renderTextObject( block.hint, 0, - UiKit.BlockContext.NONE + UiKit.BlockContext.NONE, )} )} diff --git a/packages/fuselage-ui-kit/src/blocks/PreviewBlock.tsx b/packages/fuselage-ui-kit/src/blocks/PreviewBlock.tsx index 063ef7bdd34f..363b5e71d9b8 100644 --- a/packages/fuselage-ui-kit/src/blocks/PreviewBlock.tsx +++ b/packages/fuselage-ui-kit/src/blocks/PreviewBlock.tsx @@ -57,8 +57,8 @@ const PreviewBlock = ({ surfaceRenderer.renderTextObject( title, 0, - UiKit.BlockContext.NONE - ) + UiKit.BlockContext.NONE, + ), )} ) : null} @@ -68,8 +68,8 @@ const PreviewBlock = ({ surfaceRenderer.renderTextObject( description, 0, - UiKit.BlockContext.NONE - ) + UiKit.BlockContext.NONE, + ), )} ) : null} diff --git a/packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx b/packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx index 261a81f6b967..c9612d136ba3 100644 --- a/packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx +++ b/packages/fuselage-ui-kit/src/blocks/SectionBlock.tsx @@ -24,7 +24,7 @@ const SectionBlock = ({ ...block.accessory, } : undefined, - [block.appId, block.blockId, block.accessory] + [block.appId, block.blockId, block.accessory], ); return ( @@ -43,7 +43,7 @@ const SectionBlock = ({ {accessoryElement ? surfaceRenderer.renderSectionAccessoryBlockElement( accessoryElement, - 0 + 0, ) : null} diff --git a/packages/fuselage-ui-kit/src/blocks/TabNavigationBlock.tsx b/packages/fuselage-ui-kit/src/blocks/TabNavigationBlock.tsx index cbdf91d948a3..9d5d4f4e1f48 100644 --- a/packages/fuselage-ui-kit/src/blocks/TabNavigationBlock.tsx +++ b/packages/fuselage-ui-kit/src/blocks/TabNavigationBlock.tsx @@ -9,7 +9,7 @@ import type { BlockProps } from '../utils/BlockProps'; type TabNavigationBlockProps = BlockProps; const TabNavigationBlock = ( - blockProps: TabNavigationBlockProps + blockProps: TabNavigationBlockProps, ): ReactElement => { const { block: { tabs }, diff --git a/packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/VideoConferenceBlock.tsx b/packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/VideoConferenceBlock.tsx index 7125dbbf1bc4..f5e749bf2fb1 100644 --- a/packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/VideoConferenceBlock.tsx +++ b/packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/VideoConferenceBlock.tsx @@ -61,7 +61,7 @@ const VideoConferenceBlock = ({ value: block.blockId || '', viewId, }, - e + e, ); }; @@ -74,7 +74,7 @@ const VideoConferenceBlock = ({ value: rid || '', viewId, }, - e + e, ); }; @@ -87,7 +87,7 @@ const VideoConferenceBlock = ({ value: rid, viewId, }, - e + e, ); }; diff --git a/packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/hooks/useVideoConfData.ts b/packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/hooks/useVideoConfData.ts index 8e2ea11e6b41..cc3081db7af6 100644 --- a/packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/hooks/useVideoConfData.ts +++ b/packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/hooks/useVideoConfData.ts @@ -16,6 +16,6 @@ export const useVideoConfData = ({ callId }: { callId: string }) => { return 'always'; }, - } + }, ); }; diff --git a/packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/hooks/useVideoConfDataStream.ts b/packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/hooks/useVideoConfDataStream.ts index bcab7ee10db9..02ba077bfb50 100644 --- a/packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/hooks/useVideoConfDataStream.ts +++ b/packages/fuselage-ui-kit/src/blocks/VideoConferenceBlock/hooks/useVideoConfDataStream.ts @@ -21,7 +21,7 @@ export const useVideoConfDataStream = ({ `${rid}/videoconf`, (id) => id === callId && - queryClient.invalidateQueries(['video-conference', callId]) + queryClient.invalidateQueries(['video-conference', callId]), ); }, [rid, callId, subscribeNotifyRoom, queryClient]); diff --git a/packages/fuselage-ui-kit/src/contexts/UiKitContext.ts b/packages/fuselage-ui-kit/src/contexts/UiKitContext.ts index 96ef1a7376be..c36f82afd53e 100644 --- a/packages/fuselage-ui-kit/src/contexts/UiKitContext.ts +++ b/packages/fuselage-ui-kit/src/contexts/UiKitContext.ts @@ -19,11 +19,11 @@ type ActionParams = { type UiKitContextValue = { action: ( state: ActionParams, - event: Parameters>[0] + event: Parameters>[0], ) => Promise | void; updateState?: ( state: ActionParams, - event: Parameters>[0] + event: Parameters>[0], ) => Promise | void; appId?: string; errors?: { [field: string]: string }[] | { [field: string]: string }; diff --git a/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/ChannelsSelectElement.spec.tsx b/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/ChannelsSelectElement.spec.tsx index a1a1f93dd1cd..f249a2cd3602 100644 --- a/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/ChannelsSelectElement.spec.tsx +++ b/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/ChannelsSelectElement.spec.tsx @@ -69,7 +69,7 @@ describe('UiKit ChannelsSelect Element', () => { , { legacyRoot: true, - } + }, ); }); diff --git a/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/ChannelsSelectElement.tsx b/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/ChannelsSelectElement.tsx index a26037373aa7..af1cceab095c 100644 --- a/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/ChannelsSelectElement.tsx +++ b/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/ChannelsSelectElement.tsx @@ -25,7 +25,7 @@ const ChannelsSelectElement = ({ (value: string | string[]) => { if (!Array.isArray(value)) action({ target: { value } }); }, - [action] + [action], ); return ( diff --git a/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/MultiChannelsSelectElement.spec.tsx b/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/MultiChannelsSelectElement.spec.tsx index 304a1a442d69..b99cbcbbcb44 100644 --- a/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/MultiChannelsSelectElement.spec.tsx +++ b/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/MultiChannelsSelectElement.spec.tsx @@ -66,7 +66,7 @@ describe('UiKit MultiChannelsSelect Element', () => { surfaceRenderer={contextualBarParser} /> , - { legacyRoot: true } + { legacyRoot: true }, ); }); diff --git a/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/MultiChannelsSelectElement.tsx b/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/MultiChannelsSelectElement.tsx index b050a137860d..a263049041c5 100644 --- a/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/MultiChannelsSelectElement.tsx +++ b/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/MultiChannelsSelectElement.tsx @@ -25,7 +25,7 @@ const MultiChannelsSelectElement = ({ (value: string | string[]) => { if (Array.isArray(value)) action({ target: { value } }); }, - [action] + [action], ); return ( diff --git a/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/hooks/useChannelsData.ts b/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/hooks/useChannelsData.ts index 7d4bac6f7866..66019cfcf6e0 100644 --- a/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/hooks/useChannelsData.ts +++ b/packages/fuselage-ui-kit/src/elements/ChannelsSelectElement/hooks/useChannelsData.ts @@ -6,7 +6,7 @@ type useChannelsDataProps = { }; const generateQuery = ( - term = '' + term = '', ): { selector: string; } => ({ selector: JSON.stringify({ name: term }) }); @@ -14,7 +14,7 @@ const generateQuery = ( export const useChannelsData = ({ filter }: useChannelsDataProps) => { const getRooms = useEndpoint( 'GET', - '/v1/rooms.autocomplete.channelAndPrivate' + '/v1/rooms.autocomplete.channelAndPrivate', ); const { data } = useQuery( @@ -26,14 +26,14 @@ export const useChannelsData = ({ filter }: useChannelsDataProps) => { ({ fname, name, _id, avatarETag, t }) => ({ value: _id, label: { name: name || fname, avatarETag, type: t }, - }) + }), ); return options || []; }, { keepPreviousData: true, - } + }, ); return data; diff --git a/packages/fuselage-ui-kit/src/elements/CheckboxElement.tsx b/packages/fuselage-ui-kit/src/elements/CheckboxElement.tsx index 94bc2db21126..ea66a3702094 100644 --- a/packages/fuselage-ui-kit/src/elements/CheckboxElement.tsx +++ b/packages/fuselage-ui-kit/src/elements/CheckboxElement.tsx @@ -32,7 +32,7 @@ const CheckboxElement = ({ {surfaceRenderer.renderTextObject( option.text, 0, - UiKit.BlockContext.NONE + UiKit.BlockContext.NONE, )} diff --git a/packages/fuselage-ui-kit/src/elements/ContextElement/ContextElementItem.tsx b/packages/fuselage-ui-kit/src/elements/ContextElement/ContextElementItem.tsx index bfc93603b232..04bf56166b0f 100644 --- a/packages/fuselage-ui-kit/src/elements/ContextElement/ContextElementItem.tsx +++ b/packages/fuselage-ui-kit/src/elements/ContextElement/ContextElementItem.tsx @@ -21,7 +21,7 @@ export const ContextElementItem = ({ element, BlockContext.CONTEXT, undefined, - index + index, ); if (!renderedElement) { diff --git a/packages/fuselage-ui-kit/src/elements/LinearScaleElement.tsx b/packages/fuselage-ui-kit/src/elements/LinearScaleElement.tsx index 8637c57f8612..bca683be8810 100644 --- a/packages/fuselage-ui-kit/src/elements/LinearScaleElement.tsx +++ b/packages/fuselage-ui-kit/src/elements/LinearScaleElement.tsx @@ -24,15 +24,15 @@ const LinearScaleElement = ({ const [{ loading, value = initialValue, error }, action] = useUiKitState( block, - context + context, ); const points = useMemo( () => Array.from({ length: Math.max(maxValue - minValue + 1, 1) }, (_, i) => - String(minValue + i) + String(minValue + i), ), - [maxValue, minValue] + [maxValue, minValue], ); return ( @@ -47,7 +47,7 @@ const LinearScaleElement = ({ {surfaceRenderer.renderTextObject( preLabel, 0, - UiKit.BlockContext.NONE + UiKit.BlockContext.NONE, )} )} @@ -72,7 +72,7 @@ const LinearScaleElement = ({ text: String(i + minValue), }, 0, - UiKit.BlockContext.NONE + UiKit.BlockContext.NONE, )} ))} @@ -83,7 +83,7 @@ const LinearScaleElement = ({ {surfaceRenderer.renderTextObject( postLabel, 0, - UiKit.BlockContext.NONE + UiKit.BlockContext.NONE, )} )} diff --git a/packages/fuselage-ui-kit/src/elements/MultiStaticSelectElement.tsx b/packages/fuselage-ui-kit/src/elements/MultiStaticSelectElement.tsx index 9bb5746f7ef0..fca56b87613d 100644 --- a/packages/fuselage-ui-kit/src/elements/MultiStaticSelectElement.tsx +++ b/packages/fuselage-ui-kit/src/elements/MultiStaticSelectElement.tsx @@ -23,14 +23,14 @@ const MultiStaticSelectElement = ({ value, fromTextObjectToString(text) ?? '', ]), - [block.options, fromTextObjectToString] + [block.options, fromTextObjectToString], ); const handleChange = useCallback( (value: string[]) => { action({ target: { value } }); }, - [action] + [action], ); return ( diff --git a/packages/fuselage-ui-kit/src/elements/OverflowElement.tsx b/packages/fuselage-ui-kit/src/elements/OverflowElement.tsx index 1af8fe18394c..6b3eafb4aceb 100644 --- a/packages/fuselage-ui-kit/src/elements/OverflowElement.tsx +++ b/packages/fuselage-ui-kit/src/elements/OverflowElement.tsx @@ -25,7 +25,7 @@ const OverflowElement = ({ const fireChange = useCallback( ([value]: [UiKit.ActionOf, string]) => action({ target: { value } }), - [action] + [action], ); const options = useMemo( @@ -38,7 +38,7 @@ const OverflowElement = ({ undefined, url, ]), - [block.options, fromTextObjectToString] + [block.options, fromTextObjectToString], ); const [cursor, handleKeyDown, handleKeyUp, reset, [visible, hide, show]] = @@ -63,7 +63,7 @@ const OverflowElement = ({ reset(); hide(); }, - [action, hide, reset] + [action, hide, reset], ); return ( diff --git a/packages/fuselage-ui-kit/src/elements/RadioButtonElement.tsx b/packages/fuselage-ui-kit/src/elements/RadioButtonElement.tsx index 3076c8583883..618293179642 100644 --- a/packages/fuselage-ui-kit/src/elements/RadioButtonElement.tsx +++ b/packages/fuselage-ui-kit/src/elements/RadioButtonElement.tsx @@ -30,7 +30,7 @@ const RadioButtonElement = ({ {surfaceRenderer.renderTextObject( option.text, 0, - UiKit.BlockContext.NONE + UiKit.BlockContext.NONE, )} diff --git a/packages/fuselage-ui-kit/src/elements/StaticSelectElement.tsx b/packages/fuselage-ui-kit/src/elements/StaticSelectElement.tsx index 549ef2d8bd6e..12726b5163d1 100644 --- a/packages/fuselage-ui-kit/src/elements/StaticSelectElement.tsx +++ b/packages/fuselage-ui-kit/src/elements/StaticSelectElement.tsx @@ -22,14 +22,14 @@ const StaticSelectElement = ({ option.value, fromTextObjectToString(option.text) ?? '', ]), - [block.options, fromTextObjectToString] + [block.options, fromTextObjectToString], ); const handleChange = useCallback( (value: string) => { action({ target: { value } }); }, - [action] + [action], ); return ( diff --git a/packages/fuselage-ui-kit/src/elements/ToggleSwitchElement.tsx b/packages/fuselage-ui-kit/src/elements/ToggleSwitchElement.tsx index daa58c1a730f..7576ba741662 100644 --- a/packages/fuselage-ui-kit/src/elements/ToggleSwitchElement.tsx +++ b/packages/fuselage-ui-kit/src/elements/ToggleSwitchElement.tsx @@ -32,7 +32,7 @@ const ToggleSwitchElement = ({ {surfaceRenderer.renderTextObject( option.text, 0, - UiKit.BlockContext.NONE + UiKit.BlockContext.NONE, )} diff --git a/packages/fuselage-ui-kit/src/elements/UsersSelectElement/MultiUsersSelectElement.spec.tsx b/packages/fuselage-ui-kit/src/elements/UsersSelectElement/MultiUsersSelectElement.spec.tsx index eea4f509fed0..d038c8ac9862 100644 --- a/packages/fuselage-ui-kit/src/elements/UsersSelectElement/MultiUsersSelectElement.spec.tsx +++ b/packages/fuselage-ui-kit/src/elements/UsersSelectElement/MultiUsersSelectElement.spec.tsx @@ -54,7 +54,7 @@ describe('UiKit MultiUsersSelect Element', () => { surfaceRenderer={contextualBarParser} /> , - { legacyRoot: true } + { legacyRoot: true }, ); }); diff --git a/packages/fuselage-ui-kit/src/elements/UsersSelectElement/MultiUsersSelectElement.tsx b/packages/fuselage-ui-kit/src/elements/UsersSelectElement/MultiUsersSelectElement.tsx index 3fd3351c2bb6..375d1b0accc4 100644 --- a/packages/fuselage-ui-kit/src/elements/UsersSelectElement/MultiUsersSelectElement.tsx +++ b/packages/fuselage-ui-kit/src/elements/UsersSelectElement/MultiUsersSelectElement.tsx @@ -34,7 +34,7 @@ const MultiUsersSelectElement = ({ (value: string | string[]) => { if (Array.isArray(value)) action({ target: { value } }); }, - [action] + [action], ); return ( diff --git a/packages/fuselage-ui-kit/src/elements/UsersSelectElement/UserSelectElement.spec.tsx b/packages/fuselage-ui-kit/src/elements/UsersSelectElement/UserSelectElement.spec.tsx index 6e92a85d1656..92c47df451f8 100644 --- a/packages/fuselage-ui-kit/src/elements/UsersSelectElement/UserSelectElement.spec.tsx +++ b/packages/fuselage-ui-kit/src/elements/UsersSelectElement/UserSelectElement.spec.tsx @@ -54,7 +54,7 @@ describe('UiKit UserSelect Element', () => { surfaceRenderer={contextualBarParser} /> , - { legacyRoot: true } + { legacyRoot: true }, ); }); diff --git a/packages/fuselage-ui-kit/src/elements/UsersSelectElement/UsersSelectElement.tsx b/packages/fuselage-ui-kit/src/elements/UsersSelectElement/UsersSelectElement.tsx index 03306a36905c..9f1631566081 100644 --- a/packages/fuselage-ui-kit/src/elements/UsersSelectElement/UsersSelectElement.tsx +++ b/packages/fuselage-ui-kit/src/elements/UsersSelectElement/UsersSelectElement.tsx @@ -27,7 +27,7 @@ const UsersSelectElement = ({ block, context }: UsersSelectElementProps) => { (value: string | string[]) => { if (!Array.isArray(value)) action({ target: { value } }); }, - [action] + [action], ); return ( diff --git a/packages/fuselage-ui-kit/src/elements/UsersSelectElement/hooks/useUsersData.ts b/packages/fuselage-ui-kit/src/elements/UsersSelectElement/hooks/useUsersData.ts index 6ab9ef43f03d..8e807dba8f1c 100644 --- a/packages/fuselage-ui-kit/src/elements/UsersSelectElement/hooks/useUsersData.ts +++ b/packages/fuselage-ui-kit/src/elements/UsersSelectElement/hooks/useUsersData.ts @@ -20,12 +20,12 @@ export const useUsersData = ({ filter }: useUsersDataProps) => { (item): UserAutoCompleteOptionType => ({ value: item.username, label: item.name || item.username, - }) + }), ); return options || []; }, - { keepPreviousData: true } + { keepPreviousData: true }, ); return data; diff --git a/packages/fuselage-ui-kit/src/hooks/useAppTranslation.spec.tsx b/packages/fuselage-ui-kit/src/hooks/useAppTranslation.spec.tsx index 46314982aed8..71782494af7d 100644 --- a/packages/fuselage-ui-kit/src/hooks/useAppTranslation.spec.tsx +++ b/packages/fuselage-ui-kit/src/hooks/useAppTranslation.spec.tsx @@ -107,7 +107,7 @@ describe('with suspense', () => { }); await waitFor(() => - expect(result.current).toBe('jumped over the lazy dog') + expect(result.current).toBe('jumped over the lazy dog'), ); }); diff --git a/packages/fuselage-ui-kit/src/hooks/useStringFromTextObject.ts b/packages/fuselage-ui-kit/src/hooks/useStringFromTextObject.ts index 72908da48eca..84537fd30385 100644 --- a/packages/fuselage-ui-kit/src/hooks/useStringFromTextObject.ts +++ b/packages/fuselage-ui-kit/src/hooks/useStringFromTextObject.ts @@ -16,6 +16,6 @@ export const useStringFromTextObject = () => { ? t?.(textObject.i18n.key, { ...textObject.i18n.args }) : textObject.text; }, - [t] + [t], ); }; diff --git a/packages/fuselage-ui-kit/src/hooks/useUiKitState.ts b/packages/fuselage-ui-kit/src/hooks/useUiKitState.ts index be2813e5d28a..4a3e328b2a1b 100644 --- a/packages/fuselage-ui-kit/src/hooks/useUiKitState.ts +++ b/packages/fuselage-ui-kit/src/hooks/useUiKitState.ts @@ -14,7 +14,7 @@ const getElementValueFromState = ( } | undefined >, - initialValue: string | number | string[] | undefined + initialValue: string | number | string[] | undefined, ) => { return ( (values && @@ -24,7 +24,7 @@ const getElementValueFromState = ( }; type UiKitState< - TElement extends UiKit.ActionableElement = UiKit.ActionableElement + TElement extends UiKit.ActionableElement = UiKit.ActionableElement, > = { loading: boolean; setLoading: (loading: boolean) => void; @@ -34,15 +34,15 @@ type UiKitState< export const useUiKitState = ( element: TElement, - context: UiKit.BlockContext + context: UiKit.BlockContext, ): [ state: UiKitState, action: ( pseudoEvent?: | Event | { target: EventTarget } - | { target: { value: UiKit.ActionOf } } - ) => Promise + | { target: { value: UiKit.ActionOf } }, + ) => Promise, ] => { const { blockId, actionId, appId, dispatchActionConfig } = element; const { @@ -59,7 +59,7 @@ export const useUiKitState = ( const _value = getElementValueFromState(actionId, values, initialValue); const error = Array.isArray(errors) ? errors.find((error) => - Object.keys(error).find((key) => key === actionId) + Object.keys(error).find((key) => key === actionId), )?.[actionId] : errors?.[actionId]; @@ -91,7 +91,7 @@ export const useUiKitState = ( await updateState?.( { blockId, appId, actionId, value: elValue, viewId }, - e + e, ); await action( { @@ -101,7 +101,7 @@ export const useUiKitState = ( value: elValue, viewId, }, - e + e, ); setLoading(false); }); @@ -126,7 +126,7 @@ export const useUiKitState = ( viewId, dispatchActionConfig, }, - e + e, ); }); @@ -145,13 +145,13 @@ export const useUiKitState = ( value, viewId, }, - e + e, ); }); const result: UiKitState = useMemo( () => ({ loading, setLoading, error, value }), - [loading, setLoading, error, value] + [loading, setLoading, error, value], ); if ( @@ -165,7 +165,7 @@ export const useUiKitState = ( if ( (context && [UiKit.BlockContext.SECTION, UiKit.BlockContext.ACTION].includes( - context + context, )) || (Array.isArray(element?.dispatchActionConfig) && element.dispatchActionConfig.includes('on_item_selected')) diff --git a/packages/fuselage-ui-kit/src/stories/Banner.stories.tsx b/packages/fuselage-ui-kit/src/stories/Banner.stories.tsx index 848135428827..109abf0ef551 100644 --- a/packages/fuselage-ui-kit/src/stories/Banner.stories.tsx +++ b/packages/fuselage-ui-kit/src/stories/Banner.stories.tsx @@ -59,23 +59,23 @@ export const SectionWithPlainText = createStory(payloads.sectionWithPlainText); export const SectionWithMrkdwn = createStory(payloads.sectionWithMrkdwn); export const SectionWithTextFields = createStory( - payloads.sectionWithTextFields + payloads.sectionWithTextFields, ); export const SectionWithButtonAccessory = createStory( - payloads.sectionWithButtonAccessory + payloads.sectionWithButtonAccessory, ); export const SectionWithImageAccessory = createStory( - payloads.sectionWithImageAccessory + payloads.sectionWithImageAccessory, ); export const SectionWithOverflowMenuAccessory = createStory( - payloads.sectionWithOverflowMenuAccessory + payloads.sectionWithOverflowMenuAccessory, ); export const SectionWithDatePickerAccessory = createStory( - payloads.sectionWithDatePickerAccessory + payloads.sectionWithDatePickerAccessory, ); export const ImageWithTitle = createStory(payloads.imageWithTitle); @@ -83,25 +83,25 @@ export const ImageWithTitle = createStory(payloads.imageWithTitle); export const ImageWithoutTitle = createStory(payloads.imageWithoutTitle); export const ActionsWithAllSelects = createStory( - payloads.actionsWithAllSelects + payloads.actionsWithAllSelects, ); export const ActionsWithFilteredConversationsSelect = createStory( - payloads.actionsWithFilteredConversationsSelect + payloads.actionsWithFilteredConversationsSelect, ); export const ActionsWithInitializedSelects = createStory( - payloads.actionsWithInitializedSelects + payloads.actionsWithInitializedSelects, ); export const ActionsWithButton = createStory(payloads.actionsWithButton); export const ActionsWithButtonAsLink = createStory( - payloads.actionsWithButtonAsLink + payloads.actionsWithButtonAsLink, ); export const ActionsWithDatePicker = createStory( - payloads.actionsWithDatePicker + payloads.actionsWithDatePicker, ); export const ContextWithPlainText = createStory(payloads.contextWithPlainText); @@ -109,35 +109,35 @@ export const ContextWithPlainText = createStory(payloads.contextWithPlainText); export const ContextWithMrkdwn = createStory(payloads.contextWithMrkdwn); export const ContextWithTextAndImages = createStory( - payloads.contextWithTextAndImages + payloads.contextWithTextAndImages, ); export const InputWithMultilinePlainTextInput = createStory( payloads.inputWithMultilinePlainTextInput, { 'input-0': 'Error', - } + }, ); export const InputWithPlainTextInput = createStory( payloads.inputWithPlainTextInput, { 'input-0': 'Error', - } + }, ); export const InputWithMultiUsersSelect = createStory( payloads.inputWithMultiUsersSelect, { 'input-0': 'Error', - } + }, ); export const InputWithStaticSelect = createStory( payloads.inputWithStaticSelect, { 'input-0': 'Error', - } + }, ); export const InputWithDatePicker = createStory(payloads.inputWithDatePicker, { diff --git a/packages/fuselage-ui-kit/src/stories/Message.stories.tsx b/packages/fuselage-ui-kit/src/stories/Message.stories.tsx index 418904245370..15c099d39ca2 100644 --- a/packages/fuselage-ui-kit/src/stories/Message.stories.tsx +++ b/packages/fuselage-ui-kit/src/stories/Message.stories.tsx @@ -85,23 +85,23 @@ export const SectionWithPlainText = createStory(payloads.sectionWithPlainText); export const SectionWithMrkdwn = createStory(payloads.sectionWithMrkdwn); export const SectionWithTextFields = createStory( - payloads.sectionWithTextFields + payloads.sectionWithTextFields, ); export const SectionWithButtonAccessory = createStory( - payloads.sectionWithButtonAccessory + payloads.sectionWithButtonAccessory, ); export const SectionWithImageAccessory = createStory( - payloads.sectionWithImageAccessory + payloads.sectionWithImageAccessory, ); export const SectionWithOverflowMenuAccessory = createStory( - payloads.sectionWithOverflowMenuAccessory + payloads.sectionWithOverflowMenuAccessory, ); export const SectionWithDatePickerAccessory = createStory( - payloads.sectionWithDatePickerAccessory + payloads.sectionWithDatePickerAccessory, ); export const ImageWithTitle = createStory(payloads.imageWithTitle); @@ -109,25 +109,25 @@ export const ImageWithTitle = createStory(payloads.imageWithTitle); export const ImageWithoutTitle = createStory(payloads.imageWithoutTitle); export const ActionsWithAllSelects = createStory( - payloads.actionsWithAllSelects + payloads.actionsWithAllSelects, ); export const ActionsWithFilteredConversationsSelect = createStory( - payloads.actionsWithFilteredConversationsSelect + payloads.actionsWithFilteredConversationsSelect, ); export const ActionsWithInitializedSelects = createStory( - payloads.actionsWithInitializedSelects + payloads.actionsWithInitializedSelects, ); export const ActionsWithButton = createStory(payloads.actionsWithButton); export const ActionsWithButtonAsLink = createStory( - payloads.actionsWithButtonAsLink + payloads.actionsWithButtonAsLink, ); export const ActionsWithDatePicker = createStory( - payloads.actionsWithDatePicker + payloads.actionsWithDatePicker, ); export const ContextWithPlainText = createStory(payloads.contextWithPlainText); @@ -135,12 +135,12 @@ export const ContextWithPlainText = createStory(payloads.contextWithPlainText); export const ContextWithMrkdwn = createStory(payloads.contextWithMrkdwn); export const ContextWithTextAndImages = createStory( - payloads.contextWithTextAndImages + payloads.contextWithTextAndImages, ); export const Conditional = createStory(payloads.conditional); export const Preview = createStory(payloads.preview); export const PreviewWithExternalUrl = createStory( - payloads.previewWithExternalUrl + payloads.previewWithExternalUrl, ); diff --git a/packages/fuselage-ui-kit/src/stories/Modal.stories.tsx b/packages/fuselage-ui-kit/src/stories/Modal.stories.tsx index 2be71ef91bd8..b4b578c043e0 100644 --- a/packages/fuselage-ui-kit/src/stories/Modal.stories.tsx +++ b/packages/fuselage-ui-kit/src/stories/Modal.stories.tsx @@ -100,23 +100,23 @@ export const SectionWithPlainText = createStory(payloads.sectionWithPlainText); export const SectionWithMrkdwn = createStory(payloads.sectionWithMrkdwn); export const SectionWithTextFields = createStory( - payloads.sectionWithTextFields + payloads.sectionWithTextFields, ); export const SectionWithButtonAccessory = createStory( - payloads.sectionWithButtonAccessory + payloads.sectionWithButtonAccessory, ); export const SectionWithImageAccessory = createStory( - payloads.sectionWithImageAccessory + payloads.sectionWithImageAccessory, ); export const SectionWithOverflowMenuAccessory = createStory( - payloads.sectionWithOverflowMenuAccessory + payloads.sectionWithOverflowMenuAccessory, ); export const SectionWithDatePickerAccessory = createStory( - payloads.sectionWithDatePickerAccessory + payloads.sectionWithDatePickerAccessory, ); export const ImageWithTitle = createStory(payloads.imageWithTitle); @@ -124,25 +124,25 @@ export const ImageWithTitle = createStory(payloads.imageWithTitle); export const ImageWithoutTitle = createStory(payloads.imageWithoutTitle); export const ActionsWithAllSelects = createStory( - payloads.actionsWithAllSelects + payloads.actionsWithAllSelects, ); export const ActionsWithFilteredConversationsSelect = createStory( - payloads.actionsWithFilteredConversationsSelect + payloads.actionsWithFilteredConversationsSelect, ); export const ActionsWithInitializedSelects = createStory( - payloads.actionsWithInitializedSelects + payloads.actionsWithInitializedSelects, ); export const ActionsWithButton = createStory(payloads.actionsWithButton); export const ActionsWithButtonAsLink = createStory( - payloads.actionsWithButtonAsLink + payloads.actionsWithButtonAsLink, ); export const ActionsWithDatePicker = createStory( - payloads.actionsWithDatePicker + payloads.actionsWithDatePicker, ); export const ContextWithPlainText = createStory(payloads.contextWithPlainText); @@ -150,35 +150,35 @@ export const ContextWithPlainText = createStory(payloads.contextWithPlainText); export const ContextWithMrkdwn = createStory(payloads.contextWithMrkdwn); export const ContextWithTextAndImages = createStory( - payloads.contextWithTextAndImages + payloads.contextWithTextAndImages, ); export const InputWithMultilinePlainTextInput = createStory( payloads.inputWithMultilinePlainTextInput, { 'input-0': 'Error', - } + }, ); export const InputWithPlainTextInput = createStory( payloads.inputWithPlainTextInput, { 'input-0': 'Error', - } + }, ); export const InputWithMultiUsersSelect = createStory( payloads.inputWithMultiUsersSelect, { 'input-0': 'Error', - } + }, ); export const InputWithStaticSelect = createStory( payloads.inputWithStaticSelect, { 'input-0': 'Error', - } + }, ); export const InputWithDatePicker = createStory(payloads.inputWithDatePicker, { diff --git a/packages/fuselage-ui-kit/src/surfaces/ContextualBarSurfaceRenderer.tsx b/packages/fuselage-ui-kit/src/surfaces/ContextualBarSurfaceRenderer.tsx index 48b678365a7f..2f8618377af6 100644 --- a/packages/fuselage-ui-kit/src/surfaces/ContextualBarSurfaceRenderer.tsx +++ b/packages/fuselage-ui-kit/src/surfaces/ContextualBarSurfaceRenderer.tsx @@ -30,7 +30,7 @@ export class ContextualBarSurfaceRenderer extends FuselageSurfaceRenderer { tab_navigation( block: UiKit.ExperimentalTabNavigationBlock, context: UiKit.BlockContext, - index: number + index: number, ): ReactElement | null { if (context === UiKit.BlockContext.BLOCK) { return ( diff --git a/packages/fuselage-ui-kit/src/surfaces/FuselageMessageSurfaceRenderer.tsx b/packages/fuselage-ui-kit/src/surfaces/FuselageMessageSurfaceRenderer.tsx index 610dd1f408c5..b937eab9c508 100644 --- a/packages/fuselage-ui-kit/src/surfaces/FuselageMessageSurfaceRenderer.tsx +++ b/packages/fuselage-ui-kit/src/surfaces/FuselageMessageSurfaceRenderer.tsx @@ -29,7 +29,7 @@ export class FuselageMessageSurfaceRenderer extends FuselageSurfaceRenderer { video_conf( block: UiKit.VideoConferenceBlock, context: UiKit.BlockContext, - index: number + index: number, ): ReactElement | null { if (context === UiKit.BlockContext.BLOCK) { return ( diff --git a/packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx b/packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx index 37f3aa796527..fe3c39b31a9d 100644 --- a/packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx +++ b/packages/fuselage-ui-kit/src/surfaces/FuselageSurfaceRenderer.tsx @@ -32,7 +32,7 @@ import UsersSelectElement from '../elements/UsersSelectElement/UsersSelectElemen type TextObjectRenderers = { [TTextObject in UiKit.TextObject as TTextObject['type']]: ( textObject: TTextObject, - index: number + index: number, ) => ReactElement | null; }; @@ -48,7 +48,7 @@ const textObjectRenderers: TextObjectRenderers = { export const renderTextObject = ( textObject: UiKit.TextObject, context: UiKit.BlockContext, - index: number + index: number, ) => { if (context === UiKit.BlockContext.BLOCK) { return null; @@ -65,7 +65,7 @@ export const renderTextObject = ( const isImageBlock = ( _elementOrBlock: UiKit.ImageBlock | UiKit.ImageElement, - context: UiKit.BlockContext + context: UiKit.BlockContext, ): _elementOrBlock is UiKit.ImageBlock => { return context === UiKit.BlockContext.BLOCK; }; @@ -85,14 +85,14 @@ export abstract class FuselageSurfaceRenderer extends UiKit.SurfaceRenderer + S extends UiKit.SurfaceRenderer, >( // eslint-disable-next-line @typescript-eslint/naming-convention SurfaceComponent: ComponentType<{ children: ReactNode }>, - surfaceRenderer: S + surfaceRenderer: S, ) => function Surface( blocks: readonly UiKit.LayoutBlock[], - conditions: UiKit.Conditions = {} + conditions: UiKit.Conditions = {}, ): ReactElement { return ( diff --git a/packages/fuselage-ui-kit/src/surfaces/index.ts b/packages/fuselage-ui-kit/src/surfaces/index.ts index 8b92a4d646a2..24b57931f331 100644 --- a/packages/fuselage-ui-kit/src/surfaces/index.ts +++ b/packages/fuselage-ui-kit/src/surfaces/index.ts @@ -16,10 +16,10 @@ export const contextualBarParser = new ContextualBarSurfaceRenderer(); export const UiKitBanner = createSurfaceRenderer(BannerSurface, bannerParser); export const UiKitMessage = createSurfaceRenderer( MessageSurface, - messageParser + messageParser, ); export const UiKitModal = createSurfaceRenderer(ModalSurface, modalParser); export const UiKitContextualBar = createSurfaceRenderer( ContextualBarSurface, - contextualBarParser + contextualBarParser, ); diff --git a/packages/fuselage-ui-kit/src/utils/extractInitialStateFromLayout.ts b/packages/fuselage-ui-kit/src/utils/extractInitialStateFromLayout.ts index 0fc66c7f72ab..b6054aba92df 100644 --- a/packages/fuselage-ui-kit/src/utils/extractInitialStateFromLayout.ts +++ b/packages/fuselage-ui-kit/src/utils/extractInitialStateFromLayout.ts @@ -5,13 +5,13 @@ import { hasElement } from './hasElement'; import { hasElements } from './hasElements'; const isActionableElement = ( - element: UiKit.BlockElement | UiKit.TextObject + element: UiKit.BlockElement | UiKit.TextObject, ): element is UiKit.ActionableElement => 'actionId' in element && typeof element.actionId === 'string'; const reduceInitialValuesFromLayoutBlock = ( state: { [actionId: string]: Value }, - block: UiKit.LayoutBlock + block: UiKit.LayoutBlock, ) => { if (hasElement(block)) { if (isActionableElement(block.element)) { diff --git a/packages/fuselage-ui-kit/src/utils/getInitialValue.ts b/packages/fuselage-ui-kit/src/utils/getInitialValue.ts index 7e75d4d5231c..fd5fcc00417a 100644 --- a/packages/fuselage-ui-kit/src/utils/getInitialValue.ts +++ b/packages/fuselage-ui-kit/src/utils/getInitialValue.ts @@ -3,27 +3,27 @@ import type * as UiKit from '@rocket.chat/ui-kit'; export type Value = { value: unknown; blockId?: string }; const hasInitialValue = ( - element: UiKit.ActionableElement + element: UiKit.ActionableElement, ): element is UiKit.ActionableElement & { initialValue: number | string } => 'initialValue' in element; const hasInitialTime = ( - element: UiKit.ActionableElement + element: UiKit.ActionableElement, ): element is UiKit.ActionableElement & { initialTime: string } => 'initialTime' in element; const hasInitialDate = ( - element: UiKit.ActionableElement + element: UiKit.ActionableElement, ): element is UiKit.ActionableElement & { initialDate: string } => 'initialDate' in element; const hasInitialOption = ( - element: UiKit.ActionableElement + element: UiKit.ActionableElement, ): element is UiKit.ActionableElement & { initialOption: UiKit.Option } => 'initialOption' in element; const hasInitialOptions = ( - element: UiKit.ActionableElement + element: UiKit.ActionableElement, ): element is UiKit.ActionableElement & { initialOptions: UiKit.Option[] } => 'initialOptions' in element; diff --git a/packages/fuselage-ui-kit/src/utils/hasElement.ts b/packages/fuselage-ui-kit/src/utils/hasElement.ts index 42484addf444..1d438c2e618a 100644 --- a/packages/fuselage-ui-kit/src/utils/hasElement.ts +++ b/packages/fuselage-ui-kit/src/utils/hasElement.ts @@ -6,5 +6,5 @@ type LayoutBlockWithElement = Extract< >; export const hasElement = ( - block: UiKit.LayoutBlock + block: UiKit.LayoutBlock, ): block is LayoutBlockWithElement => 'element' in block; diff --git a/packages/fuselage-ui-kit/src/utils/hasElements.ts b/packages/fuselage-ui-kit/src/utils/hasElements.ts index 9df00cda1768..089238b82484 100644 --- a/packages/fuselage-ui-kit/src/utils/hasElements.ts +++ b/packages/fuselage-ui-kit/src/utils/hasElements.ts @@ -6,6 +6,6 @@ type LayoutBlockWithElements = Extract< >; export const hasElements = ( - block: UiKit.LayoutBlock + block: UiKit.LayoutBlock, ): block is LayoutBlockWithElements => 'elements' in block && Array.isArray(block.elements); diff --git a/packages/gazzodown/package.json b/packages/gazzodown/package.json index 456f89615ef5..ca61b5ede840 100644 --- a/packages/gazzodown/package.json +++ b/packages/gazzodown/package.json @@ -26,7 +26,7 @@ "react-error-boundary": "^3.1.4" }, "devDependencies": { - "@babel/core": "~7.25.8", + "@babel/core": "~7.26.0", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/css-in-js": "~0.31.25", "@rocket.chat/fuselage": "^0.59.3", @@ -36,15 +36,15 @@ "@rocket.chat/styled": "~0.31.25", "@rocket.chat/ui-client": "workspace:^", "@rocket.chat/ui-contexts": "workspace:^", - "@storybook/addon-actions": "^8.3.5", - "@storybook/addon-docs": "^8.3.5", - "@storybook/addon-essentials": "^8.3.5", - "@storybook/addon-interactions": "^8.3.5", - "@storybook/addon-links": "^8.3.5", + "@storybook/addon-actions": "^8.3.6", + "@storybook/addon-docs": "^8.3.6", + "@storybook/addon-essentials": "^8.3.6", + "@storybook/addon-interactions": "^8.3.6", + "@storybook/addon-links": "^8.3.6", "@storybook/addon-styling-webpack": "^1.0.0", "@storybook/addon-webpack5-compiler-babel": "^3.0.3", - "@storybook/react": "^8.3.5", - "@storybook/react-webpack5": "^8.3.5", + "@storybook/react": "^8.3.6", + "@storybook/react-webpack5": "^8.3.6", "@testing-library/react": "~16.0.1", "@types/dompurify": "^3.0.5", "@types/jest": "~29.5.14", @@ -58,7 +58,7 @@ "eslint-plugin-anti-trojan-source": "~1.1.1", "eslint-plugin-react": "~7.32.2", "eslint-plugin-react-hooks": "~4.6.2", - "eslint-plugin-storybook": "^0.9.0", + "eslint-plugin-storybook": "^0.10.1", "identity-obj-proxy": "^3.0.0", "jest": "~29.7.0", "katex": "~0.16.11", diff --git a/packages/instance-status/package.json b/packages/instance-status/package.json index 75ab6314b71a..7af108ff5fe5 100644 --- a/packages/instance-status/package.json +++ b/packages/instance-status/package.json @@ -6,7 +6,7 @@ "@rocket.chat/eslint-config": "workspace:^", "eslint": "~8.45.0", "mongodb": "patch:mongodb@npm%3A4.17.2#~/.yarn/patches/mongodb-npm-4.17.2-40d1286d70.patch", - "prettier": "~2.8.8", + "prettier": "~3.3.3", "typescript": "~5.6.3" }, "scripts": { diff --git a/packages/jest-presets/package.json b/packages/jest-presets/package.json index 7d289bb3a717..7522d5ed3f1e 100644 --- a/packages/jest-presets/package.json +++ b/packages/jest-presets/package.json @@ -21,7 +21,7 @@ "jest-axe": "~9.0.0", "jest-environment-jsdom": "~29.7.0", "jest-environment-node": "~29.7.0", - "uuid": "~9.0.1" + "uuid": "~10.0.0" }, "devDependencies": { "@rocket.chat/eslint-config": "workspace:~", diff --git a/packages/livechat/.storybook/helpers.tsx b/packages/livechat/.storybook/helpers.tsx index f6f4fb4527ad..b6b4caf98dc3 100644 --- a/packages/livechat/.storybook/helpers.tsx +++ b/packages/livechat/.storybook/helpers.tsx @@ -34,7 +34,7 @@ export const avatarResolver = (username: string) => 'guilherme.gazzo': gazzoAvatar, 'martin.schoeler': martinAvatar, 'tasso.evangelista': tassoAvatar, - }[username]); + })[username]; export const attachmentResolver = (url: string) => url; diff --git a/packages/livechat/package.json b/packages/livechat/package.json index a3a47ae5451c..426f6f17aa8b 100644 --- a/packages/livechat/package.json +++ b/packages/livechat/package.json @@ -25,9 +25,9 @@ "typecheck": "tsc -p tsconfig.typecheck.json" }, "devDependencies": { - "@babel/eslint-parser": "~7.25.8", - "@babel/preset-env": "~7.25.8", - "@babel/preset-typescript": "~7.25.7", + "@babel/eslint-parser": "~7.25.9", + "@babel/preset-env": "~7.26.0", + "@babel/preset-typescript": "~7.26.0", "@rocket.chat/core-typings": "workspace:^", "@rocket.chat/ddp-client": "workspace:^", "@rocket.chat/eslint-config": "workspace:^", @@ -35,12 +35,12 @@ "@rocket.chat/fuselage-tokens": "^0.33.1", "@rocket.chat/logo": "^0.31.30", "@rocket.chat/ui-contexts": "workspace:^", - "@storybook/addon-essentials": "^8.3.5", + "@storybook/addon-essentials": "^8.3.6", "@storybook/addon-styling-webpack": "~1.0.0", "@storybook/addon-webpack5-compiler-babel": "^3.0.3", - "@storybook/preact": "^8.3.5", - "@storybook/preact-webpack5": "^8.3.5", - "@storybook/theming": "^8.3.5", + "@storybook/preact": "^8.3.6", + "@storybook/preact-webpack5": "^8.3.6", + "@storybook/theming": "^8.3.6", "@types/crypto-js": "~4.1.3", "@types/markdown-it": "^14.0.1", "@types/mini-css-extract-plugin": "~1.4.3", @@ -91,7 +91,7 @@ "typescript": "~5.6.3", "url-loader": "^4.1.1", "webpack": "~5.95.0", - "webpack-bundle-analyzer": "^4.9.1", + "webpack-bundle-analyzer": "^4.10.2", "webpack-cli": "~5.1.4", "webpack-dev-server": "~5.1.0" }, @@ -111,7 +111,7 @@ "history": "~5.3.0", "i18next": "~23.4.9", "markdown-it": "^14.1.0", - "mem": "^6.1.1", + "mem": "^8.1.1", "mitt": "^2.1.0", "path-to-regexp": "^6.3.0", "preact": "~10.24.3", diff --git a/packages/livechat/src/components/Form/CustomFields/index.tsx b/packages/livechat/src/components/Form/CustomFields/index.tsx index 3bca3375a972..b0f3022ebd01 100644 --- a/packages/livechat/src/components/Form/CustomFields/index.tsx +++ b/packages/livechat/src/components/Form/CustomFields/index.tsx @@ -39,7 +39,7 @@ export const CustomFields = ({ customFields, loading, control, errors }: RenderC message: t('invalid', { field: label }), }, }), - }; + }; return ( diff --git a/packages/livechat/src/helpers/formatAgent.ts b/packages/livechat/src/helpers/formatAgent.ts index 249733b12c64..4d3572e1e806 100644 --- a/packages/livechat/src/helpers/formatAgent.ts +++ b/packages/livechat/src/helpers/formatAgent.ts @@ -26,7 +26,7 @@ export const formatAgent = (agent: AgentType) => { ? { description: agent.username, src: getAvatarUrl(agent.username), - } + } : undefined, }; }; diff --git a/packages/livechat/src/providers/ConnectionStatusProvider.tsx b/packages/livechat/src/providers/ConnectionStatusProvider.tsx index 42378055d808..b72bae1de3e6 100644 --- a/packages/livechat/src/providers/ConnectionStatusProvider.tsx +++ b/packages/livechat/src/providers/ConnectionStatusProvider.tsx @@ -32,7 +32,7 @@ const ConnectionStatusProvider = ({ children }: { children: ComponentChildren }) status, connected: status === 'connected', reconnect: () => sdk.connection.reconnect(), - } as const), + }) as const, [status, sdk], ); diff --git a/packages/livechat/src/routes/Chat/connector.tsx b/packages/livechat/src/routes/Chat/connector.tsx index 3c72f9ae88cf..a66102ffdaba 100644 --- a/packages/livechat/src/routes/Chat/connector.tsx +++ b/packages/livechat/src/routes/Chat/connector.tsx @@ -84,7 +84,7 @@ export const ChatConnector: FunctionalComponent<{ path: string; default: boolean spot: queueInfo.spot, estimatedWaitTimeSeconds: queueInfo.estimatedWaitTimeSeconds, message: queueInfo.message, - } + } : undefined } registrationFormEnabled={registrationForm} diff --git a/packages/logger/src/getPino.ts b/packages/logger/src/getPino.ts index 9361e168d11e..89f7ba729c19 100644 --- a/packages/logger/src/getPino.ts +++ b/packages/logger/src/getPino.ts @@ -36,7 +36,7 @@ const mainPino = pino({ colorize: true, }, }, - } + } : {}), }); diff --git a/packages/message-parser/package.json b/packages/message-parser/package.json index 712b1423ca35..c27148b0838e 100644 --- a/packages/message-parser/package.json +++ b/packages/message-parser/package.json @@ -48,9 +48,9 @@ "docs": "typedoc" }, "devDependencies": { - "@babel/core": "~7.25.8", - "@babel/eslint-parser": "~7.25.8", - "@babel/preset-env": "~7.25.8", + "@babel/core": "~7.26.0", + "@babel/eslint-parser": "~7.25.9", + "@babel/preset-env": "~7.26.0", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/jest-presets": "workspace:~", "@rocket.chat/peggy-loader": "workspace:~", @@ -63,7 +63,7 @@ "jest": "~29.7.0", "npm-run-all": "^4.1.5", "peggy": "3.0.2", - "prettier": "~2.8.8", + "prettier": "~3.3.3", "prettier-plugin-pegjs": "~0.5.4", "rimraf": "^6.0.1", "ts-loader": "~9.4.4", diff --git a/packages/message-parser/src/guards.ts b/packages/message-parser/src/guards.ts index f9d812f49458..c8d35071b9c3 100644 --- a/packages/message-parser/src/guards.ts +++ b/packages/message-parser/src/guards.ts @@ -2,7 +2,7 @@ import type { ASTNode } from './definitions'; export const isNodeOfType = ( value: unknown, - type: N['type'] + type: N['type'], ): value is N => typeof value === 'object' && value !== null && diff --git a/packages/message-parser/src/utils.ts b/packages/message-parser/src/utils.ts index 6c5d605c5c7a..5a52fad9b887 100644 --- a/packages/message-parser/src/utils.ts +++ b/packages/message-parser/src/utils.ts @@ -22,7 +22,7 @@ import type { const generate = (type: Type) => (value: Types[Type]['value']): Types[Type] => - ({ type, value } as any); + ({ type, value }) as any; export const paragraph = generate('PARAGRAPH'); @@ -35,7 +35,7 @@ export const color = (r: number, g: number, b: number, a = 255): Color => ({ export const heading = ( value: Heading['value'], - level: Heading['level'] = 1 + level: Heading['level'] = 1, ): Heading => ({ type: 'HEADING', level, @@ -44,7 +44,7 @@ export const heading = ( export const code = ( value: Code['value'], - language?: Code['language'] + language?: Code['language'], ): Code => ({ type: 'CODE', language: language || 'none', @@ -168,7 +168,7 @@ export const emoticon = (emoticon: string, shortCode: string): Emoji => ({ const joinEmoji = ( current: Inlines, previous: Inlines | undefined, - next: Inlines | undefined + next: Inlines | undefined, ): Inlines => { if (current.type !== 'EMOJI' || !current.value || (!previous && !next)) { return current; @@ -196,21 +196,24 @@ const joinEmoji = ( }; export const reducePlainTexts = ( - values: Paragraph['value'] + values: Paragraph['value'], ): Paragraph['value'] => - values.flat().reduce((result, item, index, values) => { - const next = values[index + 1]; - const current = joinEmoji(item, values[index - 1], next); - const previous: Inlines = result[result.length - 1]; - - if (previous) { - if (current.type === 'PLAIN_TEXT' && current.type === previous.type) { - previous.value += current.value; - return result; + values.flat().reduce( + (result, item, index, values) => { + const next = values[index + 1]; + const current = joinEmoji(item, values[index - 1], next); + const previous: Inlines = result[result.length - 1]; + + if (previous) { + if (current.type === 'PLAIN_TEXT' && current.type === previous.type) { + previous.value += current.value; + return result; + } } - } - return [...result, current]; - }, [] as Paragraph['value']); + return [...result, current]; + }, + [] as Paragraph['value'], + ); export const lineBreak = (): LineBreak => ({ type: 'LINE_BREAK', value: undefined, @@ -236,7 +239,7 @@ export const phoneChecker = (text: string, number: string) => { export const timestamp = ( value: string, - type?: 't' | 'T' | 'd' | 'D' | 'f' | 'F' | 'R' + type?: 't' | 'T' | 'd' | 'D' | 'f' | 'F' | 'R', ): Timestamp => { return { type: 'TIMESTAMP', @@ -249,7 +252,7 @@ export const timestamp = ( }; export const extractFirstResult = ( - value: Types[keyof Types]['value'] + value: Types[keyof Types]['value'], ): Types[keyof Types]['value'] => { if (typeof value !== 'object' || !Array.isArray(value)) { return value; diff --git a/packages/message-parser/tests/abuse.test.ts b/packages/message-parser/tests/abuse.test.ts index c280ee75b4a0..8630deb9179f 100644 --- a/packages/message-parser/tests/abuse.test.ts +++ b/packages/message-parser/tests/abuse.test.ts @@ -7,57 +7,57 @@ test.each([ [ paragraph([ plain( - 'This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&' + 'This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&', ), bold([ plain('()'), italic([ plain( - `+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok` + `+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok`, ), strike([ plain( - `, from now on we repeat some. , REPEATx2 This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&*()_+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok` + `, from now on we repeat some. , REPEATx2 This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&*()_+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok`, ), ]), plain( - ', from now on we repeat some. REPEAT x3 This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&*()' + ', from now on we repeat some. REPEAT x3 This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&*()', ), ]), plain( - `+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok` + `+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok`, ), strike([ plain( - ', from now on we repeat some. REPEAT x4 This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&*()' + ', from now on we repeat some. REPEAT x4 This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&*()', ), italic([ plain( - `+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok~, from now on we repeat some. REPEATx 5 This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&*()` + `+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok~, from now on we repeat some. REPEATx 5 This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&*()`, ), ]), plain( - `+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok` + `+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok`, ), ]), plain( - `, from now on we repeat some. , REPEAT x6 This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&` + `, from now on we repeat some. , REPEAT x6 This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&`, ), ]), plain( - `()_+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok` + `()_+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok`, ), strike([ plain( - `, from now on we repeat some. this can go long for some time, repeat x7 This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&*()` + `, from now on we repeat some. this can go long for some time, repeat x7 This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&*()`, ), italic([ plain( - `+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok~, from now on we repeat some. ,repeat x8 This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&*()` + `+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok~, from now on we repeat some. ,repeat x8 This a message designed to stress test the message parser, trying to force several rules to stack at the same time !!@#$%^&*()`, ), ]), plain( - `+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok` + `+, overloading the symbols {}:"|<>?, some more text ,./;'\\[], numbers too 1234567890-= let it call s o s ok`, ), ]), plain(', from now on we repeat some.'), diff --git a/packages/message-parser/tests/katex.test.ts b/packages/message-parser/tests/katex.test.ts index 2ffb3ec2f06b..581e848f2257 100644 --- a/packages/message-parser/tests/katex.test.ts +++ b/packages/message-parser/tests/katex.test.ts @@ -28,6 +28,6 @@ test.each([ ], ])('parses %p', (input, output) => { expect(parse(input, { katex: { parenthesisSyntax: true } })).toMatchObject( - output + output, ); }); diff --git a/packages/message-parser/tests/link.test.ts b/packages/message-parser/tests/link.test.ts index fcf371474bf2..c5f880b84e0d 100644 --- a/packages/message-parser/tests/link.test.ts +++ b/packages/message-parser/tests/link.test.ts @@ -95,7 +95,7 @@ test.each([ [ paragraph([ link( - 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351' + 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351', ), ]), ], @@ -106,7 +106,7 @@ test.each([ paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351', - [plain('Test')] + [plain('Test')], ), ]), ], @@ -117,7 +117,7 @@ test.each([ paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351', - [plain('title')] + [plain('title')], ), ]), ], @@ -128,7 +128,7 @@ test.each([ paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351', - [bold([plain('title')])] + [bold([plain('title')])], ), ]), ], @@ -139,7 +139,7 @@ test.each([ paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351', - [strike([plain('title')])] + [strike([plain('title')])], ), ]), ], @@ -150,7 +150,7 @@ test.each([ paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351', - [italic([plain('title')])] + [italic([plain('title')])], ), ]), ], @@ -161,7 +161,7 @@ test.each([ paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351', - [italic([bold([strike([plain('title')])])])] + [italic([bold([strike([plain('title')])])])], ), ]), ], @@ -172,7 +172,7 @@ test.each([ paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351?query=test12-34', - [plain('title')] + [plain('title')], ), ]), ], @@ -183,7 +183,7 @@ test.each([ paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do?query=test12-34#Cases/dv/413244000073043351', - [plain('title')] + [plain('title')], ), ]), ], @@ -194,7 +194,7 @@ test.each([ paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351?query=test12-34&query2=abc123', - [plain('title')] + [plain('title')], ), ]), ], @@ -205,7 +205,7 @@ test.each([ paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases?query=test12-34&query2=abcd!e/dv/413244000073043351', - [plain('title')] + [plain('title')], ), ]), ], @@ -216,7 +216,7 @@ test.each([ paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351?query=test12-34&query2=abcd!~-._%2B+', - [plain('title')] + [plain('title')], ), ]), ], @@ -267,7 +267,7 @@ test.each([ paragraph([ link( 'https://github.com/RocketChat/Rocket.Chat/pull/26751/files#diff-c87b108ecf1ede549f8ede68eca840fbb330180b927df0b8a0b4df5d06cbd89b', - [plain('Github link with hash')] + [plain('Github link with hash')], ), ]), ], @@ -278,7 +278,7 @@ test.each([ paragraph([ link( 'https://github.com/RocketChat/Rocket.Chat/pull/26751/files#diff', - [plain('Github link with hash')] + [plain('Github link with hash')], ), ]), ], @@ -309,7 +309,7 @@ test.each([ paragraph([ link( 'https://www.google.com/url?rct=j&sa=t&url=https://ga.de/freizeit/region-erleben/bonn-und-region-tipps-fuers-wochenende-flohmarkt-rheinaue-weltkindertag-stadtfest_aid-53876987&ct=ga&cd=CAIyHDQ0NzEyYWE3MDA1MGNhNTQ6Y29tOmRlOkRFOlI&usg=AOvVaw3ySYrO9lM0iNSnk43gPVwZ', - [plain('Google complex Link')] + [plain('Google complex Link')], ), ]), ], @@ -414,7 +414,7 @@ Text after line break`, paragraph([ link( 'notes://Server/C3257116002CAD60/0/CCAF6BE2824A1F49432588D2001FA73E', - [plain('notes link')] + [plain('notes link')], ), ]), ], @@ -433,7 +433,7 @@ Text after line break`, paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351', - [plain('Test with '), bold([plain('bold')]), plain(' element')] + [plain('Test with '), bold([plain('bold')]), plain(' element')], ), ]), ], @@ -444,7 +444,7 @@ Text after line break`, paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351', - [plain('Test with '), bold([plain('bold')]), plain(' element')] + [plain('Test with '), bold([plain('bold')]), plain(' element')], ), ]), ], @@ -455,7 +455,7 @@ Text after line break`, paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351', - [plain('Test with '), italic([plain('italic')]), plain(' element')] + [plain('Test with '), italic([plain('italic')]), plain(' element')], ), ]), ], @@ -466,7 +466,7 @@ Text after line break`, paragraph([ link( 'https://desk.rocket.chat/support/rocketchat/ShowHomePage.do#Cases/dv/413244000073043351', - [plain('Test with '), strike([plain('strike')]), plain(' element')] + [plain('Test with '), strike([plain('strike')]), plain(' element')], ), ]), ], @@ -481,7 +481,7 @@ Text after line break`, plain('Test with '), italic([bold([strike([plain('title')])])]), plain(' element'), - ] + ], ), ]), ], @@ -505,7 +505,7 @@ Text after line break`, plain('the '), link( 'https://developer.rocket.chat/reference/api/rest-api/endpoints/core-endpoints/chat-endpoints/postmessage', - [plain('audio_url and video_url for post message attachments')] + [plain('audio_url and video_url for post message attachments')], ), ]), ], @@ -555,7 +555,7 @@ Text after line break`, paragraph([ link( 'https://github.com/RocketChat/Rocket.Chat/releases/tag/6.0.0-rc.3', - [plain('here')] + [plain('here')], ), ]), ], diff --git a/packages/message-parser/tests/tasks.test.ts b/packages/message-parser/tests/tasks.test.ts index ef6752bbfc0a..e822ded86ac3 100644 --- a/packages/message-parser/tests/tasks.test.ts +++ b/packages/message-parser/tests/tasks.test.ts @@ -31,15 +31,15 @@ test.each([ plain(', '), bold([plain('formatting')]), ], - true + true, ), task( [ plain( - 'list syntax required (any unordered or ordered list supported)' + 'list syntax required (any unordered or ordered list supported)', ), ], - true + true, ), ]), ], diff --git a/packages/message-parser/tests/url.test.ts b/packages/message-parser/tests/url.test.ts index 0c7c03d110d2..fb178f22dd52 100644 --- a/packages/message-parser/tests/url.test.ts +++ b/packages/message-parser/tests/url.test.ts @@ -7,7 +7,7 @@ test.each([ [ paragraph([ autoLink( - 'https://pt.wikipedia.org/wiki/Condi%C3%A7%C3%A3o_de_corrida#:~:text=Uma%20condi%C3%A7%C3%A3o%20de%20corrida%20%C3%A9,sequ%C3%AAncia%20ou%20sincronia%20doutros%20eventos' + 'https://pt.wikipedia.org/wiki/Condi%C3%A7%C3%A3o_de_corrida#:~:text=Uma%20condi%C3%A7%C3%A3o%20de%20corrida%20%C3%A9,sequ%C3%AAncia%20ou%20sincronia%20doutros%20eventos', ), ]), ], @@ -90,7 +90,7 @@ test.each([ [ paragraph([ autoLink( - 'https://developer.rocket.chat/reference/api/rest-api#production-security-concerns' + 'https://developer.rocket.chat/reference/api/rest-api#production-security-concerns', ), plain(' look at this'), ]), @@ -111,7 +111,7 @@ test.each([ [ paragraph([ autoLink( - 'https://developer.rocket.chat/reference/api/rest-api#fragment?query=query' + 'https://developer.rocket.chat/reference/api/rest-api#fragment?query=query', ), plain(' look at this'), ]), @@ -261,7 +261,7 @@ test.each([ [ paragraph([ autoLink( - 'https://github.com/RocketChat/Rocket.Chat/releases/tag/6.0.0-rc.3' + 'https://github.com/RocketChat/Rocket.Chat/releases/tag/6.0.0-rc.3', ), ]), ], @@ -279,7 +279,7 @@ test.each([ [ paragraph([ link( - 'https://rocketchat.atlassian.net/browse/OC-718?filter=10078&jql=%22Defect%20from%5BVersion%20Picker%20(multiple%20versions)%5D%22%20%3D%206.0.0%20AND%20%22Defect%20from%5BVersion%20Picker%20(multiple%20versions)%5D%22%20%3D%206.0.0%20AND%20created%20%3E%3D%20-48h%20ORDER%20BY%20cf%5B10070%5D%20ASC%2C%20status%20ASC%2C%20created%20DESC' + 'https://rocketchat.atlassian.net/browse/OC-718?filter=10078&jql=%22Defect%20from%5BVersion%20Picker%20(multiple%20versions)%5D%22%20%3D%206.0.0%20AND%20%22Defect%20from%5BVersion%20Picker%20(multiple%20versions)%5D%22%20%3D%206.0.0%20AND%20created%20%3E%3D%20-48h%20ORDER%20BY%20cf%5B10070%5D%20ASC%2C%20status%20ASC%2C%20created%20DESC', ), ]), ], @@ -301,7 +301,7 @@ describe('autoLink with custom hosts settings comming from Rocket.Chat', () => { ], ])('parses %p', (input, output) => { expect( - parse(input, { customDomains: ['local', 'intranet'] }) + parse(input, { customDomains: ['local', 'intranet'] }), ).toMatchObject(output); }); }); @@ -320,29 +320,29 @@ describe('autoLink WITHOUT custom hosts settings comming from Rocket.Chat', () = describe('autoLink helper function', () => { it('should preserve the original protocol if the protocol is http or https', () => { expect(autoLink('https://rocket.chat/test')).toMatchObject( - link('https://rocket.chat/test') + link('https://rocket.chat/test'), ); expect(autoLink('http://rocket.chat/test')).toMatchObject( - link('http://rocket.chat/test') + link('http://rocket.chat/test'), ); }); it('should preserve the original protocol even if for custom protocols', () => { expect(autoLink('custom://rocket.chat/test')).toMatchObject( - link('custom://rocket.chat/test') + link('custom://rocket.chat/test'), ); }); it('should return // as the protocol if // is the protocol specified', () => { expect(autoLink('//rocket.chat/test')).toMatchObject( - link('//rocket.chat/test') + link('//rocket.chat/test'), ); }); it("should return an url concatenated '//' if the url has no protocol", () => { expect(autoLink('rocket.chat/test')).toMatchObject( - link('//rocket.chat/test', [plain('rocket.chat/test')]) + link('//rocket.chat/test', [plain('rocket.chat/test')]), ); }); @@ -350,13 +350,13 @@ describe('autoLink helper function', () => { expect(autoLink('spark-public.s3.amazonaws.com')).toMatchObject( link('//spark-public.s3.amazonaws.com', [ plain('spark-public.s3.amazonaws.com'), - ]) + ]), ); }); it("should return an plain text url due to invalid TLD that's validate with the external library TLDTS", () => { expect(autoLink('rocket.chattt/url_path')).toMatchObject( - plain('rocket.chattt/url_path') + plain('rocket.chattt/url_path'), ); }); }); diff --git a/packages/mock-providers/package.json b/packages/mock-providers/package.json index 68ac3d280fbf..ed9d0b6b4134 100644 --- a/packages/mock-providers/package.json +++ b/packages/mock-providers/package.json @@ -5,7 +5,7 @@ "dependencies": { "@rocket.chat/emitter": "~0.31.25", "@rocket.chat/i18n": "workspace:~", - "@storybook/react": "^8.3.5", + "@storybook/react": "^8.3.6", "i18next": "~23.4.9", "react-i18next": "~13.2.2", "use-sync-external-store": "~1.2.2" diff --git a/packages/mock-providers/src/MockedAppRootBuilder.tsx b/packages/mock-providers/src/MockedAppRootBuilder.tsx index 69ca9cde99e1..8a76fed3b9ff 100644 --- a/packages/mock-providers/src/MockedAppRootBuilder.tsx +++ b/packages/mock-providers/src/MockedAppRootBuilder.tsx @@ -418,7 +418,7 @@ export class MockedAppRootBuilder { name: new Intl.DisplayNames([key], { type: 'language' }).of(key) ?? key, ogName: new Intl.DisplayNames([key], { type: 'language' }).of(key) ?? key, key, - })) + })) : []), ], loadLanguage: async (language) => { diff --git a/packages/model-typings/src/models/IBaseModel.ts b/packages/model-typings/src/models/IBaseModel.ts index 626f91385a04..ad5aba3f8a15 100644 --- a/packages/model-typings/src/models/IBaseModel.ts +++ b/packages/model-typings/src/models/IBaseModel.ts @@ -29,8 +29,8 @@ export type DefaultFields = Record | Record export type ResultFields = Defaults extends void ? Base : Defaults[keyof Defaults] extends 1 - ? Pick - : Omit; + ? Pick + : Omit; export type InsertionModel = EnhancedOmit, '_updatedAt'> & { _updatedAt?: Date; diff --git a/packages/peggy-loader/package.json b/packages/peggy-loader/package.json index 4a26ad60237a..d425fe39c45f 100644 --- a/packages/peggy-loader/package.json +++ b/packages/peggy-loader/package.json @@ -48,7 +48,7 @@ "eslint": "~8.45.0", "npm-run-all": "^4.1.5", "peggy": "3.0.2", - "prettier": "~2.8.8", + "prettier": "~3.3.3", "rimraf": "^6.0.1", "typescript": "~5.6.3", "webpack": "~5.95.0" diff --git a/packages/peggy-loader/src/index.ts b/packages/peggy-loader/src/index.ts index 4d805d2be14d..5dcf3054243d 100644 --- a/packages/peggy-loader/src/index.ts +++ b/packages/peggy-loader/src/index.ts @@ -9,21 +9,20 @@ import type { import peggy from 'peggy'; import type { LoaderContext } from 'webpack'; -type Options = - | BuildOptionsBase & - ( - | Omit< - OutputFormatAmdCommonjsEs<'source'>, - keyof SourceOptionsBase<'source'> - > - | Omit, keyof SourceOptionsBase<'source'>> - | Omit, keyof SourceOptionsBase<'source'>> - | Omit, keyof SourceOptionsBase<'source'>> - ); +type Options = BuildOptionsBase & + ( + | Omit< + OutputFormatAmdCommonjsEs<'source'>, + keyof SourceOptionsBase<'source'> + > + | Omit, keyof SourceOptionsBase<'source'>> + | Omit, keyof SourceOptionsBase<'source'>> + | Omit, keyof SourceOptionsBase<'source'>> + ); function peggyLoader( this: LoaderContext, - grammarContent: string + grammarContent: string, ): string { const options: Options = { format: 'commonjs', diff --git a/packages/random/package.json b/packages/random/package.json index ce97498e087a..192bdbee701d 100644 --- a/packages/random/package.json +++ b/packages/random/package.json @@ -15,8 +15,8 @@ "test": "jest" }, "devDependencies": { - "@babel/core": "~7.25.8", - "@babel/preset-env": "~7.25.8", + "@babel/core": "~7.26.0", + "@babel/preset-env": "~7.26.0", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/jest-presets": "workspace:~", "@typescript-eslint/eslint-plugin": "~5.60.1", diff --git a/packages/release-action/package.json b/packages/release-action/package.json index a1d4db2f3842..6156795469ff 100644 --- a/packages/release-action/package.json +++ b/packages/release-action/package.json @@ -14,7 +14,7 @@ "typescript": "~5.6.3" }, "dependencies": { - "@actions/core": "^1.10.1", + "@actions/core": "^1.11.1", "@actions/exec": "^1.1.1", "@actions/github": "^5.1.1", "@octokit/plugin-throttling": "^6.0.0", diff --git a/packages/rest-typings/src/helpers/ReplacePlaceholders.ts b/packages/rest-typings/src/helpers/ReplacePlaceholders.ts index 66c4892f12c2..08dd43b83067 100644 --- a/packages/rest-typings/src/helpers/ReplacePlaceholders.ts +++ b/packages/rest-typings/src/helpers/ReplacePlaceholders.ts @@ -1,7 +1,7 @@ export type ReplacePlaceholders = string extends TPath ? TPath : TPath extends `${infer Start}:${string}/${infer Rest}` - ? `${Start}${string}/${ReplacePlaceholders}` - : TPath extends `${infer Start}:${string}` - ? `${Start}${string}` - : TPath; + ? `${Start}${string}/${ReplacePlaceholders}` + : TPath extends `${infer Start}:${string}` + ? `${Start}${string}` + : TPath; diff --git a/packages/rest-typings/src/index.ts b/packages/rest-typings/src/index.ts index 930271fe846e..fd1fc3ac2068 100644 --- a/packages/rest-typings/src/index.ts +++ b/packages/rest-typings/src/index.ts @@ -115,7 +115,7 @@ type OperationsByPathPatternAndMethod< path: ReplacePlaceholders; params: GetParams; result: GetResult; - } + } : never; type OperationsByPathPattern = TPathPattern extends any @@ -142,8 +142,8 @@ type MethodToPathWithoutParamsMap = { [TOperation in Operations as Parameters extends { length: 0 } ? TOperation['method'] : undefined extends Parameters[0] - ? TOperation['method'] - : never]: TOperation['path']; + ? TOperation['method'] + : never]: TOperation['path']; }; export type PathFor = MethodToPathMap[TMethod]; @@ -206,10 +206,10 @@ export type OperationResult = string extends T ? Record : T extends `${string}:${infer Param}/${infer Rest}` - ? { [k in Param | keyof UrlParams]: string } - : T extends `${string}:${infer Param}` - ? { [k in Param]: string } - : undefined | Record; + ? { [k in Param | keyof UrlParams]: string } + : T extends `${string}:${infer Param}` + ? { [k in Param]: string } + : undefined | Record; export type MethodOf = TPathPattern extends any ? keyof Endpoints[TPathPattern] : never; diff --git a/packages/sha256/package.json b/packages/sha256/package.json index f10be0d72404..6248ea4bf316 100644 --- a/packages/sha256/package.json +++ b/packages/sha256/package.json @@ -14,8 +14,8 @@ "test": "jest" }, "devDependencies": { - "@babel/core": "~7.25.8", - "@babel/preset-env": "~7.25.8", + "@babel/core": "~7.26.0", + "@babel/preset-env": "~7.26.0", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/jest-presets": "workspace:~", "@typescript-eslint/eslint-plugin": "~5.60.1", diff --git a/packages/tracing/package.json b/packages/tracing/package.json index 47d8b961e689..282536026d1d 100644 --- a/packages/tracing/package.json +++ b/packages/tracing/package.json @@ -6,7 +6,7 @@ "@types/jest": "~29.5.14", "eslint": "~8.45.0", "jest": "~29.6.4", - "ts-jest": "~29.1.1", + "ts-jest": "~29.2.5", "typescript": "~5.3.3" }, "scripts": { diff --git a/packages/ui-avatar/package.json b/packages/ui-avatar/package.json index 809ee4da8751..c26562a5fe91 100644 --- a/packages/ui-avatar/package.json +++ b/packages/ui-avatar/package.json @@ -3,7 +3,7 @@ "version": "8.0.0-rc.5", "private": true, "devDependencies": { - "@babel/core": "~7.25.8", + "@babel/core": "~7.26.0", "@rocket.chat/fuselage": "^0.59.3", "@rocket.chat/ui-contexts": "workspace:^", "@types/react": "~17.0.80", @@ -11,7 +11,7 @@ "eslint": "~8.45.0", "eslint-plugin-react": "~7.32.2", "eslint-plugin-react-hooks": "~4.6.2", - "eslint-plugin-storybook": "~0.6.15", + "eslint-plugin-storybook": "~0.10.1", "eslint-plugin-testing-library": "~5.11.1", "react": "^17.0.2", "typescript": "~5.6.3" diff --git a/packages/ui-client/package.json b/packages/ui-client/package.json index c37b85c0de57..6084fa537bbf 100644 --- a/packages/ui-client/package.json +++ b/packages/ui-client/package.json @@ -18,7 +18,7 @@ "typecheck": "tsc --noEmit" }, "devDependencies": { - "@babel/core": "~7.25.8", + "@babel/core": "~7.26.0", "@react-aria/toolbar": "^3.0.0-beta.1", "@rocket.chat/css-in-js": "~0.31.25", "@rocket.chat/fuselage": "^0.59.3", @@ -28,15 +28,15 @@ "@rocket.chat/mock-providers": "workspace:^", "@rocket.chat/ui-avatar": "workspace:~", "@rocket.chat/ui-contexts": "workspace:~", - "@storybook/addon-actions": "^8.3.5", - "@storybook/addon-docs": "^8.3.5", - "@storybook/addon-essentials": "^8.3.5", - "@storybook/addon-interactions": "^8.3.5", - "@storybook/addon-links": "^8.3.5", + "@storybook/addon-actions": "^8.3.6", + "@storybook/addon-docs": "^8.3.6", + "@storybook/addon-essentials": "^8.3.6", + "@storybook/addon-interactions": "^8.3.6", + "@storybook/addon-links": "^8.3.6", "@storybook/addon-styling-webpack": "^1.0.0", "@storybook/addon-webpack5-compiler-babel": "^3.0.3", - "@storybook/react": "^8.3.5", - "@storybook/react-webpack5": "^8.3.5", + "@storybook/react": "^8.3.6", + "@storybook/react-webpack5": "^8.3.6", "@testing-library/react": "~16.0.1", "@types/jest": "~29.5.14", "@types/react": "~17.0.80", @@ -45,7 +45,7 @@ "eslint-plugin-anti-trojan-source": "~1.1.1", "eslint-plugin-react": "~7.32.2", "eslint-plugin-react-hooks": "~4.6.2", - "eslint-plugin-storybook": "~0.6.15", + "eslint-plugin-storybook": "~0.10.1", "eslint-plugin-testing-library": "~5.11.1", "jest": "~29.7.0", "react": "^17.0.2", diff --git a/packages/ui-client/src/components/EmojiPicker/EmojiPickerContainer.tsx b/packages/ui-client/src/components/EmojiPicker/EmojiPickerContainer.tsx index 48acd0f829b3..f3ff2736d91a 100644 --- a/packages/ui-client/src/components/EmojiPicker/EmojiPickerContainer.tsx +++ b/packages/ui-client/src/components/EmojiPicker/EmojiPickerContainer.tsx @@ -2,23 +2,22 @@ import { Box } from '@rocket.chat/fuselage'; import type { AllHTMLAttributes } from 'react'; import { forwardRef } from 'react'; -const EmojiPickerContainer = forwardRef, 'is' | 'style'>>(function EmojiPickerContainer( - props, - ref, -) { - return ( - - ); -}); +const EmojiPickerContainer = forwardRef, 'is' | 'style'>>( + function EmojiPickerContainer(props, ref) { + return ( + + ); + }, +); export default EmojiPickerContainer; diff --git a/packages/ui-composer/package.json b/packages/ui-composer/package.json index 33d5da1bac1e..36b4952090af 100644 --- a/packages/ui-composer/package.json +++ b/packages/ui-composer/package.json @@ -18,24 +18,24 @@ "typecheck": "tsc --noEmit" }, "devDependencies": { - "@babel/core": "~7.25.8", + "@babel/core": "~7.26.0", "@react-aria/toolbar": "^3.0.0-beta.1", "@rocket.chat/eslint-config": "workspace:^", "@rocket.chat/fuselage": "^0.59.3", "@rocket.chat/icons": "~0.38.0", - "@storybook/addon-actions": "^8.3.5", - "@storybook/addon-docs": "^8.3.5", - "@storybook/addon-essentials": "^8.3.5", + "@storybook/addon-actions": "^8.3.6", + "@storybook/addon-docs": "^8.3.6", + "@storybook/addon-essentials": "^8.3.6", "@storybook/addon-styling-webpack": "^1.0.0", "@storybook/addon-webpack5-compiler-babel": "^3.0.3", - "@storybook/react": "^8.3.5", - "@storybook/react-webpack5": "^8.3.5", + "@storybook/react": "^8.3.6", + "@storybook/react-webpack5": "^8.3.6", "@types/react": "~17.0.80", "@types/react-dom": "~17.0.25", "eslint": "~8.45.0", "eslint-plugin-react": "~7.32.2", "eslint-plugin-react-hooks": "~4.6.2", - "eslint-plugin-storybook": "^0.9.0", + "eslint-plugin-storybook": "^0.10.1", "react": "~17.0.2", "react-dom": "~17.0.2", "storybook": "^8.3.6", diff --git a/packages/ui-composer/src/MessageFooterCallout/MessageFooterCalloutAction.tsx b/packages/ui-composer/src/MessageFooterCallout/MessageFooterCalloutAction.tsx index dde5e42b8130..61bf9422cf70 100644 --- a/packages/ui-composer/src/MessageFooterCallout/MessageFooterCalloutAction.tsx +++ b/packages/ui-composer/src/MessageFooterCallout/MessageFooterCalloutAction.tsx @@ -2,11 +2,10 @@ import { Button } from '@rocket.chat/fuselage'; import type { ComponentProps, ReactElement } from 'react'; import { forwardRef } from 'react'; -const MessageFooterCalloutAction = forwardRef>(function MessageFooterCalloutAction( - props, - ref, -): ReactElement { - return